Click or drag to resize

CryptA Function

X#
Encrypt or decrypt a string, changing the contents of the original string as well as returning the encrypted string.

Namespace:  XSharp.VO
Assembly:  XSharp.VO (in XSharp.VO.dll) Version: 2.19
Syntax
 FUNCTION CryptA(
	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 is identical to Crypt() except that it also changes the original string cSource. 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 AS STRING
 2LOCAL cKey as STRING
 3a := "The quick brown fox jumps over the lazy dog."
 4cKey := "CAT"
 5? a
 6// The quick brown fox jumps over the lazy dog.
 7? CryptA(a, cKey)
 8// ú¿C_6g[‡N%ì*„k ÙYñƒ---à-øÃFé†ÈbÓÈã_ø´Ù¢ù½Ÿ
 9? a
10// ú¿C_6g[‡N%ì*„k ÙYñƒ---à- øÃFé†ÈbÓÈã_ø´Ù¢ù½Ÿ
11CryptA(a, cKey)
12? a
13// The quick brown fox jumps over the lazy dog.
See Also