apicrud.aes_encrypt¶
aes_encrypt.py
Provides easier-to-use AES CBC encrypt/decrypt operations for strings
created 14-may-2019 by richb@instantlinux.net
Functions
|
Return a bytes object containing random bytes suitable for cryptographic use. |
Classes
|
AES encryption for strings |
-
class
apicrud.aes_encrypt.
AESEncrypt
(secret)¶ AES encryption for strings
- Parameters
secret (str) – passphrase (suggest at least 16 characters)
-
decrypt
(enc)¶ decrypt an object
- Parameters
enc (bytes) – encrypted object
- Returns
decrypted string
- Return type
str
-
encrypt
(raw)¶ encrypt a string
- Parameters
raw (str) – object to be encrypted
- Returns
encrypted object
- Return type
bytes