Reputation: 5821
I am trying to understand how the vigenere algorithm works but am a bit stumped. Lets says I have the following:
Key: L
Text: W
Encrypted_text: H (According to the table below)
I am trying to decrypt the message and I read that you do it backwards (interchange columns with rows) for some reason I am reading this
Key: L
Text: H (Previously encrypted message)
Encrypted_text: S (According to the table below)
Perhaps there is something fundamentally wrong with my reading.
PS: I have written a python program that does this but then understanding is flawed so the reading backwards part does not. Any insight on how to read the
Upvotes: 1
Views: 182
Reputation: 1774
The Wikipedia page on this kind of cipher explains how it works. The way I think about it is that you assign each letter a number corresponding to its position in the alphabet, zero-indexed (A is 0, B is 1, C is 2, etc.) and repeat your key under your message. Here's Wikipedia's example:
Plaintext: ATTACKATDAWN
Key: LEMONLEMONLE
Then, you move a number of letters equal to the number assigned to each letter in the plaintext's corresponding letter in the key.
To actually answer your original question, to decrypt an H with key L using that table, you would find the key letter in the leftmost column (L, in the twelfth row), then move right until you find the ciphertext letter in that row (H, in the twenty fourth column), then move up to the top row of the chart. That cell contains the plaintext letter (W).
Upvotes: 1