I wrote this code during my freshman year back in 2013, after reading the book Hacking Secret Ciphers with Python by Al Sweigart.
This utility implements the Caesar Shift Algorithm which is named after Julius Caesar, who used it in his private correspondence.
- It would be helpful for anyone wants to learn how a basic encryption algorithm works.
- a good example for working with strings in java.
This project was implemented on IntelliJ IDEA.
Eevery letter in alphabet has an index number ,
In case of Encryption
- find out each letter's index number in the Plaintext ..
then add the encryption key to it ,
- if index + encryption key > 26 (which is alphabet length)..
subtract 26 from the Final Index..
- the final Finaltxt is the index we need
this index reffers to a new letter..
this letter is the encrypted form of the plaintext
we call it ciphertext.
In case of Decryption
- find out each letter's index number in the siphertext ..
then subtract the encryption key from it ,
- if index - encryption key < 0 ..
add 26 to the Final Index..
- the final Finaltxt is index we need
this index refers to a new letter..
this letter is the encrypted form of the plaintext
we call it ciphertext.
As a demo for this code you may check my android app on Play Store which implements Caesar Cipher Algorithm for encrypting and decrypting texts.