https://github.com/godaddy/asherah-ruby
Application-layer encryption SDK
https://github.com/godaddy/asherah-ruby
Last synced: 11 months ago
JSON representation
Application-layer encryption SDK
- Host: GitHub
- URL: https://github.com/godaddy/asherah-ruby
- Owner: godaddy
- License: mit
- Created: 2022-02-25T23:35:55.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-19T17:06:07.000Z (about 1 year ago)
- Last Synced: 2025-07-18T09:59:23.708Z (11 months ago)
- Language: Ruby
- Homepage:
- Size: 139 KB
- Stars: 6
- Watchers: 14
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Asherah
Asherah is a Ruby FFI wrapper around Go version of [Asherah](https://github.com/godaddy/asherah) application-layer encryption SDK. Asherah provides advanced encryption features and defense in depth against compromise. It uses a technique known as "envelope encryption" and supports cloud-agnostic data storage and key management.
Check out the following documentation to get more familiar with the concepts and configuration options:
- [Design and Architecture](https://github.com/godaddy/asherah/blob/master/docs/DesignAndArchitecture.md)
- [Key Caching](https://github.com/godaddy/asherah/blob/master/docs/KeyCaching.md)
- [Key Management Service](https://github.com/godaddy/asherah/blob/master/docs/KeyManagementService.md)
- [Metastore](https://github.com/godaddy/asherah/blob/master/docs/Metastore.md)
- [System Requirements](https://github.com/godaddy/asherah/blob/master/docs/SystemRequirements.md)
## Supported Platforms
Currently supported platforms are Linux and Darwin operating systems for x64 and arm64 CPU architectures.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'asherah'
```
```bash
bundle install
```
Or install it yourself as:
```bash
gem install asherah
```
## Usage
Configure Asherah:
```ruby
Asherah.configure do |config|
config.kms = 'static'
config.metastore = 'memory'
config.service_name = 'service'
config.product_id = 'product'
end
```
See [config.rb](lib/asherah/config.rb) for all evailable configuration options.
Encrypt some data for a `partition_id`
```ruby
partition_id = 'user_1'
data = 'PII data'
data_row_record_json = Asherah.encrypt(partition_id, data)
puts data_row_record_json
```
Decrypt `data_row_record_json`
```ruby
decrypted_data = Asherah.decrypt(partition_id, data_row_record_json)
puts decrypted_data
```
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `rake install`.
To release a new version, update the version number in `version.rb`, create and push a version tag:
```
git tag -a v$(rake version) -m "Version $(rake version)"
git push origin v$(rake version)
```
And then create a release in Github with title `echo "Version $(rake version)"` that will trigger `.github/workflows/publish.yml` workflow and push the `.gem` file to [rubygems.org](https://rubygems.org):
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/godaddy/asherah-ruby.
## License
The gem is available as open source under the terms of the [MIT License](LICENSE.txt).