Skip to content

SankalpGhasti-dev/Text_Encryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Text Encryption (Caesar Cipher)

This project is a simple implementation of the Caesar Cipher in Python. The Caesar Cipher is a basic encryption technique where each letter in the plaintext is shifted by a fixed number of positions in the alphabet.

Features

  • Encrypt and decrypt text using the Caesar Cipher method.
  • Handles both uppercase and lowercase letters.
  • Keeps non-alphabetic characters (spaces, punctuation, numbers) unchanged.

Usage

  1. Run the script:

  2. Enter the plaintext you want to encrypt/decrypt when prompted.

  3. Enter the key (an integer, 1-25) for the letter shift.

  4. The program will display:

  • The original text
  • The encrypted (cipher) text
  • The decrypted (original) text

Example

Enter the text: Hello World! Enter the key: 3 Original Text: Hello World! Encrypted Text: Khoor Zruog! Decrypted Text: Hello World!

How it Works

  • The program defines a function caesar_cipher(text, key_value, mode) that shifts each alphabetic character by the key value.
  • For decryption, the shift is reversed.
  • Non-alphabet characters are not changed.
  • Uses ASCII values to shift and wrap around the alphabet.

File Structure

  • text_encryption.py: Main Python script containing the Caesar Cipher implementation and usage instructions.

License

This project is licensed under the MIT License.

Author

Sankalp Ghasti

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages