Skip to content

Instantly share code, notes, and snippets.

@virtix
Created June 22, 2009 10:32
Show Gist options
  • Save virtix/133911 to your computer and use it in GitHub Desktop.
Save virtix/133911 to your computer and use it in GitHub Desktop.
<cffunction name="hashMyPassword">
<cfset var password = "p@ssW0rd" />
<cfset var crypto = createObject('component', 'Crypto') />
<cfset var salt = crypto.genSalt() />
<cfset var passwordHash = crypto.computeHash(password,salt) />
<!---
Store both the salt and the passwordHash in the database.
--->
</cffunction>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment