Sie sind auf Seite 1von 9

23/03/2009

Vigenre cipher
Polyalphabetic substitution

Cryptanalisis of Vigenre cipher


The idea behind Vigenres cipher, similarly to other polyalphabetic ciphers, is to disguise plaintext letter frequencies, which interferes with a straightforward application of frequency analysis. For instance, if W is the most frequent letter in a ciphertext whose plaintext is in English, one might suspect that W corresponds to E, because E is the most frequently used letter in English. However, with the Vigenre cipher, E can be encrypted with different ciphertext letters in different points in the message, thus making simple frequency analysis difficult.

Vigenre cipher
Strength of Vigenres cipher hinges on the secrecy of its key length. Indeed, if one guesses correctly the length of the key, then ciphertext can be viewed as produced by interwoven Caesar ciphers (each of which can be easily broken!) Thus, one possible weakness of Vigenres cipher is the repeating nature of its key. The Kasiski test or Ciphertext autocorrelation can help to determine the key length.

23/03/2009

Vigenre cipher
1. Kasiski test
Take advantage of the fact that certain common words like "the" will, by chance, be encrypted using the same key letters, leading to repetitions in the ciphertext. Example. A message encoded with key ABCDEF might not encrypt the word "crypto" the same way each time "crypto" appears in the plaintext: Key: Plaintext: Ciphertext: ABCDEF AB CDEFA BCD EFABCDEFABCD CRYPTO IS SHORT FOR CRYPTOGRAPHY CSASXT IT UKSWT GQU GWYQVRKWAQJB

Vigenre cipher
Kasiski test
Example. The same message encrypted ABCD results in: Key: ABCDAB CD ABCDA BCD Plaintext: CRYPTO IS SHORT FOR Ciphertext: CSASTP KV SIQUT GQU with the keyword ABCDABCDABCD CRYPTOGRAPHY CSASTPIUAQJB

Notes. 1. Shorter keys help the test. 2. Longer messages help the test (corresponding ciphertext usually contains more repetitions)

Vigenre cipher
Kasiski test
Ciphertext: DYDUXRMHTVDVNQDQNWDYDUXRMHARTJGWNQD
18 20

Repetition at distance 18: key length could be {1,2,3,6,9,18} Repetition at distance 20: key length could be {1,2,4,5,10,20} Taking the intersection of these sets, one could argue that the key length is probably 2 (why not 1?)

23/03/2009

Vigenre cipher
Ciphertext autocorrelation
Key length is calculated using autocorrelation. Since not every character occurs equally often in natural language, the probability of two identical characters occurring is relatively large if they are separated by a multiple of the key length. Therefore, autocorrelation analysis shows a typical comb pattern, where individual teeths are separated by exactly the length of the key.

Vigenre cipher
Ciphertext autocorrelation

Average teeth-distance: 8 Guessed key length: 8

Vigenre cipher
Frequency analysis
Once key length x is known, ciphertext can be rewritten into x columns, where each column corresponds to one single letter of the key. Each column consists of plaintext encrypted with one single Caesar cipher; the Caesar key (shift) is just the letter of the Vigenre key used for that column. To break Vigenre, now it is enough to apply methods used to break Caesar cipher.

23/03/2009

Vigenre cipher
Frequency analysis
K1 O Z K2 P Z K3 K K K4 Z G K5 V V K6 K T K7 V Y K8 R I Caesar(K1) Caesar(K2) Caesar(K3) Caesar(K4) Caesar(K5) Caesar(K6) Caesar(K7) Caesar(K8)

