Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Vigenère cipher
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Key elimination=== The Vigenère cipher, with normal alphabets, essentially uses modulo arithmetic, which is commutative. Therefore, if the key length is known (or guessed), subtracting the cipher text from itself, offset by the key length, will produce the plain text subtracted from itself, also offset by the key length. If any "probable word" in the plain text is known or can be guessed, its self-subtraction can be recognized, which allows recovery of the key by subtracting the known plaintext from the cipher text. Key elimination is especially useful against short messages. For example, using <code>LION</code> as the key below: {| | Plaintext: || <code>thequickbrownfoxjumpsoverthelazydog</code> |- | Key: || <code>LIONLIONLIONLIONLIONLIONLIONLIONLIO</code> |- | Ciphertext: || <code>EPSDFQQXMZCJYNCKUCACDWJRCBVRWINLOWU</code> |} Then subtract the ciphertext from itself with a shift of the key length 4 for <code>LION</code>. {| | Ciphertext (original): || <code>'''EPSD'''FQQXMZCJYNCKUCACDWJRCBVRWINLOWU</code> |- | Ciphertext (shifted): || <code>FQQXMZCJYNCKUCACDWJRCBVRWINLOWU____</code> |- | Result (difference): || <code>ZZCGTROOOMAZELCIRGRLBVOAGTIGIMT{{strikethrough|LOWU}}</code> |} Which is nearly equivalent to subtracting the plaintext from itself by the same shift. {| | Plaintext (original): || <code>'''theq'''uickbrownfoxjumpsoverthelazydog</code> |- | Plaintext (shifted): || <code>uickbrownfoxjumpsoverthelazydog____</code> |- | Result (difference): || <code>zzcgtrooomazelcirgrlbvoagtigimt{{strikethrough|ydog}}</code> |} Which is algebraically represented for <math>i \in [1, n - m]</math> as: :<math> \begin{align} (C_i - C_{(i + m)}) \bmod \ell &= (E_K(M_i) - E_K(M_{(i + m)})) \bmod \ell \\ &= ((M_i + K_{(i \bmod m)}) \bmod \ell - (M_{(i + m)} + K_{((i + m) \bmod m)}) \bmod \ell) \bmod \ell \\ &= ((M_i + K_{(i \bmod m)}) - (M_{(i + m)} + K_{((i + m) \bmod m)})) \bmod \ell \\ &= (M_i + K_{(i \bmod m)} - M_{(i + m)} - K_{((i + m) \bmod m)}) \bmod \ell \\ &= (M_i - M_{(i + m)} + K_{(i \bmod m)} - K_{((i + m) \bmod m)}) \bmod \ell \\ &= (M_i - M_{(i + m)} + K_{(i \bmod m)} - K_{(i \bmod m)}) \bmod \ell \\ &= (M_i - M_{(i + m)}) \bmod \ell \\ \end{align}</math> In this example, the words <code>brownfox</code> are known. {| | Plaintext (original): || <code>brownfox</code> |- | Plaintext (shifted): || <code>nfox____</code> |- | Result (difference): || <code>omaz{{strikethrough|nfox}}</code> |} This result <code>omaz</code> corresponds with the 9th through 12th letters in the result of the larger examples above. The known section and its location is verified. Subtract <code>brow</code> from that range of the ciphertext. {| | Ciphertext: || <code>EPSDFQQX'''MZCJ'''YNCKUCACDWJRCBVRWINLOWU</code> |- | Plaintext: || <code>________brow_______________________</code> |- | Key: || <code>{{strikethrough|EPSDFQQX}}'''LION'''{{strikethrough|YNCKUCACDWJRCBVRWINLOWU}}</code> |} This produces the final result, the reveal of the key <code>LION</code>.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Vigenère cipher
(section)
Add topic