Cracking the Vigenere Cipher knowing the keyword length.

by fortenforge, Sep 7, 2009, 10:09 PM

VNZZNXVRBEGBJAZIETKPKFFXJSBFNMYEKVILKHXJAMZSYRCMZOGFFPRTVYIG
XAYZGFVNMFFMYEBDAZZNTKIHEEFVRZVTAIONXHMYETZDHWSVZEGTEMFAICAG
FNIRPXITAVNBKMHMELKOKVAEZSTKIHEIGJTHEEHIMXKAEFRXEEKXYMYEGZTU
IIGXSAFMXJTHDEGFRPFMXETAVNBKEEVVTKELKHXJTTEDTIDHWLBMIGXAGUAW
USMFTAVCHDFHITLFFEZFXKHBJILKHXVNZZNXVRLYIZYPKZVBCEZVHXIBXITA
FOOVR

Here is our ciphertext, we know that it was encrypted using a vigenere cipher of length 3.

We split the text into 3 parts, if we call the first letter $ 0$, the second letter $ 1$, the third letter $ 2$, and so on, the $ 0$th group has all letters $ 0 \pmod{3}$, the first group has all letters $ 1 \pmod{3}$, and the second group has all letters $ 2 \pmod{3}$.

VZVEJIKFJFYVKJZRZFRYXZVFYDZKEVVIXYZWZTFCFRIVKMKVZKEJEIKFEXYZ
IXFJDFFEVKVKKJEIWMXUUFVDIFZKJKVZVYYZCVIIFV

NNRGAEPFSNEIHASCOFTIAGNFEANIERTOHEDSEEAANPTNMEOASIITEMAREYET
ISMTERMTNEVEHTDDLIAASTCFTFFHIHNNRIPVEHBTOR

ZXBBZTKXBMKLXMYMGPVGYFMMBZTHFZANMTHVGMIGIXABHLKETHGHHXEXKMGU
GAXHGPXABETLXTTHBGGWMAHHLEXBLXZXLZKBZXXAO

Let us start with group 1.

VZVEJIKFJFYVKJZRZFRYXZVFYDZKEVVIXYZWZTFCFRIVKMKVZKEJEIKFEXYZ
IXFJDFFEVKVKKJEIWMXUUFVDIFZKJKVZVYYZCVIIFV

We know that all the letters in this group have been encrypted in a caesar cipher of a certain key, to find the key we can sort through all 26 keys and decide which one matches the frequency analysis of normal english text.

A B C D E _F _G H I J K _L M N O P Q R S T U V _W X Y Z
0 0 2 3 7 _13 0 0 9 7 12 0 2 0 0 0 0 3 0 1 2 15 2 5 7 12
8 2 3 4 13 2 _2 6 7 0 1 _4 2 7 8 2 0 6 6 9 3 1 _2 0 2 0

The first row is the percentages of frequency in the ciphertext and the second row is normal english. We see a row of 4 0's in the cipher text row, that probably corresponds to WXYZ in the english row. We have to shift the first 0 backwards 17 spaces to correspond to the W. But are we convinced that the key is 17? Well, when we shift the 15 in the first row back 17 spaces it corresponds to E, because E is the most commonly occurring letter in the English language and because 15 is the highest number in the first row, we can be pretty confident that 17 is the key. If A = 0 , B = 1 and so on 17 = R. R is the first letter of the keyword for the vigenere cipher. When decrypted in a caesar cipher of key R, our text becomes

EIENSRTOSOHETSIAIOAHGIEOHMITNEERGHIFICOLOARETVTEITNSNRTONGHI
RGOSMOONETETTSNRFVGDDOEMROITSTEIEHHILERROE.

When inserted back in our ciphertext in the correct place our ciphertext becomes

E**I**E**N**S**R**T**O**S**O**H**E**T**S**I**A**I**O**A**H**
G**I**E**O**H**M**I**T**N**E**E**R**G**H**I**F**I**C**O**L**
O**A**R**E**T**V**T**E**I**T**N**S**N**R**T**O**N**G**H**I**
R**G**O**S**M**O**O**N**E**T**E**T**T**S**N**R**F**V**G**D**
D**O**E**M**R**O**I**T**S**T**E**I**E**H**H**I**L**E**R**R**
O**E*

* represents an unknown letter.

If we examine the 2nd group

NNRGAEPFSNEIHASCOFTIAGNFEANIERTOHEDSEEAANPTNMEOASIITEMAREYET
ISMTERMTNEVEHTDDLIAASTCFTFFHIHNNRIPVEHBTOR

you will find that it's frequency analysis is already very close to the English language. This tells us that it was encrypted with a caesar cipher of shift 0. The corresponding letter is A. (If you don't believe me, use the same method that we did on the 1st group).

Now we can plug these letters strait back into our ciphertext we get:

EN*IN*ER*NG*SA*RE*TP*OF*SS*ON*HE*EI*TH*SA*IS*AC*IO*OF*AT*HI*
GA*IG*EN*OF*HE*MA*IN*TI*NE*ER*ET*RO*GH*HE*ID*FS*IE*CE*OA*LA*
ON*AP*RT*EN*TM*VE*TO*EA*IS*TI*NI*ST*NE*RM*TA*OR*NE*GY*HE*IT*
RI*GS*OM*ST*ME*OR*OM*NT*EN*TE*EV*TE*TH*ST*ND*RD*FL*VI*GA*DA*
DS*OT*EC*MF*RT*OF*IF*TH*SI*TH*EN*IN*ER*HI*HP*IV*LE*EH*RB*RT*
OO*ER

