Skip to content

Instantly share code, notes, and snippets.

@SimonLlewellyn
Created May 2, 2017 00:27
Show Gist options
  • Save SimonLlewellyn/da393a97ac41f3d589846ea369b4dcdb to your computer and use it in GitHub Desktop.
Save SimonLlewellyn/da393a97ac41f3d589846ea369b4dcdb to your computer and use it in GitHub Desktop.
Coldfusion Encrypt/Decrypt
<cfset application.pkey = "whateveryouwant">
<cffunction name="epwd" output="no" access="remote">
<cfargument name="pwd" required="yes">
<cfset done = Encrypt(arguments.pwd,application.pkey,'AES/CBC/PKCS5Padding','HEX')>
<cfreturn done />
</cffunction>
<cffunction name="dpwd" output="no">
<cfargument name="pwd" required="yes">
<cfset done = Decrypt(arguments.pwd,application.pkey,'AES/CBC/PKCS5Padding','HEX')>
<cfreturn done />
</cffunction>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment