Open Sourced: Ruby CFMX Compat algorithm

By: Jason Lambert

Tags:

  • open-source
  • ruby
  • coldfusion

I was recently tasked with migrating important historical data to a new database schema as part of some exciting changes that we’re making to our dating platform.

Using Ruby to write the data migration script, I came across an interesting issue: some of the historical data had been obfuscated using an old ColdFusion encrypt() algorithm, lovingly referred to as CFMX_COMPAT in the ColdFusion encrypt() documentation.

A quick scour of the Internet and there was no Ruby implementation of this algorithm to be found. I got straight to work looking for an open source implementation in another language that I could port across to Ruby. Luckily I found a Java implementation inside Railo (the Open Source CFML engine from the Railo company), so the algorithm porting began.

A few hours of hacking later, a working CFMX_COMPAT algorithm in Ruby was born that could be used to decrypt the data. It worked perfectly.

I’m very happy to say that the company has kindly allowed me to open-source my Ruby implementation of the CFMX_COMPAT algorithm, as of today you can find it on its GitHub page or install it via Rubygems.

Also, we are hiring Ruby Developers. If you would like to work somewhere with interesting technical challenges then take a look at our jobs page…


About the Author

Jason Lambert