Gary-
I've used the hash function to convert the password into a hashed value and then store 
the hashed value in the database.  The setback is you cannot convert it back to the 
original value once its been hashed.  So, when you need to compare values, you will 
have to hash the user inputted password and compare it to the value stored in the 
database.  Hope that helps.

Tom

-----Original Message-----
From: Alford, Gary [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 03, 2002 4:00 PM
To: DFW ColdFusion Users Group (E-mail)
Subject: Encrypt / Decrypt


I am trying to populate a database field with encrypted passwords for an
internal security system and then decrypt them later for login.  The code I
am using to encrypt / decrypt is:

        <cfif IsDefined("form.pw")>
                <cfset encr_pw = #LCase(form.pw)#>
                <cfset encr_pw = encrypt(encr_pw, "gala55")>
                <cfset decr_pw = decrypt(encr_pw, "gala55")>
        </cfif>

However, if I output these variables, I am not getting a constant return on
the "encr_pw" variable.  Each time I refresh the page, I get a different
value for encr_pw (the last character of the string is always different).
Therefore, the correct password will not decrypt properly.

Any ideas?

============================================
Gary L. Alford
Materiel and Procurement
Senior BPE Specialist, SCM
Bell Helicopter Textron
Phone: (817) 280-6233
Fax: (817) 278-6233
mailto:[EMAIL PROTECTED]
============================================


-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to