Skip to content

This is a command-line program that implements the Caesar Cipher encryption technique.

Notifications You must be signed in to change notification settings

benruwel/CaesarCipher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation


Caesar Cipher

Command line program that implements the Caesar Cipher encryption technique.

Ben Ruwel

Table of Contents

About The Project

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

Built With

This is program is wholely written in Java and built with

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

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

Installation

  1. Clone the repo
$ git clone https://github.com/benruwel/CaesarCipher.git
  1. Wait gradle to install all the dependencies automatically

Usage

To build this project:

  1. Open your preferred terminal

  2. In your project's root directory compile the project with

$ gradle compileJava
  1. Then in the build/classes/main/java directory run this:
$ java App

BDD

For both encryption and decryption:

  1. Created a string of alphabets in the English language which I used it as a reference point
  2. 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.

Encryption

For encryption of a letter x by a shift n is described by:

$$En(x) = (x + n) mod 26$$

The results are:

Plain:    ABCDEFGHIJKLMNOPQRSTUVWXYZ
Cipher:   XYZABCDEFGHIJKLMNOPQRSTUVW

Decryption

For decryption of a letter x by a shift n is described by:

$$En(x) = (x - n) mod 26$$

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

Contributing

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

My email - ruwelmwangi@gmail.com

Project Link: https://github.com/benruwel/CaesarCipher.git

Acknowledgements

About

This is a command-line program that implements the Caesar Cipher encryption technique.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages