Decrypts a string that was previously encrypted with the ENCRYPT function.
DECRYPT(string, key, method)
string An expression that evaluates to the string to be decrypted. string can be a plain or an encrypted text string.
key An expression that evaluates to a string containing the decryption key. When using method 1 (see method), this can be a null string (""). The key used for decryption must be the same as that used for encryption.
method An expression that evaluates to an integer specifying one of the following encryption methods:
0 A general purpose network encryption/decryption scheme. It can be used for encoding or decoding sensitive data which is to be transferred outside of the machine. It uses only the last character of key.
1 A simple rotation algorithm that affects only the alphabetic characters A-Z and a-z. These letters are rotated right 13 places. This is an algorithm sometimes called ROT13. It is easily breakable, but it is good for scrambling textual material for online data. Method 1 does not use key, but it must be present even as a null string ("").
2 XOR.MOD11 algorithm that uses only the last character of key. This algorithm uses the key as a seed, which has its five low-order bits XOR'd with each character in string. After each XOR, the seed is incremented by one.
3 A one-to-one exclusive OR between the string in string and an infinite garbage string generated through a Fibonacci algorithm. This method uses the entire key (key).
4 Decrypts using a key from the REK file. key must be the item-id of a key item.
5 Uses either Data Encryption Standard (DES) encryption with the Cipher Block Chaining (CBC) algorithm or Triple DES. key must be a dynamic array where the first attribute is 1 for DES:CBC or 2 for Triple DES, and the second attribute is the encryption key (8-character for DES:CBC, or a 16-character for Triple DES).
The method used for decryption must be the same as that used for encryption.
The decrypted string.
If method 4 is specified, and the user does not have permission to use the specified key item or if the specified key item does not exist, string is returned unchanged.
If a string has been encrypted more than once, you must decrypt the string in the reverse order to that used for encryption.
EN1 = ENCRYPT("EXAMPLE", "BC", 0) EN2 = ENCRYPT(EN1, "", 1) . . DE1 = DECRYPT(EN2, "", 1) DE2 = DECRYPT(DE1, "BC", 0)
Sets DE2 to the string "EXAMPLE".
ENCRYPT function.