$WBDECRYPT - decrypt encrypted string

Availability
$WBDECRYPT is available for use with all WBSP commands.

Syntax
$WBDECRYPT{AlgType|Key|data|InputType}
$WBDECRYPT[AlgType|Key|data|InputType]

Parameters
AlgType - algorithm type that will be used (must be the one used for original encryption). Valid types are AES, AES192, AES256, BF (Blowfish), CAST, DES, RC2, RC4, RC5, 3DES (TripleDES), UC (UNIXcrypt).
data - encrypted data to be decrypted
key - the string containing encryption key (must be exactly the same as one used for original encryption)
InputType - optional parameter  - defines the format of input data (the string to be decrypted). Valid types are H for hexadecimal (default), T for text and B for Base64 encoded string. 


Returns
Decrypted value of data. When decrypting data, you must use exactly the same algorithm and key used for encryption! Different algorithms and/or different keys will produce unusable results.

Example

<!--
[FormFields]
wb_command=R
-->
<!--WB_BeginTemplate-->
<html>
<head>
<title>WBDECRYPT</title>
</head>
<body>
Encrypted text: xHBuQv8ae1vXCVA6/3/YCd5IUjL3lbnbzHDjlWt74fGfcNuS3osQtID1BMhepJI3<br>
Encryption key: my secret word<br>
Decrypted text: $WBDECRYPT[AES|my secret word|xHBuQv8ae1vXCVA6/3/YCd5IUjL3lbnbzHDjlWt74fGfcNuS3osQtID1BMhepJI3|B]
</body>
</html> 

After running this example, the resulting page in browser should look like this:

Encrypted text: xHBuQv8ae1vXCVA6/3/YCd5IUjL3lbnbzHDjlWt74fGfcNuS3osQtID1BMhepJI3
Encryption key: my secret word
Decrypted text: this is text to be encrypted