openssh_key.cipher.confidentiality.TripleDES_CBCCipher¶
- class openssh_key.cipher.confidentiality.TripleDES_CBCCipher¶
Bases:
openssh_key.cipher.confidentiality.TripleDESCipher,openssh_key.cipher.confidentiality.CBCCipherThe Triple Data Encryption Algorithm with a key length of 192 bits, under the cipher block chaining mode of operation initialized with a given initialization vector.
- __init__()¶
Methods
ALGORITHM()MODE()__init__()decrypt(kdf, passphrase, cipher_bytes)Decrypts the given ciphertext bytes using the given options of a key derivation function and the given passphrase to derive the encryption key.
decrypt_with_key_iv(cipher_bytes, ...)Decrypts the given ciphertext bytes using the given cipher key and initialization vector.
encrypt(kdf, passphrase, plain_bytes)Encrypts the given plaintext bytes using the given options of a key derivation function and the given passphrase to derive the encryption key.
encrypt_with_key_iv(plain_bytes, cipher_key, ...)Encrypts the given plaintext bytes using the given cipher key and initialization vector.
The Triple Data Encryption Algorithm.
The value 8, the cipher block size of Triple DES.
The initialization vector length for this cipher in bytes.
The value 24, the length in bytes of the three concatenated cipher keys used by 3DES.
get_mode()The cipher block chaining mode of operation.
Attributes
BLOCK_SIZEThe block size for this cipher.
IV_LENGTHThe initialization vector length for this cipher in bytes.
KEY_LENGTHThe key length for this cipher in bytes.
- classmethod decrypt(kdf, passphrase, cipher_bytes)¶
Decrypts the given ciphertext bytes using the given options of a key derivation function and the given passphrase to derive the encryption key.
- Parameters
kdf (
KDFOptions) – The options of a key derivation function.passphrase (
str) – The passphrase from which the cipher key is derived.cipher_bytes (
bytes) – Ciphertext bytes to be decrypted.
- Return type
- Returns
Plaintext bytes.
- classmethod decrypt_with_key_iv(cipher_bytes, cipher_key, initialization_vector)¶
Decrypts the given ciphertext bytes using the given cipher key and initialization vector.
- classmethod encrypt(kdf, passphrase, plain_bytes)¶
Encrypts the given plaintext bytes using the given options of a key derivation function and the given passphrase to derive the encryption key.
- Parameters
kdf (
KDFOptions) – The options of a key derivation function.passphrase (
str) – The passphrase from which the cipher key is derived.plain_bytes (
bytes) – Plaintext bytes to be encrypted.
- Return type
- Returns
Ciphertext bytes.
- classmethod encrypt_with_key_iv(plain_bytes, cipher_key, initialization_vector)¶
Encrypts the given plaintext bytes using the given cipher key and initialization vector.
- classmethod get_algorithm()¶
The Triple Data Encryption Algorithm.
- abstract classmethod get_iv_length()¶
The initialization vector length for this cipher in bytes. Defaults to the block size.
- Return type
- static get_key_length()¶
The value 24, the length in bytes of the three concatenated cipher keys used by 3DES.
- Return type