Category

Cryptography

Encoding, hashing, encryption, and compression.

Category guide

Overview

Use this overview to understand the category before opening a specific function.
  • See what this group of functions is meant to solve.
  • Compare function names and descriptions in one table.
  • Open a function for syntax, arguments, returns, and examples.

Cryptography

Available functions

11 functions
FunctionDescription
base64_decodeDecodes Base64 input with Base64 decoder and returns the decoded bytes as a Lua string.
base64_encodeEncodes a Lua string's bytes with Base64 encoder, using = padding and no line breaks.
crypt.decryptDecrypts Base64 ciphertext with a Base64-decoded key and required Base64 IV using AES CBC or ECB.
crypt.encryptEncrypts Lua string bytes with AES CBC, ECB, or CTR using a Base64-decoded key, then returns Base64 ciphertext and the IV result.
crypt.generatebytesGenerates random bytes with random byte generator and returns them Base64-encoded as a Lua string.
crypt.generatekeyGenerates 32 random raw bytes with random byte generator and returns them Base64-encoded as a Lua string.
crypt.hashHashes Lua string bytes with a supported crypto library hash algorithm and returns a lowercase hexadecimal digest.
crypt.hmacComputes a crypto library HMAC over Lua string bytes using a raw Lua string key and returns a Base64 digest.
crypt.randomGenerates raw random bytes with random byte generator and returns them as a Lua string.
lz4compressCompresses Lua string bytes with LZ4 block compression and returns the raw compressed bytes as a Lua string.
lz4decompressDecompresses raw LZ4 block bytes with LZ4 block decompression and returns raw decompressed bytes as a Lua string.