Gemnigma
The Gemnigma gem is an encryption engine for encoding messages. It is built using the Ruby programming language and intended to be used from within the command line.
Installation
Add this line to your application's Gemfile:
gem 'Gemnigma'
And then execute from the command line:
$ bundle
Or install it directly from the command line yourself as:
$ gem install Gemnigma
How the encryption works
The encryption is based on rotation of letters based on a a key and the date that message was generated. The character map is made up of alphanumeric characters (alphabets all in lowercase), space character, period character and the comma character.
The Key
- Each message uses a unique encryption key
- The key is five digits, like 41521
- The first two digits of the key are the "A" rotation (41)
- The second and third digits of the key are the "B" rotation (15)
- The third and fourth digits of the key are the "C" rotation (52)
- The fourth and fifth digits of the key are the "D" rotation (21)
The Offset
- The date of message transmission is also factored into the encryption
- Consider the date in the format DDMMYY, like 020315
- Square the numeric form (412699225) and find the last four digits (9225)
- The first digit is the "A offset" (9)
- The second digit is the "B offset" (2)
- The third digit is the "C offset" (2)
- The fourth digit is the "D offset" (5)
Usage
Encrypt a message by providing an input file and an output file:
Gemnigma encrypt .txt encrypted.txt
Decrypt a message by providing an input file, an output file, a key and a date offset:
Gemnigma decrypt encrypted.txt decrypted.txt 41521 7225
Crack a message when the key is not known by providing an input file, an output file, and a date:
Gemnigma crack encrypted.txt cracked.txt 51015
List the contents of a directory by calling Gemnigma list and passing in options from "all", "file" or "folder"
Gemnigma list file
Call the help documentation at any time by typing Gemnigma help
Gemnigma help
Contributing
- Fork it: Fork Gemnigma on Github
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
License
Gemnigma is released under the MIT License