Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pranav-Sharma-Official/CaesarCipher

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

CaesarCipher

This Python script implements a simple Caesar cipher for encoding and decoding text.

How it works

The Caesar cipher is a substitution cipher where each letter in the plaintext is shifted a certain number of positions down the alphabet.

  • Encoding: Shifts each letter in the input text by the specified shift amount.
  • Decoding: Reverses the encoding process by shifting each letter back by the specified shift amount.
  • Wrapping: The alphabet wraps around, so if a shift goes beyond 'z', it starts again from 'a'.
  • Non-alphabet characters: Characters that are not in the alphabet (spaces, punctuation, numbers) are left unchanged.

Usage

  1. Run the script: Execute the Python script.
  2. Choose direction: Enter "encode" to encrypt or "decode" to decrypt.
  3. Enter message: Type the message you want to encode or decode.
  4. Enter shift number: Provide the integer shift value.
  5. View result: The script will output the encoded or decoded message.

Example

Type 'encode' to encrypt
, Type 'decode' to decrypt:
encode
Type your message:
hello world
Type the shift number:
5
Here is the encoded result: mjqqt btwqi

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Contributors

Languages

  • Python 100.0%