Giter Site home page Giter Site logo

enigma's Introduction

Enigma

This was the final project for Mod 1 at the Turing School of Software & Design. The goal was to be able to encrypt and decrypt messages. We were given a paragraph to encrypt, creating a key and a date to use for decryption. Then we were expected to be able to decrypt the encrypted message using that key and date, and get a file with a paragraph the exact same as the original message, but with all lowercase letters.

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Installation

Terminal commands are on a Mac

From your terminal, go to the folder you want to install this project in, then run this command:

git clone https://github.com/benfox1216/enigma.git

Enter the command cd enigma

Open the directory in your favorite text editor.

Make sure Ruby 2.5.7 is installed. Install Bundler, then run it to install the remaining gems in the gemfile:

gem install bundler
bundle install

Testing

You can run the test suite by running rake test.

These test the encryption and the decryption features, with edge cases accounted for. It also tests the enigma decrypt/encrypt methods separately, also with edge cases accounted for. While the usage commands use today's date, it can also work using a random date.

You will also have the ability to utilize binding.pry to pry into the code contained in the lib folder, and the tests in the test folder. You can also pry into the encrypt.rb and decrypt.rb files by running the usage commands below with a pry added.

All 43 assertions should pass, with 100% test coverage.

Usage

To see it in action, run the following command, and it will encrypt the message contained in the message.txt file, and save it to a new file called encrypted.txt:

ruby ./lib/encrypt.rb message.txt encrypted.txt

It will print a message confirming this has happened, and also give you an automatically generated key and today's date in 6-digit format for decryption.

Example: Created 'encrypted.txt' with the key 67939 and date 250520

Now run this next command to decrypt the message that was saved in the encrypted.txt file, using the random key and the date from the last output. The decrypted message will be saved in a new file called decrypted.txt:

Note: "(key given)" and "(date given)" reference the ones given as the output to the encryption command

ruby ./lib/decrypt.rb encrypted.txt decrypted.txt (key given) (date given)

You should now have an encrypted.txt file with the encrypted message, and a decrypted file with the decrypted message, which should be the exact same as the original message in message.txt (except all letters will be lowercase).

enigma's People

Contributors

benfox1216 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.