Crypt
Encrypt and decrypt data, produce hashes and HMACs, and source cryptographically secure randomness directly from your scripts.
Symmetric encryption, hashing, HMACs and cryptographically secure randomness, plus Base64 and LZ4 under the same namespace for convenience.
Encrypt, hash, randomise
local key = crypt.generatekey()
local secret = crypt.encrypt("webhook url goes here", key)
writefile("config/hook.enc", secret)
print(crypt.decrypt(readfile("config/hook.enc"), key))
-- Comparing without storing the original.
print(crypt.hash("password"))
print(crypt.hmac("message", key))
-- Randomness you can rely on.
print(crypt.random(16))Storing the key next to the file buys little
Encryption on disk protects against casual reading, not against someone who has your workspace folder. Treat it accordingly.