$WBSXOR - simple XOR encryption/decryption

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

Syntax
$WBSXOR{key|data}
$WBSXOR[key|data]

Parameters
key - the string containing encryption key
data - the string to be encrypted or decrypted 


Returns
The XOR encrypted or decrypted string. XOR Encryption is the simplest stream cipher also called the Vernam cipher. The function XORs every data character with appropriate character of the key. The process is exactly same for encryption as well as decryption. With short keys Vernam or XOR Ciphers turn out to be easy to break. Still it is often used by some service providers to encrypt form data sent from web page.

Example

<!--
[FormFields]
wb_command=R
-->
<!--WB_BeginTemplate-->
<html>
<head>
<title>WBSXOR</title>
</head>
<body>
Encrypted text: $WBSETV[enctext|$WBSXOR[myshortkey|This is plain, clear text]|T]<br>
Decrypted text: $WBSXOR[myshortkey|$WBGETV[enctext]]
</body>
</html> 

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

Encrypted text: 9O K DO M 
Decrypted text: This is plain, clear text