Command line program that implements the Caesar Cipher encryption technique.
Ben Ruwel
This is a commmand line program that implements the Caesar Cipher encryption tecgnique. This type of encryption is one of the simplest and most widely known encryption techniques.
It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence
This is program is wholely written in Java and built with
To get a local copy up and running follow these simple example steps.
This is an example of how to list things you need to use the software and how to install them.
- gradle
$ brew update
$ brew install gradle
- Clone the repo
$ git clone https://github.com/benruwel/CaesarCipher.git
- Wait gradle to install all the dependencies automatically
To build this project:
-
Open your preferred terminal
-
In your project's root directory compile the project with
$ gradle compileJava
- Then in the
build/classes/main/java
directory run this:
$ java App
For both encryption and decryption:
- Created a string of alphabets in the English language which I used it as a reference point
- Created an algorithm that looks for the index of the characters of the input string in relation to the alphabet
Using the indices from the above output, I used this algorithm to shift the characters.
For encryption of a letter x
by a shift n
is described by:
The results are:
Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Cipher: XYZABCDEFGHIJKLMNOPQRSTUVW
For decryption of a letter x
by a shift n
is described by:
The results are:
Ciphered text: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
Plain text: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
My email - ruwelmwangi@gmail.com
Project Link: https://github.com/benruwel/CaesarCipher.git