Empty string ("") if an error occurred. To find out the error details, use ErrorInfo.

<Encrypted message>: Binary buffer

Message to decrypt. This message can be the encryption result obtained during the call to EncryptStandard.

This buffer must include two sections:

The initialization vector (or IV) used to encrypt data.

The encrypted data.

If the message was encrypted:

by EncryptStandard, this parameter must correspond to the value returned by the function.

by an external tool, the buffer must be built by concatenating the encrypted data to initialization vector used.

Note: if the specified operation mode is cryptECB, no initialization vector was used to encrypt the message and in this case, the parameter must directly correspond to the encrypted data.

<Key>: Buffer

Key with which the data was encrypted. This key must be identical to the one supplied when encrypting the message.

<Algorithm>: Optional Integer constant

Encryption algorithm used. This parameter must correspond to the algorithm used to encrypt the message.

cryptAES128(Default value)

Advanced Encryption Standard.

Size of key: 128 bits.

Size of blocks: 128 bits.

Size of initialization vector (IV): 128 bits.

Versions 23 and latercryptAES256

New in version 23cryptAES256

cryptAES256

Advanced Encryption Standard.

Size of key: 256 bits.

Size of blocks: 128 bits.

Size of initialization vector (IV): 128 bits.

This constant is not available.

cryptDES

Data Encryption Standard.

Size of key: 64 bits.

Size of blocks: 64 bits.

Size of initialization vector (IV): 64 bits.

crypt3DES

Triple Data Encryption Standard.

Size of key: 192 bits.

Size of blocks: 64 bits.

Size of initialization vector (IV): 64 bits.

<Operation mode>: Optional Integer constant

Process mode of blocks by the encryption algorithm used. This parameter must correspond to the operation mode used to encrypt the message.

cryptCBC(Default value)

Cipher Block Chaining - Sequence of blocks.

Versions 23 and latercryptCFB

New in version 23cryptCFB

cryptCFB

Cipher Feedback - Feedback encryption. This process mode is available if the algorithm used corresponds to the cryptAES256 constant.

This constant is not available.

Versions 23 and latercryptCTR

New in version 23cryptCTR

cryptCTR

Cipher Counter - Encryption based on a counter. This process mode is available if the algorithm used corresponds to the cryptAES256 constant.

This constant is not available.

cryptECB

Electronic Code Book - Dictionary of codes. This operation mode is not recommended and it should only be used for compatibility reasons.

<Fill>: Optional Integer constant

Mode for filling the encrypted data in order to be compatible with the size required by the encryption algorithms by blocks. This parameter must correspond to the fill mode used to encrypt the message.

cryptPaddingPKCS(Default value)

The data is filled with bytes whose value corresponds to the total number of bytes added to reach the requested size.

cryptPaddingZero

The data is filled with binary zeros until the requested size is reached.

Related Examples:

Unit examples (WINDEV): The encryption functions

[ + ] Using the encryption/decryption functions of WINDEV.This example is used to:- Encrypt a character string- Decrypt a character string