DATA_DECRYPT

Decrypt ciphertext data

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
xcall DATA_DECRYPT(type, password, source, [destination], [len], [salt, iv][, pad])

Arguments

type

One of the following encryption types: (n)

DC_AES256 = AES 256-bit CBC mode

DC_AES192 = AES 192-bit CBC mode (deprecated)

DC_AES128 = AES 128-bit CBC mode (deprecated)

DC_3DES = Triple DES CBC three-key mode (deprecated)

password

The password to be used on the source data buffer. (a)

source

The ciphertext data to be decrypted.

destination

(optional) A variable to be loaded with plaintext data as a result of this operation.

len

(optional) A variable to be set to the length of the data written to destination (or to the required destination size if destination is not specified). (n)

salt

(optional) A salt value for the decryption algorithm. (a)

iv

(optional) An initialization vector (IV) value for the decryption algorithm. (a)

pad

(optional) When set to 0, turns off PKCS padding. (See Data encryption for more information about padding.) (n)

Discussion

The DATA_DECRYPT routine decrypts data passed in source and returns it in destination.

The source specification must be exactly the data that was encrypted. If the data was encrypted into a field larger than the actual encrypted ciphertext data, the source specification must be ranged.

If len is specified and destination is not, the exact size of the decrypted plaintext data will be returned.

If salt and iv are not specified, the values supplied to the decryption routine are nulls. The size of salt and iv are the size as returned from the DATA_SALTIV routine, or else an $ERR_ARGSIZ error occurs.

The size of the salt and iv arguments are as follows:

Encryption type

Salt size

Initialization vector size

DC_3DES

8

8

DC_AESnnn

8

16

Important

All encryption types except DC_AES256 are considered deprecated and insecure according to industry security standards and therefore should not be used.

When using the dbl8 compiler, you must .INCLUDE the file DBLDIR:datacrypt.def before using DATA_DECRYPT.

See also