Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Autokey cipher
(section)
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!
==Cryptanalysis== Autokey ciphers are somewhat more secure than polyalphabetic ciphers that use fixed keys since the key does not repeat within a single message. Therefore, methods like the [[Kasiski examination]] or [[index of coincidence]] analysis will not work on the ciphertext, unlike for similar ciphers that use a single repeated key.<ref name="hoffstein" >{{cite book |title=An Introduction to Mathematical Cryptography |first1=Jeffrey |last1=Hoffstein |first2=Jill |last2=Pipher |first3=Joseph |last3=Silverman |publisher=Springer |url=https://books.google.com/books?id=cbl_BAAAQBAJ&pg=PA288 |date=2014|isbn=9781493917112 | page=288 }}</ref> A crucial weakness of the system, however, is that the plaintext is part of the key. That means that the key will likely contain common words at various points. The key can be attacked by using a dictionary of common words, [[bigram]]s, [[trigram]]s etc. and by attempting the decryption of the message by moving that word through the key until potentially-readable text appears. Consider an example message <code>meet at the fountain</code> encrypted with the primer keyword <code>KILT</code>:<ref>{{cite web|url=http://asecuritysite.com/security/Coding/autokey?word=meetatthefountain%2Ckilt |title=Autokey Calculator |publisher=Asecuritysite.com |access-date=2012-12-26 |url-status=dead |archive-url=https://web.archive.org/web/20131203104209/http://asecuritysite.com/security/Coding/autokey?word=meetatthefountain%2Ckilt |archive-date=2013-12-03 }}</ref> To start, the autokey would be constructed by placing the primer at the front of the message: plaintext: meetatthefountain primer: KILT autokey: KILTMEETATTHEFOUN The message is then encrypted by using the key and the substitution alphabets, here a tabula recta: plaintext: meetatthefountain key: KILTMEETATTHEFOUN ciphertext: WMPMMXXAEYHBRYOCA The attacker receives only the ciphertext and can attack the text by selecting a word that is likely to appear in the plaintext. In this example, the attacker selects the word <code>the</code> as a potential part of the original message and then attempts to decode it by placing <code>THE</code> at every possible location in the key: cipher: WMP MMX XAE YHB RYO CA key: THE THE THE THE THE .. plain: dfl tft eta fax yrk .. cipher: W MPM MXX AEY HBR YOC A key: . THE THE THE THE THE . plain: . tii tqt hxu oun fhy . cipher: WM PMM XXA EYH BRY OCA key: .. THE THE THE THE THE plain: .. wfi eqw lrd iku vvw In each case, the resulting plaintext appears almost random because the key is not aligned for most of the ciphertext. However, examining the results can suggest locations of the key being properly aligned. In those cases, the resulting decrypted text is potentially part of a word. In this example, it is highly unlikely that <code>dfl</code> is the start of the original plaintext and so it is highly unlikely either that the first three letters of the key are <code>THE</code>. Examining the results, a number of fragments that are possibly words can be seen and others can be eliminated. Then, the plaintext fragments can be sorted in their order of likelihood: unlikely βββββββββββ promising eqw dfl tqt ... ... eta oun fax A correct plaintext fragment is also going to appear in the key, shifted right by the length of the keyword. Similarly, the guessed key fragment (<code>THE</code>) also appears in the plaintext shifted left. Thus, by guessing keyword lengths (probably between 3 and 12), more plaintext and key can be revealed. Trying that with <code>oun</code>, possibly after wasting some time with the others, results in the following: shift by 4: ciphertext: WMPMMXXAEYHBRYOCA key: K.LTM.ETA.THE.OUN plaintext: m.eta.the.oun.ain shift by 5: ciphertext: WMPMMXXAEYHBRYOCA key: SWT..EQW..THE..OU plaintext: eqw..the..oun..og shift by 6: ciphertext: WMPMMXXAEYHBRYOCA key: D...TQT...THE...O plaintext: t...the...oun...m A shift of 4 can be seen to look good (both of the others have unlikely Qs either in the plaintext or in the keyword). A lot can be worked with now. The keyword is probably 4 characters long (<code>K.LT</code>), and some of the message is visible: m.eta.the.oun.ain Because the plaintext guesses have an effect on the key 4 characters to the left, feedback on correct and incorrect guesses is given. The gaps can quickly be filled in, giving both the plaintext and the keyword: meetatthefountain KILT The ease of [[cryptanalysis]] is caused by the feedback from the relationship between plaintext and key. A three-character guess reveals six more characters (three on each side), which then reveal further characters, creating a cascade effect. That allows incorrect guesses to be ruled out quickly.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)