teaDecode | Multi Theft Auto: Wiki Skip to content

teaDecode

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function decrypts given base64 representation of encrypted data using the Tiny Encryption Algorithm.

Important

Use decodeString instead, because teaEncode inflates the file size by as high as ~77% (or by ~33% if the input isn't binary converted to base64 string).

Important

teaDecode cannot handle binary data.

Syntax

teaDecode ( )

Code Examples

server

This example creates a /teadecrypt command, which reverts the TEA on a given string with the specified key.

[lua]
function decryptString( cmd, theString, theKey )
if ( theString ) and ( theKey ) then
local decodedString = teaDecode( theString, theKey ) -- Decode the string with the key
outputChatBox( "The decoded string is: " .. tostring( decodedString ) )
else
outputChatBox( "Syntax: /" .. cmd .. " [string] [key]" )
end
end
addCommandHandler( "teadecrypt", decryptString )