ktoyesh04 / caesar_cipher

The code is an implementation of the Caesar Cipher encryption and decryption technique using Python. It takes a plain-text message as input along with the shift value and direction of cipher (encrypt or decrypt) specified by the user & returns the encrypted or decrypted message. The code uses a simple algorithm to shift the letters.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Caesar Cipher

This is a simple implementation of the Caesar Cipher encryption and decryption algorithm in Python. The Caesar Cipher is a substitution cipher that shifts the letters of the alphabet by a certain number of positions down the alphabet.

Description

It takes a plain-text message as input along with the shift value and direction of cipher (encrypt or decrypt) specified by the user. The program then shifts each letter of the message by the specified shift value and returns the encrypted or decrypted message.

The code uses a simple algorithm to shift the letters. First, it checks whether the letter is upper or lowercase, then applies the shift value to the ASCII value of that letter, and finally converts the resulting ASCII value back to a character

Usage

To use this program, simply run caesar_cipher.py and follow the instructions on the command line. You can choose to either encrypt or decrypt a message and specify the number of positions to shift the letters. image

Example

Here is an example of encrypting the message "hello world" with a shift of 3: image

Future Improvements

This implementation is a simple command line tool and could be improved with a user interface, better input validation, and more robust error handling. Additionally, the algorithm could be extended to support more complex characters and languages beyond the English alphabet.

About

The code is an implementation of the Caesar Cipher encryption and decryption technique using Python. It takes a plain-text message as input along with the shift value and direction of cipher (encrypt or decrypt) specified by the user & returns the encrypted or decrypted message. The code uses a simple algorithm to shift the letters.


Languages

Language:Python 100.0%