Question
AES Encryption - Encrypted value lengths
HI all -
I am attempting to use CF 8's AES encryption feature, and have not found a critical piece of info in the docs to enable me to progress.
I am using the function to encrypt a password that can be from 6 to 16 characters long, which will be stored in a database. I am using generateSecretKey("AES"), and that gives me a 24 character key that I'm storing for future decryption use. I find that when I use the key to encrypt a 6 character password the resulting encrypted string is 32 characters long, but when I encrypt a 16 character password I get a 64 character encrypted string. This is the case whether I specify "HEX" or "UU" as the encoding.
Without knowing how the length of the resulting encoded string is determined, I cannot know how large to make my database column. (MySQL's AES encryption gives the formula 16 × (trunc(string_length / 16) + 1) to arrive at the resulting string's length, but that formula doesn't yield the results I'm seeing in CFMX). Can anyone point me to a doc, or explain to me how to determine the column length for storing the resulting encrypted value?
I am attempting to use CF 8's AES encryption feature, and have not found a critical piece of info in the docs to enable me to progress.
I am using the function to encrypt a password that can be from 6 to 16 characters long, which will be stored in a database. I am using generateSecretKey("AES"), and that gives me a 24 character key that I'm storing for future decryption use. I find that when I use the key to encrypt a 6 character password the resulting encrypted string is 32 characters long, but when I encrypt a 16 character password I get a 64 character encrypted string. This is the case whether I specify "HEX" or "UU" as the encoding.
Without knowing how the length of the resulting encoded string is determined, I cannot know how large to make my database column. (MySQL's AES encryption gives the formula 16 × (trunc(string_length / 16) + 1) to arrive at the resulting string's length, but that formula doesn't yield the results I'm seeing in CFMX). Can anyone point me to a doc, or explain to me how to determine the column length for storing the resulting encrypted value?
