Classical Cryptography
Vigenère Cipher
The Vigenère Cipher is a polyalphabetic substitution cipher that uses a repeating keyword to shift each plaintext character.
Algorithm Steps
- 1Take plaintext input.
- 2Take keyword input.
- 3Repeat keyword to match plaintext length.
- 4Convert letters to numeric values.
- 5Apply Vigenère encryption or decryption formula.
- 6Convert numeric results back to letters.
Formula
Encryption: Cᵢ = (Pᵢ + Kᵢ) mod 26 Decryption: Pᵢ = (Cᵢ - Kᵢ) mod 26
Example
Plaintext: ATTACKATDAWN Keyword: LEMON Encrypted text: LXFOPVEFRNHR Decrypted text: ATTACKATDAWN