gever.encrypt

Functions

encrypt_symmetric(→ bytes)

Encrypts the given text using Fernet (symmetric encryption).

decrypt_symmetric(→ str)

Decrypts the encrypted data using the provided key.

Module Contents

gever.encrypt.encrypt_symmetric(plaintext: str, key_base64: bytes) bytes[source]

Encrypts the given text using Fernet (symmetric encryption).

plaintext (str): The data to encrypt. key (bytes): The encryption key, base-64 encoded bytes.

Returns: the encrypted data in bytes.

gever.encrypt.decrypt_symmetric(fernet_token: bytes, key_base64: bytes) str[source]

Decrypts the encrypted data using the provided key.

fernet_token (bytes): Data to decrypt. key (bytes): The encryption key: 32 url-safe base64-encoded bytes.

Returns the decrypted text.