Enigma is a ruby-based project completed during my time at the Turing School of Software and Design. The aim of the project is to create a tool that runs off a command-line interface that is capable of carrying out ceaser cipher encyption or decryption of a message, as well as cracking an encryption code. More details on the encryption algorithim can be found here.
This was a one week solo project.
Enigma has a lean design. The pipeline starts with a user provided text file that includes a message to be encrypted or decrypted. Following a CLI prompt, a runner file reads the message contained in the text file, and passes it to the enigma class to be decrypted or encrypted. Based upon the action requested, the enigma class will reach out to a module that will provide the encryption/decryption key, or it will reach out to a class that cracks an unknown encryption key. The information is generated and passed back up the chain into encryption/decryption text files.
The project uses Rspec to test the project. Each method contained within the project has an accompanying test. Particular attention was paid to edge cases.
After cloning the project, choose one of the paths below to run the program.
To Encrypt
- To encrypt, write a message in message_to_encrypt.txt
- Run the following command in your CLI
$ ruby encrypt.rb message_to_encrypt.txt encrypted_message.txt
- Your encyrpted message will be found in encrypted_message.txt
To Decrypt
- Start by encrypting a message using the steps above.
- Run the following command in your CLI
$ ruby decrypt.rb encrypted_message.txt.txt decrypted_message.txt
- Your decyrpted message will be found in decrypted_message.txt
To Crack
Cracking will crack an encrypted message, and it will report to you the key that was used to encrypt it.
- Start by encrypting a message using the steps above. Note - the message must end in ' end' for the cracker to work.
- Run the following command in your CLI
$ ruby crack.rb encrypted_message.txt craced.txt
- Your cracked message will be found in cracked.txt