Decrypt Function

Action

Decrypts a string that has been encrypted using the Encrypt function.

Note: The Decrypt3DES function uses a higher security algorithm than this function and should be used in newly generated scripts to be FIPS compliant.

Include file

kernel.bdh

Syntax

Decrypt( in sEncyptedData : string,
         in sKey          : string optional ): string;

Return value

  • decrypted string

Parameter Description
sEncyptedData Data to be decrypted
sKey String or binary data used as encryption key (optional).

Example

dcltrans
  transaction TMain
  var
    sUserPass  : string;
    sEncrypted : string;
  begin    // Build your own authentication header
    AttributeGetString("Password", sUserPass);
    sEncrypted := Encrypt(sUserPass);
    Print(sEncrypted);
    sUserPass := Decrypt(sEncrypted);
    Print("decrypted password: " + sUserPass);
  end TMain;