Ciphertext#

class usencrypt.cipher.Ciphertext(value=None, hexstr=None, mode='static')#

Abstract base class for encrypted objects.

Parameters
  • value (any supported encryptable type) – The value to be encrypted. Defaults to None.

  • hextr (str) – The hexadecimal representation of the encrypted object. Defaults to None.

  • mode (str) – The mode of encryption. Defaults to 'static'.

Note

usencrypt.cipher.Ciphertext is meant to be used as an abstract-only class, and is thus never created directly. This is handled by its sub-classes, which provide functions for various tasks with encrypted data.

Methods

Ciphertext.decrypt

Decrypts the encrypted object \(E(x)\), returning the original non-encrypted \(x\).

Ciphertext.encrypt_other

Encrypts \(x\) dynamically with the same dtype as the encrypted object \(E(x)\).