Description
Lockbox is a Ruby gem that provides modern encryption for Ruby and Rails. It can encrypt database fields, files and plain strings. The README says it works with existing code and libraries, makes migrating existing data and rotating keys easy, has zero dependencies, and has many integrations. For database fields it covers Active Record, Action Text and Mongoid, and for files it covers Active Storage, CarrierWave, Shrine and local files. You add the gem to your Gemfile and generate a key. The README advises storing the key with your other secrets, typically Rails credentials or an environment variable, and using different keys in development and production. You can encrypt an existing column without downtime by adding a ciphertext column, and you can use a separate key for each record. For key management, the README shows how to combine Lockbox with KMS Encrypted, and warns that KMS Encrypted's key rotation does not rotate encrypted files. The README also links articles on the principles behind the gem and on securing sensitive data in Rails.…
Highlights
- Encrypts database fields, files and strings
- Zero dependencies
- Active Record, Active Storage and Action Text support
- Key rotation and migration of existing data
Ratings & Reviews
No ratings yet
Be the first to rate Lockbox.
People also visit
Lockbox FAQ
What is Lockbox?
A Ruby gem that encrypts database fields, files and strings for Ruby and Rails apps.
Does it have dependencies?
The README says it has zero dependencies.
Where should the key go?
The README says to keep it with your other secrets, such as Rails credentials or an environment variable, and to use different keys for development and production.
Can I encrypt existing data?
Yes. The README describes adding a ciphertext column and migrating an existing column without downtime.
What are the best Lockbox alternatives?
Popular alternatives to Lockbox include Stack, Prisma Field Encryption and LUKSbox. See all Lockbox alternatives