Now at this point we have several options. We could use the same method on group 3 to find the plaintext as we did on groups 1 and 2. We know 2/3 of the plaintext so we can guess with fairly good accuracy the rest of the plaintext. We also know what 2/3 of the letters in the keyword are. RA* is the current keyword. Because the keyword is usually an actual word, we can guess at the key letter for the last group. Possible endings are N for 'RAN', T for 'RAT', B for 'RAB' (the person sending the message might be a Harry Potter fan) or G for 'RAG'. We could then try each of these letters until we find the correct answer.

Using any of the methods you would probably find that the last key letter was 'T', and that the decrypted text was,

GEIIGAREITRSETFTNWCNFMTTIGAOMGHUTAOCNTPNPEHIOSRLAONOOELERTNB
NHEONWEHILASEAAOINNDTHOOSLEISEGESGRIGEEHV

Plugging this back into our partially decrypted message and formatting it a bit we get:

Engineering is a great profession. There is the satisfaction of watching a figment of the imagination emerge through the aid of science to a plan on paper. Then it moves to realisation in stone or metal or energy. Then it brings homes to men or women. Then it elevates the standard of living and adds to the comforts of life. This is the engineer's high privilege.
--Herbert Hoover

Comment

0 Comments

A guide to the science of secrecy

avatar

fortenforge
Archives
Shouts
Submit
  • Good website!

    by bluegoose101, Aug 5, 2021, 6:28 PM

  • uh-huh, a great place here

    by fenchelfen, Sep 1, 2019, 11:30 AM

  • uh, yeah he is o_O

    by SonyWii, Oct 8, 2010, 2:11 PM

  • dude i think you're my roommate from camp :O

    by themorninglighttt, Aug 29, 2010, 10:06 PM

  • what i'm still not a contrib D:

    by SonyWii, Aug 6, 2010, 2:20 PM

  • I see what you did there

    by Jongy, Aug 1, 2010, 11:52 PM

  • omg, apparently you like cryptography; and apparently I'm not a contribb D:

    by SonyWii, Jul 26, 2010, 9:48 PM

  • Thank You

    by fortenforge, Jan 17, 2010, 6:35 PM

  • Wow this is a really cool blog

    by alkjash, Jan 16, 2010, 7:04 PM

  • Hi :)

    by fortenforge, Jan 7, 2010, 12:12 AM

  • Hi :)

    by Richard_Min, Jan 5, 2010, 9:29 PM

  • Hi :) :)

    by fortenforge, Jan 3, 2010, 10:14 PM

  • HELLO FORTENFORGE I AM THE PERSON SITTING NEXT TO YOU IN IDEAMATH

    by ButteredButNotEaten, Dec 24, 2009, 4:19 AM

  • @dragon96 Not if you celebrate Christmas with neon lights
    @batteredbutnotdefeated Sure, You are now a contributer

    by fortenforge, Dec 20, 2009, 4:39 AM

  • I too share a love for cryptography and cryptanalysis, may I be a contrib?

    by batteredbutnotdefeated, Dec 20, 2009, 2:38 AM

  • The green is too bright for Christmas. :P

    by dragon96, Dec 20, 2009, 2:12 AM

  • I thought I'd change the colors for the Holidays :lol:

    by fortenforge, Dec 13, 2009, 10:53 PM

  • hi, some "simple" cryptography here: http://www.artofproblemsolving.com/Forum/weblog_entry.php?t=317795

    by phiReKaLk6781, Dec 12, 2009, 3:46 AM

  • Yeah, that is binary, for modern cryptography, most text is converted to binary first and then algorithm's for encryption are preformed on the binary rather than the English letters. The text is converted using the ASCII table or UNICODE.

    by fortenforge, Oct 13, 2009, 10:33 PM

  • Whoa, I love your background! Is that binary?

    by pianogirl, Oct 13, 2009, 8:34 PM

  • Sure, I'll add you as a contributer...

    by fortenforge, Oct 2, 2009, 4:44 AM

  • May I make a post on one cipher I made up? (It's a good code for science people! *hint hint*)

    by dragon96, Oct 2, 2009, 4:04 AM

  • Nice blog, this is interesting... :lol:

    and guess who i am :ninja:

    by Yoshi, Sep 21, 2009, 4:02 AM

  • Thanks :lol:

    by fortenforge, Sep 17, 2009, 1:33 AM

  • Very interesting blog. Nice!

    by AIME15, Sep 16, 2009, 5:21 PM

  • When you mean 'write' do you mean like programming? Much of cryptography has to do with programming and most modern cryptographers are excellent programmers because modern complex ciphers are difficult to implement by hand.

    See if you can write a program for the substitution cipher. The user should be able to enter the key and the message. I know it is possible to do it in pretty much any language because I was able to do it in c.

    by fortenforge, Aug 7, 2009, 8:17 PM

  • Hello. I don't know much about advanced cryptography but I did write a Caeser Chipher encrypter and decrypter!

    by Poincare, Jul 31, 2009, 8:55 PM

27 shouts
Tags
About Owner
  • Posts: 200
  • Joined: Jan 17, 2009
Blog Stats
  • Blog created: Jun 21, 2009
  • Total entries: 48
  • Total visits: 126826
  • Total comments: 16
Search Blog
a