What are we doing wrong?
You will not be careful with encodings.
You must consider encodings.
In ColdFusion, you should only use a byte array as a key or IV, and you should only encrypt byte arrays.
Do not process keys, IV, or text files in any form other than a byte array. Do not treat them as base64 encoded strings, UTF-16 strings (which Java does by default), or any other form. You should always deal only with byte arrays, and you should always know the encoding and use the same encoding between ColdFusion and Ruby.
You can get a byte array from a string using encoding. I would like to use UTF-8 encoding. Look at the functions of CharsetEncode and CharsetDecode .
You also use keys and IV errors. Keys can be generated from passwords using an algorithm such as PBKDF2, but only if you do not have a good way to generate using crypto-variant PRNG and store them. IVs must be generated with crypto-variant PRNGs and can be added to encrypted text when you store or transmit it as a convenient way to store / transmit IVs.
source share