> You need to use a feedback mode other than ECB (the default when you omit
> it from the algorithm) to use an IV, try using "AES/CBC/PKCS5Padding" for
> your algorithm. This KB article has a lot of info about this stuff:
> http://helpx.adobe.com/coldfusion/kb/strong-encryption-coldfusion-mx-7.html

As usual I get a phone call and Pete beats me to the punch. :)   An IV
is only used when AES is using a block cipher.  CBC is Cipher Block
Chaining Mode, so it would use an IV (algorithm =
"AES/CBC/PKCS5Padding"); ECB is the default mode and doesn't use an IV
(algorithm = "AES").

Also, the IV you pass in must be the same length as the block mode of
the algorithm (e.g. the same as the key length), so in the original
sample code, encrypting the "anotherkey" value and using that as the
IV probably won't work.  You can generate another key and use a hash
of its value to the appropriate length to get a similar result (e.g.
<cfset useasiv = left(hash(anotherkey), 16)>).


-Justin Scott

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351109
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to