Rich Symons
06/20/2024, 9:19 PMddspringle
06/20/2024, 9:27 PMddspringle
06/20/2024, 9:30 PMvariables.algorithm = ( ( randRange( 0, 1, 'SHA1PRNG' ) ) ? 'AES' : 'BLOWFISH' );ddspringle
06/20/2024, 9:35 PMddspringle
06/20/2024, 9:46 PMRich Symons
06/21/2024, 12:54 PMRich Symons
06/21/2024, 4:28 PMRich Symons
06/21/2024, 6:29 PMddspringle
06/21/2024, 7:44 PMwriteOutput( dataDec( charsetEncode( fileReadBinary( variables.keyRingPath ), 'utf-8' ), 'master' ) );
3. launch the application and get the value returned from this new line of code.
4. Copy and paste it into your existing (actively used, not backup) keyring file - you can open that .bin file in notepad or whatever and paste it in.
5. Launch it again and see if you get JSON instead of an encrypted value.
If you do, problem solved - replace your backup keyring with the one that now works and remove the line of code from SecurityService.cfc added per above and all should be right with the world again.
If not - check that it is not the same encrypted value as this one. If it is, then I'll have to scratch my head more.
If it isn't then copy that value in and so on and so forth until you either get a decryption error or reach JSON.
The decrypted JSON is what you're after.
-------
Beyond that I'll have to dig deeper. Perhaps we can get in a screen share on Monday (or perhaps over the weekend) and try and walk (crawl, trip, stumble, fall) through my code in your app and see if we can't narrow it down further.Rich Symons
06/22/2024, 5:20 PMddspringle
06/26/2024, 4:41 PMBLOWFISH/CTR/PKCS5Padding to BLOWFISH/CBC/PKCS5Padding solved the problem. I could have also added an IV to the master key encryption/decryption but this was easier.
Blowfish isn't exactly the most secure algorithm to use anymore anyway so I will most likely eliminate that algo in that repository, but that doesn't help you a whole lot, so I'll try and figure out the least painful way to address this issue for you.
It may just be a matter of decrypting the existing keyring with JDK11 and then re-encrypting the keyring using either CBC mode or adding an IV with the CTR mode in the master encryption/decryption modes in dataEnc() and dataDec() in SecurityService.cfc respectively.
To do this, I would write code that simply copies the existing encrypt and decrypt for the master key type from SecurityService.cfc, then code to re-encrypt using CBC mode or adding an IV, then switching SecurityService.cfc's algo for the one you used to re-encrypt. Then everything should work on JDK17.ddspringle
06/27/2024, 1:50 PMRich Symons
06/27/2024, 5:11 PMRich Symons
06/28/2024, 8:15 PMddspringle
06/28/2024, 8:48 PM