Crypt
Encoding, hashing, compression, and symmetric encryption.
Available Functions
| Function | Description |
|---|---|
| crypt.base64decode | Returns a base64 decoded string. |
| crypt.base64encode | Returns a base64 encoded string. |
| crypt.decrypt | Decrypts provided data using AES encryption. Returns the decrypted data. |
| crypt.encrypt | Encrypts provided data using AES encryption. Returns both the encrypted data and the initialization vector (iv). |
| crypt.generatebytes | Returns a string of randomly generated bytes. The result is base64 encoded. |
| crypt.generatekey | Generates and returns a random key. Frequently used in combination with with crypt.encrypt and crypt.decrypt. |
| crypt.hash | Hashes and returns user provided data using the specified hashing algorithm. |
| crypt.hmac | Generates and returns an HMAC (Hash based Message Authentication Code). Frequently used in message authentication (see example below). |
| crypt.lz4compress | Returns a compressed string using the LZ4 algorithm. |
| crypt.lz4decompress | Returns a decompressed string using the LZ4 algorithm. |
| crypt.random | Returns a string of randomly generated bytes. The result is not base64 encoded. |