Cloaking (Encrypting) StringsAuthor: Carl Sassenrath Newer versions of REBOL include "cloaking" functions for encrypting and decrypting strings. These functions do not provide full strength encryption such as Blowfish, AES, or RSA as found in REBOL/Command, nevertheless they can be useful for hiding passwords and other values. (That's why we call it cloaking rather than encrypting.) To cloak a string, provide the string and a cloaking key to the ENCLOAK function:
The result is an encrypted string which can be decloaked with the line:
Now you have a simple way save out a hidden string, such as a password:
Note that the cloaked string is converted to a binary value because it may contain special characters that would cause problems when used as text. To read the data and decloak it:
Of course you can cloak any kind of data using these functions, even binary data such as programs, images, sounds, etc. In those cases you do not need the TO-BINARY and TO-STRING conversions shown above.
|