Storing Social Security Numbers in Rails…

For the forth coming store for Adamantine Arts, artists will be able to sell  print, originals, etc via our site. Since this is an affiliate program of sorts, we need to keep track of SSN/EIN and more for tax purposes (CC and other billing info is kept with PayPal – I’ll let them worry about their security). So with all the reports of laptops stolen containing spreadsheets of plain social security numbers, I figure I better prevent that issue right away. The encryption needs to be true encryption (not 1 way hashing). I scoured the net last night for implementations to use with Ruby/Rails. I mostly found half educated discussions about how encryption is hackable and other non-solution type responses. God Bless the ability of people to clog Google’s results with keyword injected garbage. Anyway, this morning I found the below article at the Stuff and Things blog. It is a clear and straight forward guide for using openSSL to do 2-way encryption to encode your data. The only thing left out for my situation was getting this to work with active records. However, I skipped the whole acts_as_secure overhead and just wrote some wrappers I tossed into my application_controller.rb file. Bam. Secure.

http://stuff-things.net/2007/06/11/encrypting-sensitive-data-with-ruby-on-rails/

  • uma mahesh varma

    Good Post,

    can you provide some clear explanation about the acts_as_secure plugin.

    Thank You,
    Uma.

  • blainegarrett

    I didn’t actually use acts_as_secure plugin after looking at it. I forget why exactly, but the docs for acts_as_secure are at: http://revolutiononrails.blogspot.com/2007/04/plugin-release-actsassecure.html
    If you don’t feel comfortable rolling your own solution, this plugin probably works great. It just seemed like a lot of overhead for what I was doing, but it will probably work great for whatever your needs are.

blog comments powered by Disqus
line
footer
Copyright © 1997 - 2010 Blaine Garrett All Rights Reserved