Encryptors
Encryptors provide the encryption and decryption functionality, along with any other behaviour needed by the encryption algorithm, such as key derivation and salt generation.
They are designed to be used by the different Engines. As such, these are not supposed to be instantiated manually.
The BaseEncryptor class
- class encryptors.base_encryptor.BaseEncryptor(password)
Provides a common interface for creating concrete encryptor classes.
- Parameters:
password (bytes) – The plaintext password provided by the user.
- password
The plaintext password.
- abstract encrypt()
Given data as bytes, encrypt it. Must be implemented by a concrete Encryptor class.
- abstract decrypt()
Given data as bytes, decrypt it. Must be implemented by a concrete Encryptor class.
All encryptors should subclass the BaseEncryptor class found in clypher.src.encryptors.base_encryptor.py. It provides a very simple interface for the most common operations.