$WBENCRYPT - encrypt a string

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

Syntax
$WBENCRYPT{AlgType|Key|data|OutputType}
$WBENCRYPT[AlgType|Key|data|OutputType]

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


Returns
The encrypted value of data formated as hexadecimal value, text or Base64 encoded string. When you want to decrypt data, you must use exactly the same algorithm and key! Different algorithms and/or different keys will produce completely different encryption results.

Example

<!--
[FormFields]
wb_command=R
-->
<!--WB_BeginTemplate-->
<html>
<head>
<title>WBENCRYPT</title>
</head>
<body>
Original text: this is text to be encrypted<br>
Encryption key: my secret word<br>
Encrypted text: $WBENCRYPT[AES|my secret word|this is text to be encrypted|B]
</body>
</html> 

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

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