# ankane/lockbox

Modern encryption for Ruby and Rails

Repository: https://github.com/ankane/lockbox
Canonical: https://ross.abutalabs.com/products/lockbox
Language: Ruby
License: MIT
License Family: permissive
Topics: encryption, activerecord, activestorage, carrierwave, mongoid, libsodium
Last push: 2026-04-09T07:04:01+00:00

## Health v2 (maintenance only)
Score: 66/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 76, release rhythm 35, longevity 100
- inputs: {"age_days": 2800, "days_push": 146, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1609, forks 78 (observed 2026-08-28T04:05:10.836815+00:00)

## What it is
Lockbox is a Ruby gem providing modern encryption for database fields, files, and strings in Ruby and Rails applications. It integrates with Active Record, Mongoid, Active Storage, CarrierWave, and Shrine, with support for easy data migration and key rotation.

## Use cases
- encrypt sensitive database columns in Rails
- secure user emails with Devise
- encrypt uploaded files in Active Storage
- rotate encryption keys for existing data
- encrypt strings and files in Ruby apps
- add encrypted attributes to ActiveRecord models

## When to choose
- you need transparent field-level encryption in Rails or Ruby
- you want easy key rotation and data migration support
- you need encryption for both database fields and file attachments
- you prefer a zero-dependency library with broad ORM integrations

## When to avoid
- you need application-level encryption outside the Ruby ecosystem
- you require searchable encrypted queries without a companion blind index
- your project does not use Ruby or Rails

## Facets
- artifact type: library
- maturity: stable
- function: cryptography, security, orm, serialization
- domain: security, web-development, backend, privacy, databases
- platform: ruby, jvm
- tags: encryption, rails, activerecord, activestorage, libsodium, key-rotation, field-level-encryption, file-encryption

## Member repositories
- ankane/lockbox (main) score 66

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:10.836815+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:51:16.096224+00:00, confidence not recorded.
  - readme: https://github.com/ankane/lockbox (fetched 2026-08-28T04:05:10.836815+00:00, sha b75348a4d1c0)
- Data as of 2026-08-30T08:39:29.467469+00:00.
