I was tracking a problem down I have had lately. I have an AES encrypt function I sometimes use. I started to get a “Wrong IV length” error (I think after 6.2.2 re-install). Finally spent some time to look into it. I wrote some test code on trycf that worked fine but gives the Wrong IV length on my server. I found generateSecretKey(“AES”) was giving me a 256 bit key on my server but not trycf. Adding the keysize argument fixed my problem. I noticed trycf is using the same Lucee version but JAVA 17. I use the new JAVA 21 after the re-install. Could JAVA be the difference?
Test Code:
<cfscript>
saltiv = generateSecretKey("AES");
writeDump(saltiv);
penc = encrypt("TestMe", "SUq9aM+ROxcNyt6eXsDUiQ==", 'AES/CBC/PKCS5Padding', 'Base64', binaryDecode(saltiv, "base64"));
writeDump(penc);
</cfscript>