crypt.decrypt
Decrypts base64 text made by crypt.encrypt and returns the original string.
Signature
crypt.decrypt(data: string, key: string, iv: string, mode: string): stringParameters
datastringThe encrypted text, base64 encoded, as crypt.encrypt returned it.
keystringThe key used to encrypt, base64 encoded.
ivstringThe initialization vector used to encrypt, base64 encoded.
modestringThe cipher mode used to encrypt, for example "CBC".
Returns
string
Example
local key = base64encode("GMVIsgHnxm0YDYwUGkBhtRWSrSsfRMjY")
local iv = base64encode("1234567890abcdef")
print(crypt.decrypt("jxF03fu7V3WKm7b2oRMo9HYz+KVDymqKU29qmsiTP4E=", key, iv, "CBC")) --> 1234567890abcdef