██╗ ██╗██╗ ██████╗ ███████╗███╗ ██╗███████╗██████╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ██████╗██╗ ██╗██████╗ ██╗ ██╗███████╗ ██╗
██║ ██║██║██╔════╝ ██╔════╝████╗ ██║██╔════╝██╔══██╗██╔════╝ ██╔══██╗╚██╗ ██╔╝ ██║██╔════╝██║ ██║██╔══██╗██║ ██║██╔════╝ ██╗╚██╗
██║ ██║██║██║ ███╗█████╗ ██╔██╗ ██║█████╗ ██████╔╝█████╗ ██████╔╝ ╚████╔╝ ██║██║ ███████║██████╔╝██║ ██║███████╗ ╚═╝ ██║
╚██╗ ██╔╝██║██║ ██║██╔══╝ ██║╚██╗██║██╔══╝ ██╔══██╗██╔══╝ ██╔══██╗ ╚██╔╝ ██║██║ ╚════██║██╔══██╗██║ ██║╚════██║ ▄█╗ ██║
╚████╔╝ ██║╚██████╔╝███████╗██║ ╚████║███████╗██║ ██║███████╗ ██████╔╝ ██║ ██║╚██████╗ ██║██║ ██║╚██████╔╝███████║ ▀═╝██╔╝
╚═══╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═╝
Vig3n3r3 is a Python-based cryptography tool designed to encrypt, decrypt, and crack Vigenère cipher-encrypted messages using various cryptanalysis methods like brute force, dictionary attacks, and crib attacks. This project is built as a tribute to one of history's most famous ciphers and demonstrates how modern techniques can unravel what was once thought to be unbreakable.
- Encrypt and Decrypt messages using the Vigenère cipher.
- Brute-force Attack: Crack a cipher by trying all possible keys.
- Dictionary Attack: Use a predefined wordlist to guess the key.
- Crib Attack: Use known plaintext segments to deduce the key.
To get started with Vig3n3r3, follow these steps:
git clone https://github.com/your-username/vig3n3r3.git
cd vig3n3r3
The project does not require any external Python packages. Just ensure you are using Python 3.x by checking:
python --version
To run the script, use the following command:
python vig3n3r3.py "CIPHERTEXT" --method METHOD_NUMBER --keylength LENGTH --crib "KNOWN_PLAINTEXT"
CIPHERTEXT
: The encrypted message.METHOD_NUMBER
: Choose from1
(dictionary),2
(brute force),3
(crib attack), etc.LENGTH
: The length of the key (required for methods 1 and 2).KNOWN_PLAINTEXT
: The known part of the plaintext (required for method 3).
python vig3n3r3.py "KXRKGIKXBKAL" --method 2 --keylength 3
This will attempt to brute force the key of length 3 and decrypt the message.
python vig3n3r3.py "KXRKGIKXBKAL" --method 1 --keylength 3
This will search for a valid key of length 3 using the words from words.txt
.
python vig3n3r3.py "KXRKGIKXBKAL" --method 3 --crib "ATTACK"
This will attempt to find the key by using "ATTACK" as known plaintext.
- The wordlist for the dictionary attack was sourced from the enable1.txt wordlist, a popular open-source wordlist.
- The monograms, bigrams, trigrams, and quadgrams data used for frequency analysis were obtained from Peter Norvig's Ngram Data.
Welcoming contributions! Please feel free to submit a pull request or open an issue if you'd like to improve or fix something.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For a detailed breakdown of the history behind the Vigenère cipher, modern cryptography techniques, and the story of Vig3n3r3, read my article on Medium: The Vigenère Cipher: From Unbreakable Enigma to Cryptographic Relic.
███████╗██╗ ██╗ ██████╗ ██████╗██████╗ ███████╗███████╗
██╔════╝██║ ██║██╔════╝██╔════╝╚════██╗██╔════╝██╔════╝
███████╗██║ ██║██║ ██║ █████╔╝███████╗███████╗
╚════██║██║ ██║██║ ██║ ╚═══██╗╚════██║╚════██║
███████║╚██████╔╝╚██████╗╚██████╗██████╔╝███████║███████║