Click or drag to resize

Crypt Function (String, String)

X#
Encrypt or decrypt a string.

Namespace:  XSharp.VO
Assembly:  XSharp.VO (in XSharp.VO.dll) Version: 2.21
Syntax
 FUNCTION Crypt(
	cSource AS STRING,
	cKey AS STRING
) AS STRING
Request Example View Source

Parameters

cSource
Type: String
The string that will be encrypted or decrypted.
cKey
Type: String
The encryption/decryption key to be used.

Return Value

Type: String
The encrypted/decrypted string.
Remarks
This function can be used to encrypt or decrypt any string. Note that the encryption key is very important for decrypting the string later on. Without the proper key (i.e., the same key used to encrypt the string), the data will be unusable.
Examples
This sample will encrypt a string and then decrypt the string:
X#
1LOCAL a, b, c AS STRING
2LOCAL cKey as STRING
3a := "The quick brown fox jumps over the lazy dog."
4cKey := "CAT"
5b := Crypt(a, cKey)
6c := Crypt(b, cKey)
7? a        // The quick brown fox jumps over the lazy dog.
8? b        // ú¿C_6g[‡N%ì*„k ÙYñƒ---à-øÃFé†ÈbÓÈã_ø´Ù¢ù½Ÿ
9? c        // The quick brown fox jumps over the lazy dog.
See Also