Planning for changes in size for encrypted data
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
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
ENCRYPTfunction - During conversion from a binary byte stream to a Base64-encoded string,
using the ABL
BASE64-ENCODEfunction
The formula for change in data size during symmetric encryption is:
|
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:
|
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
DECRYPTfunction
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.