Welcome to the new blog
I’ve finally had time to move my personal blog off of Wordpress.com. Now it is just static HTML generated by Jekyll. The new address is http://www.heathanderson.net; http://www.blogofheath.com will redirect there.
Ruby on Rails Plugin: string_encryption
This is a very simple Ruby on Rails plugin that allows easy encryption of strings. For the sake of simplicity there no customization. The only cipher used is ‘des-ede3-cbc’ (Triple DES using Cipher Block Chaining) . See my post on encrypting/decrypting a string with Ruby for more information. First install the plugin:
script/plugin install git://github.com/handerson/string_encryption.git
Initialization Vector Length in MRI Ruby versus JRuby
When using OpenSSL encryption in standard Ruby, the length of an initialization vector (IV) can apparently be as large as you want it to be as long as it is at least the minimum size. This is odd. This can also cause trouble when switching over to JRuby. JRuby appear to be much pickier about IV length.
Ruby String Encryption
Encrypting a string is fairly easy in Ruby. All you need to do is require 'openssl'. For this example I am using the ‘des-ede3-cbc’ (Triple DES using Cipher Block Chaining) cipher. Most—if not all—of the ciphers listed on OpenSSL.org as supported ciphers should work as well.
Ruby on Rails Plugin: data_migration
data_migration allows you to separate data you need to load from your normal database migrations in a minimal way. While developing the new version of our flagship site, Knetwit, we decided we needed to separate our data migrations (initial settings and the like) from our structural migrations. We decided the easiest way to do this was to modify the existing Rails migration to allow for a new data migration. So we did.
