A modern encryption library for Ruby and Rails that works with database fields, files, and strings.
Lockbox is a modern encryption library for Ruby and Rails that provides application-level encryption for database fields, files, and strings. It solves the problem of securing sensitive data in Ruby applications by offering seamless integration with popular ORMs and file upload libraries, ensuring data is encrypted at rest without disrupting existing workflows.
Ruby and Rails developers who need to encrypt sensitive data like emails, files, or user information in their applications, particularly those using Active Record, Active Storage, or other supported libraries.
Developers choose Lockbox for its zero-dependency design, ease of migration from existing data, and comprehensive support for key rotation and multiple encryption algorithms. Its focus on compatibility with existing code and libraries reduces the friction of adding encryption to Rails applications.
Modern encryption for Ruby and Rails
Lockbox has no external dependencies by default, keeping it lightweight and easy to integrate, though optional Libsodium support is available for advanced features like XSalsa20.
It provides built-in tools for encrypting existing data without downtime and rotating keys, with clear examples for Active Record and file uploaders in the README.
Lockbox seamlessly works with Active Record, Active Storage, CarrierWave, Shrine, and others, supporting serialized fields and types for maximum compatibility.
Defaults to AES-GCM with 256-bit keys, and offers advanced options like XSalsa20 and hybrid cryptography, with detailed setup instructions for each.
When encrypting Active Storage files, variants and previews aren't supported, and metadata extraction is disabled, impacting user experience for media-heavy apps.
Using XSalsa20 or hybrid cryptography requires installing Libsodium separately, adding platform-specific setup complexity and potential maintenance overhead.
Encrypted fields cannot be queried directly; developers must integrate the separate Blind Index gem for search functionality, adding another dependency.
Encryption and decryption add computational cost, which might be significant for applications handling high volumes of data or frequent file operations.
Flexible authentication solution for Rails with Warden.
Open-source headless eCommerce platform with REST API, TypeScript SDK, and Next.js storefront for cross-border, B2B or marketplace eCommerce.
The administration framework for Ruby on Rails applications.
Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.