0.0
No commit activity in last 3 years
No release in over 3 years
Check the github page for a detailed description
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 10.1.0
~> 2.14.1

Runtime

~> 3.0.0
 Project Readme

EasyEncryption

Easy Encryption provides a simple means for encrypting and decrypting strings. It utilizes the RbNaCl gem's simple box under the hood to do the actual encryption work (https://github.com/cryptosphere/rbnacl).

Important

libsodium is required for the EasyEncryption gem to function. To install libsodium please refer to https://github.com/jedisct1/libsodium.

Installation

Add this line to your application's Gemfile:

gem 'easy_encryption'

And then execute:

$ bundle

Or install it yourself as:

$ gem install easy_encryption

Finally, call setup on EasyEncryption with a password:

EasyEncryption.setup('secret')

In a Rails app you will need to set the default password inside of your app's ::Application.configure block:

config.after_initialize do
  EasyEncryption.setup('secret')
end

Usage

EasyEncryption provides two additional methods that can be called on any string.

encrypt will encrypt a string:

encrypted_data = 'foo'.encrypt

decrypt will decrypt an encrypted string:

decrypted_data = encrypted_data.decrypt