Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/d4v1-sudo/vigenere-cipher
🧩🔒 - Vigenere cipher: encode/decode using passcodes
https://github.com/d4v1-sudo/vigenere-cipher
cipher cipher-algorithms ciphers ciphertext vigenere vigenere-cipher vigenere-cipher-algorithm
Last synced: about 1 month ago
JSON representation
🧩🔒 - Vigenere cipher: encode/decode using passcodes
- Host: GitHub
- URL: https://github.com/d4v1-sudo/vigenere-cipher
- Owner: d4v1-sudo
- License: mit
- Created: 2023-11-03T21:35:43.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-28T23:43:44.000Z (8 months ago)
- Last Synced: 2024-04-29T00:34:38.933Z (8 months ago)
- Topics: cipher, cipher-algorithms, ciphers, ciphertext, vigenere, vigenere-cipher, vigenere-cipher-algorithm
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🧩🔒 - Vigenere Cipher
This Python script implements the Vigenere cipher for encrypting and decrypting text based on a provided keyword.
## Usage
1. **Clone the Repository:**
```bash
https://github.com/d4v1-sudo/vigenere-cipher.git
cd vigenere-cipher
```2. **Run the Script:**
```bash
python3 vigenere_cipher.py
```3. **Follow the Prompts:**
- Enter the text to be processed.
- Enter the keyword for encryption or decryption.
- Choose to encrypt or decrypt by typing 'e' or 'd' accordingly.## Script Description
The Python script consists of two functions:
### `generateKey(string, key)`
This function generates a key of the same length as the input string by repeating the provided keyword. If the lengths are already equal, the key is returned as is.
### `vigenere(string, key, mode)`
This function performs the Vigenere cipher operation on the input string using the provided key and specified mode ('e' for encryption or 'd' for decryption).
- Encryption (`mode == "e"`): Encrypts the input text using the Vigenere cipher.
- Decryption (`mode == "d"`): Decrypts the input text using the Vigenere cipher.## Example
```bash
Text to process: HelloWorld
Keyword: KEY
Encrypt or decrypt? (Type 'e' or 'd'): e
Ciphertext: RiJvsPvyG
```## Note
- Make sure to only enter alphabetic characters in the input text.
- The keyword should consist of alphabetic characters only.Feel free to use and modify the script for your cryptographic needs. If you encounter any issues or have suggestions for improvements, please let us know.