EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff
Hacker's Home Page

Training Missions

Read Me First
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Captcha Cracking
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom
/dev/extra

Knowledge Bank

Discussion Forums
Exploit Database New
PasteBin New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Downloads
Tools

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Pimp Us Out!

Review enigmagroup.org on alexa.com

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.

Enigma Group

Enigma Group

Enigma Group

Enigma Group

 

Affiliates

hackhound.org

suck-o.com

hack.org.za

flyninja.net

 

Enigma Group's Articles



Return to Category Selection

The Vigenere Cipher - Submitted By: invas10n 2008-08-26 08:15:04
The Vigenere Cipher

The Vigenere Cipher is a mutation on the basic Caeser Cipher. To recap, the Caeser Cipher involves the shifting of the alphabet a specific number of letters left or right to allow a phrase to be re-written using the new alphabet. It is called the "Caeser" Cipher because it was he who used it during the war so that his enemies would not be able to decipher his messages.

An example of the Caeser Cipher:

Old Message:  This is a caeser example.
Alphabet:     abcdefghijklmnopqrstuvwxyz
shift(3):     defghijklmnopqrstuvwxyzabc
New Message:  Wklv lv d fdhvhu hadpsoh

To decipher this, frequency analysis is used.

*Note: I have written a previous text explaining this method of encryption in full detail. Read it.

Now, onto the Vigenere Cipher after that brief introduction. The Vigenere Cipher was developed by Giovan Batista Belaso in 1467, but was only recognized after Blaise de Vigenere mentioned it at the Court of Hentry III in 1586 (something like the calculus story - look it up). It is a ployalphabetic cipher meaning many alphabets are used.

The Vigenere table is as follows:

           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

       A   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
       B   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 A
       C   C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
       D   D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
       E   E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
       F   F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
       G   G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
       H   H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
       I   I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
       J   J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
       K   K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
       L   L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
       M   M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
       N   N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
       O   O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
       P   P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
       Q   Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
       R   R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
       S   S T U V W X Y Z A B C D E F G H I J K L M N O P Q R  
       T   T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
       U   U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
       V   V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
       W   W X Y Z A B C D E F G H I J K L M N O P Q R S T U V
       X   X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
       Y   Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
       Z   Z 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

This table can be viewed as 26 different Caeser Shifts incrementing by one each time. Instead of choosing just one column to encrypt your message with, you choose a keyword that chooses the letter combination for you. Each letter of the keyword is linked to the top row of independant letters. The vertical row of letters on the left relates to the letter in the old message that is busy being encrypted. Where those two vertical and horizontal lines meet, the new letter is selected. Lets see this is practice...

Eg. (keyword is : "paper")
Position:    0 123456 789 012345 6789 012 345 678 90123456 78 90 123456 7890
Keyword:     p aperpa per paperp aper pap erp ape rpaperpa pe rp aperpa perp
Old Message: I praise the monkey head and ask its guidance on my hacker life
New Message: x pgezhe ilv bocovn hteu pns ejz iiw xjiseere dr dn hpgbtr amwt

*note: The format of my message has kept the format the same, i.e if the word is 2 letters long, the encrypted text is 2 letters long. What is quite common to see is a message spaced evenly with a series of 4 or 5 letters. For example, my message re-organized would appear as:

Encrypted Message: xpge zhei lvbo covn hteu pnse jzii wxji seer edrd nhpg btra mwt

The Kasiski Method of Decryption

Wow you might say, thats a complicated cipher and should be unbreakable. And you would be right, until about the 19th century. The man who managed to crack this cipher was Major Friedrich Wilhelm Kasiski. He was a Prussian infantry officer, cryptographer and archeologist. He published the first book on breaking ciphers, but it wasnt so well received so Kasiski focused more on archeology. Only after his death was is work truly recongnized (like so many others we all know).
Kasiski noticed patterns (bigrams) in a Vigenere encrypted cipher. From these he was able to deduct the length of the keyword then using frequency analysis, he could decrypt the message. Sounds easier than it is...Lets give it ago with my example.

First, to find matching bigrams (two letters):

Bigram   Location   Distance   Factors
pg   43      39      1,2,3,6
nh   41      26      1,2,3

Hmmm...this is very interesting. It appears my message does not have any repeating bigrams which produce the correct prime number representing the length of the keyword. Being a relatively short message, the chance of not finding the correct keyword is much much higher. Using the method above, I will demonstrate an example in which the repeating bigrams do equal the keyword length.

The New Message Example:

The keyword used to encode this message is "relations" and the message being encoded is the is the famous line "To be or not to be, that is the question". As can be seen below, the location on each letter of the message has been written down to help with calculating the bigram distances. Below is the new example using conventional spacing of five characters:

Location   01234 56789 01234 56789 01234 56789
Keyword:   relat ionsr elati onsre latio nsrel
Plaintext:    tobeo rnott obeth atist heque stion
Ciphertext:   ksmeh zbblk smemp ogajx sejcs flzsy


Repeated Bigram   Location   Distance   Factors
ks      9      9      3, 9
sm      10      9      3, 9
me      11      9      3, 9

As can be seen from this example, the distance between the keywords is 9. Now, it wont always be the same number, but it will always be a number that has a prime number the same as the length of the keywords. The keyword is 9 characters long, and as you can see, 9 is a common factor of the bigram distances. Normally, the distances will give you a variety of

