Encryption for the masses

In my last post I talked about using the cfusion_encrypt() and cfusion_decrypt() functions for creating URL & DB safe encrypted strings.

As I mentioned before this isn’t for everyone because the functions are undocumented and not available to all users, ie those of you on shared hosting plans.

Well I was browsing the web and came across this thread on the House of Fusion mailing list which offers an alternative way to encrypt/decrypt strings for DB insertion

The code look like so:

This produces a db safe string
toBase64(encrypt("#string2beEncrypted#","#key#"))>

This decrypts the string
decrypt(tostring(tobinary("#secret_word_encrypted#")),"#key#")>

Pretty straight forward and this should work on your shared hosting environment too! Just be sure to check with your IHP to ensure you have access to these functions.

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

No Reader comments

Comments on this post are closed.