{"id":16687958,"url":"https://github.com/danielpclark/acts_as_encryptable","last_synced_at":"2025-03-21T18:33:26.671Z","repository":{"id":56842236,"uuid":"57321111","full_name":"danielpclark/acts_as_encryptable","owner":"danielpclark","description":"Simple record encryption implemented with Rails existing encryption methods.","archived":false,"fork":false,"pushed_at":"2017-06-03T03:27:11.000Z","size":8,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-18T03:51:32.792Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielpclark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-28T17:24:41.000Z","updated_at":"2017-07-04T17:44:33.000Z","dependencies_parsed_at":"2022-09-01T09:02:45.984Z","dependency_job_id":null,"html_url":"https://github.com/danielpclark/acts_as_encryptable","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpclark%2Facts_as_encryptable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpclark%2Facts_as_encryptable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpclark%2Facts_as_encryptable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpclark%2Facts_as_encryptable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielpclark","download_url":"https://codeload.github.com/danielpclark/acts_as_encryptable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244849584,"owners_count":20520741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T15:26:06.623Z","updated_at":"2025-03-21T18:33:26.279Z","avatar_url":"https://github.com/danielpclark.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ActsAsEncryptable\n[![Gem Version](https://badge.fury.io/rb/acts_as_encryptable.svg)](https://badge.fury.io/rb/acts_as_encryptable)\n[![Build Status](https://travis-ci.org/danielpclark/acts_as_encryptable.svg?branch=master)](https://travis-ci.org/danielpclark/acts_as_encryptable)\n\nThis gem adds support with ActiveSupport's existing message encryption\nand allows you to set any ActiveRecord model column as an encrypted field.\n\nIt's bloat free and easy to use. This way you're up to date on security as\nlong as Rails is. And there's no high maintenance or feature bloat like\nother \"encryption helper gems\" have 😉 .  It's fully tested too!\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'acts_as_encryptable'\n```\n\nAnd create an initializer file:\n\n```ruby\n# config/initializers/acts_as_encryptable.rb\nActiveRecord::Base.extend ActsAsEncryptable\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install acts_as_encryptable\n\n## Usage\n\nAdding encryption to any column is as easy as writing a few lines.\n\n```ruby\nclass Email \u003c ActiveRecord::Base\n  acts_as_encryptable :raw_body, :the_key, :the_salt\n\n  private\n  def the_key\n    \"example key\" # Some consistent/secure way to derive the key\n  end\n\n  def the_salt\n    \"example salt\" # Some consistent/secure way to derive the salt\n  end\nend\n```\n\nIf you're encrypting multiple fields you may choose to vary what keys and salts\nare used per column, but this will add a performance hit for the extra\nencryption startup time.\n\nIf you want to perform additional work on record data that you want to encrypt;\nwrite a method alias after the `acts_as_encryptable` decleration and have your\nnew method call it.  `acts_as_encryptable` should always be written before any\nmethod aliasing.\n\n```ruby\n# Example\nalias_method :renamed_method, :current_example\n\ndef current_example\n  renamed_method.do_something\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/danielpclark/acts_as_encryptable.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielpclark%2Facts_as_encryptable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielpclark%2Facts_as_encryptable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielpclark%2Facts_as_encryptable/lists"}