Crypto
crypto.decrypt
Shared
Decodes a cryptographically encrypted string
Syntax
local result = crypto.decrypt(mode, input, key, iv)Parameters
| Type | Name | Description |
|---|---|---|
string | mode | Decryption mode: • "AES128" - Advanced Encryption Standard 128-bit• "AES192" - Advanced Encryption Standard 192-bit• "AES256" - Advanced Encryption Standard 256-bit |
string | input | Encrypted string to be decrypted |
string | key | Key to be used for decryption |
string | iv | Generated initialization vector |
Returns
| Type | Name | Description |
|---|---|---|
string / bool | result | Decrypted string on successful execution, or false on failure |
Examples
local key = "MySecretKey12345"
local input, iv = crypto.encrypt("AES256", "Hello World", key)
engine.print("Input:", input)
engine.print("Decrypted:", crypto.decrypt("AES256", input, key, iv))