Project

eaesy

0.0
No commit activity in last 3 years
No release in over 3 years
Encrypts a string value using the AES 256 CBC algorithm and decrypts it back again.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.15
~> 10.0
 Project Readme

Eaesy

Eaesy is a gem for quickly encrypting and decrypting a string value using the AES 256 CBC algorithm. All encrypted values and initialization vectors are string-representations of binary values for ease of use.

Installation

Add this line to your application's Gemfile:

gem 'eaesy'

And then execute:

$ bundle

Or install it yourself as:

$ gem install eaesy

Usage

Encrypt a string

Without existing Initialization Vector

eaesy = Eaesy::Cipher.new('YOUR_ENCRYPTION_KEY')
enc_hash = eaesy.encrypt('SOME_STRING')
encrypted_text = enc_hash[:encrypted_secret]
initialization_vector = enc_hash[:iv]

With existing Initialization Vector

eaesy = Eaesy::Cipher.new('YOUR_ENCRYPTION_KEY')
enc_hash = eaesy.encrypt('SOME_STRING', initialization_vector)
encrypted_text = enc_hash[:encrypted_secret]

Don't forget to store the initialization vector for later decrypting!

Decrypt a previously encrypted value

eaesy = Eaesy::Cipher.new('YOUR_ENCRYPTION_KEY')
decrypted_text = eaesy.decrypt(encrypted_text, initialization_vector)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/johnpwillman/eaesy.

License

The gem is available as open source under the terms of the MIT License.