1212
100LinesOfPythonCode/#1065_Vignere_Cipher_Tool at patch-5 · hack9me/100LinesOfPythonCode · GitHub
Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

📝 Vigenère Cipher Tool (Python)

A simple, powerful command-line tool to encrypt and decrypt messages using the classic Vigenère cipher. It showcases a historical polyalphabetic cipher in under 100 lines of clean, PEP 8–compliant Python code.

🚀 Features

🔐 Encrypt any plaintext message with a secret keyword. 🔓 Decrypt ciphertext back to its original form using the same keyword. 🔄 Handles messages of any length by looping the keyword. ✍️ Preserves original character case and ignores non-alphabetic characters (spaces, punctuation, numbers).

🧠 Highlights

Written in pure Python — no external libraries needed 🐍. Under 100 lines of readable, well-commented code 💯. Demonstrates: String manipulation and dictionary lookups. The power of modulo arithmetic for cryptographic wrapping. Clean function design with clear parameters. Following PEP 8 style guidelines.

⚙️ How to Run

Save the code as vigenere.py. Open a terminal or command prompt in the same directory. Run the script: Bash python vigenere.py The script will run a pre-defined example to demonstrate its functionality. You can easily change the message and keyword variables inside the file to test your own text! 🎯

💻 Example

Running the script produces the following output:

Original Message: Hello, World! This is a secret message. Keyword: PYTHON Encrypted Message: Gsmop, Fyrvj! Hmie si e wsqbch iawwegs. Decrypted Message: Hello, World! This is a secret message.

🧩 Author

Made with ❤️ by a Python enthusiast. A perfect mini-project for anyone interested in cryptography, algorithms, or practical applications of core Python concepts.