Created
July 5, 2011 10:24
-
-
Save neokoenig/1064616 to your computer and use it in GitHub Desktop.
Password Hashing and Salting 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!---Get the key---> | |
<cfset authKeyLocation=expandpath('../auth/key.txt')> | |
<cffile action="read" file="#authKeyLocation#" variable="authkey"> | |
<!--- New password hashing ---> | |
<!--- Generate a salt, this is never stored in it's plain form---> | |
<cfset theSalt=createUUID() /> | |
<!--- Hash the password with the salt in it's plain form---> | |
<cfset passwordHash=Hash(thePassword & theSalt, 'SHA-512') /> | |
<!--- The encrypted salt to store in the database, using the authKey---> | |
<cfset salt=encrypt(theSalt, authKey, 'CFMX_COMPAT')> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment