Try OpenEdge Now
skip to main content
Programming Interfaces
Data Management : Application Security : Using cryptography to secure data : Managing and transporting crypto data : Planning for changes in size for encrypted data
 
Planning for changes in size for encrypted data
Because AES, DES, and their variants are block ciphers, the data output from encryption functions using these ciphers typically differs in size from the data that is input.
Note: RC4 is a stream cipher in which the data input to an encryption function is always the same size as the data that is output. Therefore, this section does not apply if you are using RC4 as your encryption cipher.
Data size increases at two points:
*During symmetric encryption, using the ABL ENCRYPT function
*During conversion from a binary byte stream to a Base64-encoded string, using the ABL BASE64-ENCODE function
The formula for change in data size during symmetric encryption is:
ems = (((ums / 8) + 1) * 8)
In this formula:
*ems is the encrypted maximum size
*ums is the unencrypted maximum size
The formula for change in data size when Base64-encoding a binary byte stream is:
ems = (((bms / 8) + 1) * 8)
In this formula:
*ems is the Base64-encoded maximum size
*bms is the binary maximum size, which is equal to the encrypted maximum size of the data that has been encrypted using the DECRYPT function
This increase in size from binary to Base64-encoding is generally 33%. So, encrypted data in a RAW or MEMPTR variable becomes 33% larger after you convert to a Base64-encoded CHARACTER or LONGCHAR variable.