I know how to encrypt data using ColdFusion using AES_128. I also know how to encrypt data using MSSQL AES_128. Does anyone know if it’s possible to encrypt data in ColdFusion using AES_128, then decrypt the string in MSSQL?
I’ve played around with it a lot and can’t seem to figure it out.
Thanks, Paul
Yes this is possible. There is nothing about AES that makes it proprietary. However, there are many ways of implementing a block cipher, and most of them are incorrect. MS SQL's encryptbykey() uses ECB mode and defaults to ANSI_PADDING. I would try decrypting a message using the same key with an AES in ECB mode and it will likely just work. CBC mode should be used, but this requires a IV, and encryptbykey()
doesn't accept an IV as a parameter so its ECB mode. (MySQL also ecb mode, i've looked at the code. Its a shame I can't do that with MS SQL).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With