fcrypter package

Submodules

fcrypter.aes module

class fcrypter.aes.AESCryptorEAX[source]

Bases: fcrypter.base.templates.Cryptor

AES EAX mode file encryption through use of pycryptodome AES library

For details, see
https://en.wikipedia.org/wiki/EAX_mode http://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf
decrypt_file(key, encr_fpath, decr_fpath)[source]

Decrypts file and verifies integrity

encrypt_file(key, f_path, encr_fpath)[source]

Encrypts files, then digests. Provides plaintext & ciphertext integrity

More info about “Encrypt then MAC” in Bellare & Namprempre paper:

Authenticated Encryption: Relations among notions and analysis of the generic composition paradigm

http://cseweb.ucsd.edu/~mihir/papers/oem.pdf

Since AES library doesn’t provide easy way to do this in seperate actions we add 16 dummy bytes as MAC, write the encrypted content and then seek the dummy bytes and overwrite with the correct MAC

This allows us to read a file for encryption in small chunks to avoid insufficient memory errors

fcrypter.cli module

fcrypter.fcrypter module

fcrypter.fcrypter.get_aes_supported_modes()[source]

Returns a named tuple with supported AES cipher modes and their class name callback

fcrypter.fcrypter.get_supported_ciphers()[source]

Returns a list of named tuples with supported cipher name and callback class name :rtype: dict

fcrypter.fcrypter.pad_key(key, cipher)[source]

Adds extra characters to a key to reach the maximum supported key length :param key: encryption key :type cipher: Cryptor :return: str

Module contents