Linet Mutheu
This is an application where users may input text and a private key that is used to encrypt their message. The idea used is a Caesar shift. This is a type of substitution in which each letter is shifted a certain number of places also known as a key, down the alphabet. For example, with a shift of 1, A would be replaced by B, B would become C, and so on. Users can choose between encrypting and decrypting, enter their message and private key, see the encrypted message and further decrypt the message.
To access this project on your local files, you can clone it using these steps
- Open your terminal
- Use this command to clone `$ git clone https://github.com/MutheuLinet/Caesar-Shift.git
- This will clone the repository into your local folder
- Navigate to the folder you cloned into, within src/main/java/App.java and open it with intellij.
- Run App.java on your terminal.
The user is able to;
-
Run the application using their terminal
-
Input the Characters to encode or decode ie THE QUICK BROWN LAZY FOX
-
Key in the key ie 3
-
Read the output Provided.
(It also allows a user to Test the output before actual running of the App)
-
Navigate to the folder you cloned into, within src/test/java/shiftTests and open it with intellij. Select the DecodeTests or ExpressInCodeTests.
-
This is a sample test to shift characters 23 steps forward from their original positions.
@Test public void Decode_decodesText_String() throws Exception {
Decode decode = new Decode();
String inputted = decode.undoCode("QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD", 23);
assertEquals ("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG", inputted);
}
- Right click within the open test file and run the tests on your terminal.
- Java
- IntelliJ
- Junit
- Jdk
- SDK
This project is under the MIT licence
Copyright (c) 2022 Linet Mutheu