· · Matthew Ford  · 1 min read

Encrypting Data in Your Ruby on Rails Application

Encrypting Data in Your Ruby on Rails Application

Whilst searching for a gem/plug-in to help with storing encrypted notes in a Rails app, I came across strongbox. It uses public key encryption to encrypt and store data on an ActiveRecord attribute – Spike has a great writeup on his blog. One limitation I encountered was that it only uses one key to encrypt the data, which wasn’t going to work when I have multiple users, all storing private information.

So I wrote a wrapper around strongbox that I am releasing called Safe – a Rails engine for storing encrypted data. Safe handles the generating of the public and private keys and uses strongbox to encrypt and decrypt the data. It’s still in early stages, and it doesn’t support all of the options that strongbox does, but it is on the TO DO list.

So let me know if you find it useful and don’t forget to symlink the keys directory in your deployment scripts!

Discuss your software, technical leadership or AI plans

Tell us what you need to build, improve or decide.

We can help with software development and ongoing support, fractional CTO leadership, and practical AI adoption. Speak to our senior team about your priorities, our approach and availability.

Book a free intro call

Choose 15 or 30 minutes. Booking requests require confirmation by email.

Back to Blog

Related Posts