- Documentation
- Shared functions
- teaDecode
Function
teaDecode
Decrypts text from teaEncode (also from other servers) with the same key. A wrong key gives no error, just different bytes.
Syntax
string teaDecode(string data, string key)Arguments
datastring- Encrypted text (base64).
keystring- The key.
Returns
The decrypted text (with padding zeros).
Example
local plain = teaDecode(getAccountData(account, "sekret") or "", "klucz")
See also
teaEncodeEncrypts text with the TEA cipher and returns base64, compatible with the standard TEA used by existing scripts, so previously encrypted text can be read here. Only the first 16 bytes of the key count. TEA is not a strong cipher; useencodeStringwithaes128for serious data.decodeStringDecrypts, decodes or unpacks data fromencodeString, also data made on another server. Withaes128you pass the key and theiv, withrsathe private key; withzlibthe format can be left out: gzip, zlib and raw are recognised by their header. Characters outside thebase64andbase32alphabets are skipped. Works on the server and on the client.