encrypt
and decrypt
functions for protecting arbitrary data with apasswordencrypt
and decrypt
functions shouldprovide reasonable security to encrypted messages. It ensures the data iskept secret (using AES), blocks are encrypted together (CBC), the samemessage encrypted twice will have different ciphertexts (salt), the ciphertexthasn't been tampered with (HMAC) and the key has some defense against brute-force(PBKDF2).(nonce,ciphertext,tag)
:var MODE_ECB: | Electronic Code Book (ECB) |
---|---|
var MODE_CBC: | Cipher-Block Chaining (CBC) |
var MODE_CFB: | Cipher FeedBack (CFB) |
var MODE_OFB: | Output FeedBack (OFB) |
var MODE_CTR: | CounTer Mode (CTR) |
var MODE_OPENPGP: | |
OpenPGP Mode | |
var MODE_CCM: | Counter with CBC-MAC (CCM) Mode |
var MODE_EAX: | EAX Mode |
var MODE_GCM: | Galois Counter Mode (GCM) |
var MODE_SIV: | Syntethic Initialization Vector (SIV) |
var MODE_OCB: | Offset Code Book (OCB) |
Crypto.Cipher.AES.
new
(key, mode, *args, **kwargs)¶Parameters: |
|
---|---|
Keyword Arguments: | |
| |
Return: | an AES object, of the applicable mode. |