Consultor Eletrônico



Kbase P170704: Cannot use large keys with ENCRYPT / DECRYPT functions
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/13/2010
Status: Unverified

SYMPTOM(s):

Cannot use large keys with ENCRYPT / DECRYPT functions

Key size does not match the required key length for specified encryption algorithm

AES encryption key with 128 bit encryption cannot be longer than 15 characters

Inappropriate key length, function (12707)

FACT(s) (Environment):

All Supported Operating Systems
OpenEdge 10.x

CAUSE:

Each encryption algorithm (e.g. AES_OFB_128, DES_CBC_56, AES_CBC_256, etc.) that OpenEdge supports lists the essential key length in its name. This indicates the number of bits that the supplied key is REQUIRED to have in order for the encryption to succeed.

To determine the number of characters that the algorithm requires you simply take the bitsize off the end of the algorithm and divide by 8, then subtract 1 (null terminator).

FIX:

If you wish to use a variable key length use the GENERATE-PBE-KEY function, which generates a password based key from any given string and generates a key that fits the requirements of the algorithm specified in the SYMMETRIC-ENCRYPTION-ALGORITHM attribute of the SECURITY-POLICY system handle.