Crypt
crypt.base64encode
Encodes a string of bytes into Base64.
crypt.base64decode
Decodes a Base64 string to a string of bytes.
crypt.encrypt
Encrypts an unencoded string using AES encryption. Returns the base64 encoded and encrypted string, and the IV.
If an AES IV is not provided, a random one will be generated for you, and returned as a 2nd base64 encoded string.
The cipher modes are 'CBC', 'ECB', 'CTR', 'CFB', 'OFB', and 'GCM'. The default is 'CBC'.
crypt.decrypt
Decrypts the base64 encoded and encrypted content. Returns the raw string.
The cipher modes are 'CBC', 'ECB', 'CTR', 'CFB', 'OFB', and 'GCM'.
crypt.generatebytes
Generates a random sequence of bytes of the given size. Returns the sequence as a base64 encoded string.
crypt.generatekey
Generates a base64 encoded 256-bit key. The result can be used as the second parameter for the crypt.encrypt
and crypt.decrypt
functions.
crypt.hash
Returns the result of hashing the data using the given algorithm.
Some algorithms include 'sha1', 'sha384', 'sha512', 'md5', 'sha256', 'sha3-224', 'sha3-256', and 'sha3-512'.
Last updated