desDecrypt()

The function decodes the content of a blob variable using the DES algorithm.

Synopsis

int desDecrypt(blob src, string key, string|blob &dest);

Parameters

Parameter Description
src The source variable as a Blob.
key The key for the decoding.
dest The target variable. Contains the decoded variable.

Return Value

In case of errors, the function returns -1 and otherwise the length of the decoded data.

Description

The function decodes the content of a blob variable using the DES algorithm and can be used together with the function "desEncrypt()" for the encoding and decoding of string or blob variables.

Example

In the following example a string variable is encoded and decoded.

#uses "CtrlCrypt"
main()
{
  string sFile = "ThisIsAWord";
  string KKEy = "MyKey";
  blob desFi;
  blob desFi1;
  int rVal = desEncrypt(sFile, KKEy, desFi);
  DebugN("The function desEncrypt was executed successfully and
  the variable was encoded:", rVal, "DestParameter:", desFi);
  int rVal1 = desDecrypt(desFi, KKEy, desFi1);
  DebugN("The function desDecrypt was executed successfully and
  the variable was decoded:", rVal1, "Content", desFi1);
}

Assignment

Miscellaneous functions

Availability

UI, CTRL