Skip to content

Caesar Cipher Encryption/Decryption Algorithm using Java

Notifications You must be signed in to change notification settings

samerkanakri/CaesarCipher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Caesar Cipher Encryption/Decryption Algorithm

About

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.

How is this helpful?

  • It would be helpful for anyone wants to learn how a basic encryption algorithm works.
  • a good example for working with strings in java.

IDE

This project was implemented on IntelliJ IDEA.

Pseudo code

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.

Android App

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.

Releases

No releases published

Packages

No packages published

Languages