Esercizio 1
WUMOGIZWYRMHMCESSVLPISCLLGUILEYMVNGER QLLGAIQGEZKZALQUTKTAZEYHUWRLMZWXCHUWR LMSZLBSQWCBMZIXCRFWWYWOQLALQATYYZXZGR PQDAVQBZALQBTMJRZLSRBWOGZUVZEEYJLOYQAEY GTQLKIDMDRMEKLPRMMAGYXIESEATLKMMTZNVQ VZLXUALJZQZLLRABCMTBQDMRAQESSUXPAGMBTR VAVNFMEKLZVUMCYQUAPAGTQGSSFQDNEGZLAGT QTMIFMNMPYIWYGUWEMPMMNMPYIWYXMHKY WHMRJMMXCGQMKSCWUIRGSDVZMKZQTQXMVEC YZCZKSYCZPIAOYGMEBLLXQCYSSYWYYWOM

Esercizio 1
WUMOGIZWYRMHMCESSVLPISCLLGUILEYMVNGER QLLGAIQGEZKZALQUTKTAZEYHUWRLMZWXCHUWR LMSZLBSQWCBMZIXCRFWWYWOQLALQATYYZXZGR PQDAVQBZALQBTMJRZLSRBWOGZUVZEEYJLOYQAEY GTQLKIDMDRMEKLPRMMAGYXIESEATLKMMTZNVQ VZLXUALJZQZLLRABCMTBQDMRAQESSUXPAGMBTR VAVNFMEKLZVUMCYQUAPAGTQGSSFQDNEGZLAGT QTMIFMNMPYIWYGUWEMPMMNMPYIWYXMHKY WHMRJMMXCGQMKSCWUIRGSDVZMKZQTQXMVEC YZCZKSYCZPIAOYGMEBLLXQCYSSYWYYWOM

23/03/2009

Esercizio 1
Kasiski test
HUWRLM si ripete a distanza 10: key length in {2,5,10} AGTQ si ripete a distanza 15: key length in {3,5,15} MNMPYIWI si ripete a distanza 15: key length in {3,5,15} Probabile lunghezza della chiave 5.

K1 K2 K3 K4 K5

W U I Z M H S S I S G U Y M

M O W Y M C V L C L I L V N

G R E P L E G

Crittanalisi di: WIMSIGY.... : Caesar cipher shift K1 UZHSSUM.... : Caesar cipher shift K2 MWMVCIV.... : Caesar cipher shift K3 OYCLLLN.... : Caesar cipher shift K4 GREPLEG.... : Caesar cipher shift K5

Caesar cipher shift K1 = E


Cifr. A B C D E F G H I # ----5 -7 2 5 Ital. A B C D E F G H I % 11.7 0.9 4.5 3.7 11.8 1.0 1.6 1.5 11.3 Cifr. J K L M N O P Q R # 1 1 3 9 --3 2 6 Ital. J K L M N O P Q R % --6.5 2.5 6.9 9.8 3.8 0.5 6.4 Cifr. S T U V W X Y Z # 7 2 -4 5 4 5 2 Ital. S T U V W X Y Z % 5.0 5.6 3.0 2.1 ---0.5

23/03/2009

Caesar cipher shift K2 = M


Cifr. A B C D E F G H I # 7 2 -2 3 3 1 2 -Ital. A B C D E F G H I % 11.7 0.9 4.5 3.7 11.8 1.0 1.6 1.5 11.3 Cifr. J K L M N O P Q R # ---9 -2 1 9 2 Ital. J K L M N O P Q R % --6.5 2.5 6.9 9.8 3.8 0.5 6.4 Cifr. S T U V W X Y Z # 3 3 11 --1 4 6 Ital. S T U V W X Y Z % 5.0 5.6 3.0 2.1 ---0.5

Esercizio 1
Completare per esercizio: 1. Procedendo nello stesso modo con K3, K4 e K5 otteniamo la chiave EM... 2. Decifrando il testo con la chiave otteniamo ...