After the length has been deduced, it is understandable that letters at every nth position is from the same letter in the keyword, and the longer the message, the more letters made with the same character from the keyword. With that information, frequency analysis can be used to work out the most probably letter and with patience, the original message will be deciphered... Thankfully today, you do not need to spend hours deciphering a Vigenere Cipher. Computer programs have been written that do it all for you within seconds. One such application can be experimented on this website: http://sharkysoft.com/misc/vigenere/

The Frequency Analysis Table

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
73 9  30 44 130  28 16 35 74 2   3  35 25 78 74 27 3  77   63 93 27 13 16 5  19 1

This table represents the number of times a letter appears in a common text of 1000 letters. Using this, we can determine which letters that occur the most are.

The Kerckhoff Method of Decryption

Although the Kasiski method is the easiest and most well know method used for an encrypted text using the Vigenere Cipher, another method was developed by a French cryptographer called Kerckhoff. Kerckhoff's method involves oganizing the text into columns and then performing frequency analysis on those columns with the aim of determining the keyword before the text is deciphered, unlike the Kasiski method which deciphers the text first. The Kerckhoff's method is much more time consuming, keeping in mind that there are 26 different possible Caeser Shift that can be performed on each letter, and therefore not regulary used, however, thank you to technology, it has become usable.

Conclusion

And there you have it, the Vigenere Cipher deciphered :) I hope this text has been easy to follow and understand and that it will motivate you in your continuing study of ciphers and how they work. Look out for my next article coming soon about the Gronsfeld Cipher, a variation on the Vigenere Cipher.

Peace. Invas10n
[Ask the Experienced, Not the Learned]

Return to Category Selection
If you wish to submit a comment, you must be a registered member and logged in.

Login or Register.



Return to Category Selection

 

Who Visited EnigmaGroup Today?

1394 Guests, 221 Users (218 Spiders)
junaid_junaid59, Galagatron, tgm001, famous0123, mjneat, Aska, Beat_Slayer, Molinaro, M0rdak, plex, Ausome1, dark_void, Imre, TheCheeseDemon, rockcraft, Vreality2007, mmndglxuwn, m0rt, unholyblood, psychomarine, iterrumzz, VurbTrurb, CJ_Omaha, Mayonoula, MAMWOURBROR, mutabor, gobinda, cossyDrybrich, Razin, zaCruBumas8, hunja, johny34, ssmaslov, pantoufle, bagy, arctica, hackarchives, UsedDeteKef, Peculator, Fadhilat606, TheTrueMonarch, Pascall01, hackaday, Tjm, arndevil, flairvelocity, lol, alphbond, kdivanov, elizbethallis6, Rik, bn11, BorgBot, SHASHANK101hello, 4poc4lyptic, ksajxai, nbmorri1, electro-technic, saraf, شمالي عرعر, lamb, AutobotPrime, Underleaf, The End, tomtombomb, killobyte, snowgirlx, so_saucey, zerolife, Althor, Cramps, Hekser, Hyperborn, cyber-guard, jhgrunn, cobra, Partisan, MAZI_, cyborg, GenbreedX, moel77, cliptoX, pwnpwnlolz, letshavepie, Mrwormz, yshiau, mirmo, roozyoppomo, soft_devil, cls777, scoobywan, Reiversed, joshua, st3alth, Afrika, PaiffDryday, venter, Anthony12796, sh3llcod3, 8FIGURE, Rannim, Evil1, maloaboy, BACanON, SlayingDragons, Repuhlsive, IvanDimitriev, lolzsec, 1RiB, mzungudo, Micro_Geek, iMaxx, aciboummamymn, k0unterkulcher, somebody777, m14m16, GoododotAlcob, negasora, Rastii, UninueMem, JohnJohnJohn, Swifsolja, ad.conquest, ngolatkar, Infinity8, Jigoku, thesupervisor, p0is0n5ting, kernel_mod, AKL, GothicLogic, themastersinner, dnatrixene135, ChewBigRed, kalak55, sejem, cve916, pollolololo, triecturn, Violatedsmurf, Ops, jmp, xsiemich, generalisimo, strudels, Dregoon, ga3ttpom, KingOfBritains, epoch_qwert, suten, FriskyKat, Ryuske, Adonis Achilles, ubqbcdzzhf, 3vil, Nightraven, US£RNAM£, Weindittewcon, Batesheelocot, GSmyrlis, MaxMeier, Elite.America, rabbidmind, Psiber_Syn, phoenix22, imittyerrotte, peewster, cyberturtle, ctb, dexgeda, sdw, Pizza, White_widdow, devarian, finesse, Nature112091777, Danc7171, Alphadragon, Estadagause, 53QR10U5, Xargos, Alkomage, hardlock, Barry Gonzoles, MineDweller, Gkjt, N4g4c3N, [I]nfectedbug, wimsteege, aqr5zdcw, xin214, Bugshuppy, SnoopSky, Hessesian, voodooKobra, sKcarr, IROverRated, W1F1G3NJU75U, Baddy, Patrickk, ziadmosaan, gamble86, realzs, CruelDemon, Shinju, aVoid, aquiredanonymity, kukumumu, web_request, callmeneon, KissMyDAFFODIL, Feld Grau, Abhinav2107, prabhataditya, mbuyiselo, shumer, phenom216, princennamdi, huskyboiza, ninety-nine, lucca65
 
Enigma Group