Encrypt not working in CF 10?

26 views
Skip to first unread message

Steel Valor

unread,
Apr 7, 2016, 12:03:12 PM4/7/16
to Central New York ColdFusion Users Group
So I'm trying to get Encrypt working in CF10 instead of using MySQL.


<cfset encryptedtext = encrypt(form.myfield, 8675309, "AES/CBC/PKCS5Padding", "HEX") />
Message:An error occurred while trying to encrypt or decrypt your input string: '' Can not decode string "8675309"
Thoughts?

Pete Freitag

unread,
Apr 7, 2016, 12:06:18 PM4/7/16
to cfu...@googlegroups.com
For AES encryption you need to specify a key (second argument) that was generated using: generateSecretKey("AES") http://cfdocs.org/generatesecretkey

--
Pete Freitag
https://foundeo.com/ - ColdFusion Consulting & Products
http://hackmycf.com - CFML Server Security Scanner


--
You received this message because you are subscribed to the Google Groups "Central New York ColdFusion Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfugcny+u...@googlegroups.com.
To post to this group, send email to cfu...@googlegroups.com.
Visit this group at https://groups.google.com/group/cfugcny.
For more options, visit https://groups.google.com/d/optout.

Shawn

unread,
Apr 7, 2016, 12:06:23 PM4/7/16
to cfu...@googlegroups.com
Valor,

I have done it like this in the past before I insert the value into the database:

<cfset encryptionKey = generateSecretKey( "AES" ) />
 

<cfset secret = encrypt(
    theCC,
    encryptionKey,
    "AES/CBC/PKCS5Padding",
    "hex"
    ) />

On Thu, Apr 7, 2016 at 12:03 PM, Steel Valor <steel...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Central New York ColdFusion Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfugcny+u...@googlegroups.com.
To post to this group, send email to cfu...@googlegroups.com.
Visit this group at https://groups.google.com/group/cfugcny.
For more options, visit https://groups.google.com/d/optout.



--
Shawn M. Ortis
CEO
Ravenmoon Designs
www.ravenmoon-designs.com
sh...@ravenmoon-designs.com
315.368.5229

"Vedar-Gal Tiekals Somdus Azerate!"

Steel Valor

unread,
Apr 7, 2016, 12:19:26 PM4/7/16
to Central New York ColdFusion Users Group
So you can't use your own pre-existing key? Seriously Adobe?!? Jenny is gonna be pissed!

Thanks for the help guys. :)

Jim Thomson

unread,
Apr 7, 2016, 12:21:46 PM4/7/16
to Central New York ColdFusion Users Group
Hahaha Ed, that took me a minute to get that one! Well done.
 
Jim
 
 
 

From: "Steel Valor" <steel...@gmail.com>
Sent: Thursday, April 07, 2016 12:19 PM
To: "Central New York ColdFusion Users Group" <cfu...@googlegroups.com>
Subject: Re: [cfugcny] Encrypt not working in CF 10?
Reply all
Reply to author
Forward
0 new messages