Esercizio 2
OPK ZVKVRZZK GVTYIM QY E ZIKLJL UJ RRTVTXZMAK RPKPGFRXZG OMDX OC LWDVM E FIIMZA UJ QMWJZZKRG GRINIX GVTYIMA HEFIU SI BNI YIKXZZY SS E BITEUVQ. MK MN I YMZTCI AWXQ BJ GSGGGPCLRFZBOG FYSWOQZYGMFR. OPK ZVKVRMM IMCLVV CIY FRIE VZQTZRRKIY UGRL XZQZA. ZLR QVXCWJ ANW FVDOORNPCC YMYGEMSIY JE KVSMEI JGXGMJXV JKPYEJS DV NMF 1553 FFSF TG GVJIE YMR. WVK. XMJDGR OEKXDAZE OICPVAU; LBAVZZZ, ZLR WTLZUK ANW CEOMX QVWRXOZOFHXVH OW HPNMJI YM BMTIEIMM OR GLV 19XC KKRGYIC, VVJ MF RFA RQJIYC BRJET EF XYI QQMIAIII XQVLRV. KLDA IMCLVV DA CIYP BRJET FRGRYNM CLVPV MO QY INWP XJ CTHRVJXVVJ EAH ZQKTKQRRK, MO WLXRR RTKMGVF XF FZOORAIIW OW HI HRSVZIQEOPV; XCQY INVEIY QZ XUI UINKXMCXZSI TK GUMWJMM ORQITLDNLVNFCI, AZKRPL WSM BNI HRSVZIQEOPV GDXNIE. GFRNMWYRRKPT, UGRL TVSKTK LNZV XMQKH GS ZQKTKQRRK IIKXCCXZSI AILRQVW OPGX NVV INAKRGMRPGG BMTIEIMM IMCLVVN, WTPL XF LVDK XUID FMWQIA.

23/03/2009

Vigenre cipher
Ciphertext autocorrelation

Average teeth-distance: 8 Guessed key length: 8

Vigenre cipher
Frequency analysis
K1 O Z K2 P Z K3 K K K4 Z G K5 V V K6 K T K7 V Y K8 R I Caesar(K1) Caesar(K2) Caesar(K3) Caesar(K4) Caesar(K5) Caesar(K6) Caesar(K7) Caesar(K8)

Vigenre cipher
Frequency analysis
Natural Language
E most frequent letter in English

23/03/2009

Vigenre cipher
Frequency analysis
1st cyphertext column

Vigenre cipher
Frequency analysis
1st cyphertext column correlation

Max correlation for letter V 1st key char: V

Vigenre cipher
Frequency analysis
2nd cyphertext column

23/03/2009

Vigenre cipher
Frequency analysis
2nd cyphertext column correlation

Max correlation for letter I 2nd key char: I

Vigenre cipher
Cyphertext decrypted with VIGENERE as key:
THE VIGENRE CIPHER IS A METHOD OF ENCRYPTING ALPHABETIC TEXT BY USING A SERIES OF DIFFERENT CAESAR CIPHERS BASED ON THE LETTERS OF A KEYWORD. IT IS A SIMPLE FORM OF POLYALPHABETIC SUBSTITUTION. THE VIGENRE CIPHER HAS BEEN REINVENTED MANY TIMES. THE METHOD WAS ORIGINALLY DESCRIBED BY GIOVAN BATTISTA BELLASO IN HIS 1553 BOOK LA CIFRA DEL. SIG. GIOVAN BATTISTA BELLASO; HOWEVER, THE SCHEME WAS LATER MISATTRIBUTED TO BLAISE DE VIGENRE IN THE 19TH CENTURY, AND IS NOW WIDELY KNOWN AS THE "VIGENRE CIPHER". THIS CIPHER IS WELL KNOWN BECAUSE WHILE IT IS EASY TO UNDERSTAND AND IMPLEMENT, IT OFTEN APPEARS TO BEGINNERS TO BE UNBREAKABLE; THIS EARNED IT THE DESCRIPTION LE CHIFFRE INDCHIFFRABLE (FRENCH FOR 'THE UNBREAKABLE CIPHER'). CONSEQUENTLY, MANY PEOPLE HAVE TRIED TO IMPLEMENT ENCRYPTION SCHEMES THAT ARE ESSENTIALLY VIGENRE CIPHERS, ONLY TO HAVE THEM BROKEN.

Das könnte Ihnen auch gefallen