Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Caesar Cipher Encryption/Decryption Tool

Dalle2_ART

Artwork created by Dalle 3 AI

Project Overview

This Python script serves as a Caesar Cipher encryption and decryption tool. The purpose is to encode and decode messages using the basic American Standard Code for Information Interchange (ASCII). The script utilizes the sys package for input handling.

Code Details

The script employs if, else, and elif functions for handling user choices. The if statement checks whether the user wants to encrypt or decrypt the message. If encrypting, it enters the corresponding line of code; if decrypting, it enters another line of code. The elif function is used for additional conditions. Additionally, basic for loops are used for both encryption and decryption processes. These loops iterate through each character in the input message, applying the Caesar Cipher algorithm. The ord function is used to convert characters to their corresponding ASCII values, and the chr function is used to convert ASCII values back to characters. The ''.join function is also utilized to concatenate the characters back into a string, providing a more readable format for the final result. To make sure that code can handle big numbers for a key variable, the encoding and decoding code includes functions like (ord(z)- 32 + key) % 95 + 32 for encoding and (ord(z)- 32 - key) % 95 + 32 for decoding. Dividing by 95 ensure that our ord value will not overflow the limits of ASCII model and adding and subtracting 32 ensure the set limits.

Limitations

  • The encoded message appearance can vary based on the chosen key, potentially resulting in non-alphabetic characters.
  • A temporary fix is implemented by instructing users to copy and paste the encoded message for future decryption.
  • Considerations for improving the user experience, such as finding alternatives to manual copying and pasting, are mentioned.

Future Steps

  • Explore solutions to make the encoding and decoding process more user-friendly without manual copying.
  • Consider adapting the code for use in a Telegram bot to provide a more streamlined and accessible experience.

How to Use

  1. Run the script in a Python environment.
python caesar_cipher.py
  1. Choose whether to encrypt or decrypt a message by entering 'E' or 'D' respectively.
  2. If encrypting, enter the message to be encoded and a key for encryption.
  3. If decrypting, enter the message to be decoded and the encryption key used.
  4. Copy and save the resulting encrypted or decrypted message.
  5. The program prompts whether you want to use the Caesar Cipher tool again. Respond with 'Y' to continue, or 'N' to exit.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages