No commit activity in last 3 years
No release in over 3 years
A Símplifìed reversible encryption solution
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.8
~> 10.0
>= 0

Runtime

>= 0
 Project Readme

ReversibleCryptography

Easy-to-use reversible encryption solutions.

Installation

Add this line to your application's Gemfile:

gem 'reversible_cryptography'

And then execute:

$ bundle

Or install it yourself as:

$ gem install reversible_cryptography

Usage

encrypted_message = ReversibleCryptography::Message.encrypt("target_message", "password")
# => "md5:388eeae24576572f946e9043a2118b2d:salt:161-225-182-109-143-90-1-28:aes-256-cfb:DHY6DF3+iFzH36FMbeI="
ReversibleCryptography::Message.decrypt(encrypted_message, "password") == "target_message"
# => true

CLI

Add reversible_cryptography command

$ reversible_cryptography

Commands:
  reversible_cryptography decrypt [TEXT]  # Decrypt text or file
  reversible_cryptography edit FILE       # Edit encrypted file
  reversible_cryptography encrypt [TEXT]  # Encrypt text or file
  reversible_cryptography help [COMMAND]  # Describe available commands or one specific command

Encrypt sample

$ reversible_cryptography encrypt message
Input password:
md5:78e731027d8fd50ed642340b7c9a63b3:salt:252-235-72-88-180-7-195-229:aes-256-cfb:VH2JxqUU9Q==
cat original.txt
this is secret!

reversible_cryptography encrypt --password=pass --src-file=original.txt --dst-file=encrypted.txt

cat encrypted.txt
md5:f5b013aca1b774be3d3b5f09f76e6cc8:salt:228-129-190-248-134-146-102-97:aes-256-cfb:u+lhtAdW6Re8br0qePqzig==

Decrypt sample

reversible_cryptography decrypt md5:78e731027d8fd50ed642340b7c9a63b3:salt:252-235-72-88-180-7-195-229:aes-256-cfb:VH2JxqUU9Q==
Input password:
message
cat encrypted.txt
md5:f5b013aca1b774be3d3b5f09f76e6cc8:salt:228-129-190-248-134-146-102-97:aes-256-cfb:u+lhtAdW6Re8br0qePqzig==

reversible_cryptography decrypt --password=pass --src-file=encrypted.txt --dst-file=decrypted.txt

cat decrypted.txt
this is secret!

Edit sample

cat encrypted.txt
md5:f5b013aca1b774be3d3b5f09f76e6cc8:salt:228-129-190-248-134-146-102-97:aes-256-cfb:u+lhtAdW6Re8br0qePqzig==

reversible_cryptography edit encrypted.txt --password=pass --editor=vim

# modify encrypted.txt

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bin/console for an interactive prompt that will allow you to experiment.

To 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 to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  1. Fork it ( https://github.com/mitaku/reversible_cryptography/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request