pgcontents/crypto.py
def single_password_crypto_factory(password):
    """
    Create and return a function suitable for passing as a crypto_factory to
    ``pgcontents.utils.sync.reencrypt_all_users``

    The factory here returns a ``FernetEncryption`` that uses a key derived
    from ``password`` and salted with the supplied user_id.
    """
    @memoize_single_arg
    def factory(user_id):
        return FernetEncryption(
            Fernet(derive_single_fernet_key(password, user_id))
        )
    return factory
def single_password_crypto_factory(password):
    """
    Create and return a function suitable for passing as a crypto_factory to
    ``pgcontents.utils.sync.reencrypt_all_users``

    The factory here returns a ``FernetEncryption`` that uses a key derived
    from ``password`` and salted with the supplied user_id.
    """
    @memoize_single_arg
    def factory(user_id):
        return FernetEncryption(
            Fernet(derive_single_fernet_key(password, user_id))
        )
    return factory
Create and return a function suitable for passing as a crypto_factory to
    ``pgcontents.utils.sync.reencrypt_all_users``

    The factory here returns a ``FernetEncryption`` that uses a key derived
    from ``password`` and salted with the supplied user_id.