· · 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!

Do you need help with your application?

At Bit Zesty, we specialise in building and maintinaing bespoke software and intergrating AI into existing applications.

Looking to build an application, but unsure of the price? Keen to discuss our experience, processes and availability?

Back to Blog

Related Posts

View all
Brighton Ruby 2024

Brighton Ruby 2024

Brighton Ruby 2024 was nothing short of amazing. It brought together passionate Ruby developers from around the world to share knowledge, network, and have fun.

Ruby on Rails: Top 5 Gems to Enhance your Application

Ruby on Rails: Top 5 Gems to Enhance your Application

Creating a Ruby on Rails app can be a challenging task, but it can be made easier by utilizing different gems. These gems consist of third-party code libraries that can significantly speed up the development process. While some of these gems are necessary for Rails,…