diff options
Diffstat (limited to 'lib/Crypto/Cipher/DES.py')
-rw-r--r-- | lib/Crypto/Cipher/DES.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Crypto/Cipher/DES.py b/lib/Crypto/Cipher/DES.py index 2ae63bc..18a7bd1 100644 --- a/lib/Crypto/Cipher/DES.py +++ b/lib/Crypto/Cipher/DES.py @@ -74,6 +74,8 @@ def new(key, *args, **kwargs): The chaining mode to use for encryption or decryption. Default is `MODE_ECB`. IV : byte string + (*Only* `MODE_CBC`, `MODE_CFB`, `MODE_OFB`, `MODE_OPENPGP`). + The initialization vector to use for encryption or decryption. It is ignored for `MODE_ECB` and `MODE_CTR`. @@ -82,12 +84,20 @@ def new(key, *args, **kwargs): and `block_size` +2 bytes for decryption (in the latter case, it is actually the *encrypted* IV which was prefixed to the ciphertext). It is mandatory. - - For all other modes, it must be `block_size` bytes longs. + + For all other modes, it must be 8 bytes long. + nonce : byte string + (*Only* `MODE_EAX`). + A mandatory value that must never be reused for any other encryption. + There are no restrictions on its length, but it is recommended to + use at least 16 bytes. counter : callable (*Only* `MODE_CTR`). A stateful function that returns the next *counter block*, which is a byte string of `block_size` bytes. For better performance, use `Crypto.Util.Counter`. + mac_len : integer + (*Only* `MODE_EAX`). Length of the MAC, in bytes. + It must be no larger than 8 (which is the default). segment_size : integer (*Only* `MODE_CFB`).The number of bits the plaintext and ciphertext are segmented in. @@ -111,6 +121,8 @@ MODE_OFB = 5 MODE_CTR = 6 #: OpenPGP Mode. See `blockalgo.MODE_OPENPGP`. MODE_OPENPGP = 7 +#: EAX Mode. See `blockalgo.MODE_EAX`. +MODE_EAX = 9 #: Size of a data block (in bytes) block_size = 8 #: Size of a key (in bytes) |