The Vigenère cipher
Season 03
Episode 14
Time frame 1 period
Prerequisites :
Whatisamonoalphabetiipherandhowtodeipherit.Objectives :
•
Introdue astronger, polyalphabeti,ipher.•
See the problem itinvolvesfor deryption.Materials :
•
Text iphered with a Vigenère square, alongwith its frequeny analysis.•
Lesson.•
Tabula reta.•
Sentenes toenipher.•
Beamer.1 – A new cipher text 20 min
A ipher textis shown tothe lass, along with itsfrequeny analysis.The problems that
thisipherpresentsarehighlighted,mainlythefatthatfrequenyanalysisisnotworking.
2 – The Vigenère cipher 20 mins
The Vigenère square is desribed and aexample is shown.
3 – Enciphering and deciphering 20 mins
Eah student piks up a sentene and hoses a key word toenipher it. It isthen sent to
someone else inthe lass, along withthe key, tobedeiphered.
4 – Can you break it ? 15 mins
Brainstormingsession : howto break the Vigenère ipher?
The Vigenère cipher
Season 03
Episode 14
Document Cipher
The ipher
EBGIQ LSVRY ENJON CIUZC NNQPZ PCPQF LHIOB THVRC
XITXG YAEYL NYPDP LNGCY XUPCK THFGM YXGBD FFNIS
YZQBR FHCDC WSYRY ENJOK THFSL PPKDY MFAMM YWGXR
CUVOQ ZHKCR SUVSL EBGWM CHKXE TNYSJ WVGSL LVQNW
EBCDG DAQSL RNQLC SUPQC ONJOK LHIYG YAVYZ PBCXE
PXJKB MYGXL LGGNK ZCUDT ZHNSN HCILW OIVSL RCHEL
HCUON LLGXR DVWDF PQCCL ZNIYG YAVYC XVCBP LMUDF
PHCWC THUYD LLCCR SUVGY DMVSJ WJQCQ TVNOZ JVGSL
RBWXE FHFOP TNVYR SYYYP WXKXE PHGBY WUPNN LLVSA
FFCBJ JIPDF LNDSR ZZKDI YIYXY DNJOB PUVRU LLTKL
EBGGY DUNPP PXUZY YANOP LHFRC EIQUY XITON ZMKDG
GYCZN CICMF EIVRC DCVEY ECQXY YXJKB NIPMC YNTKR
PXJSQ XCPNM YNJON CIUZC NNQPL ZNDOG YAJKL RYFSL
EBGWM CHKXE LHFWM DNRKP ECEEJ LLNIM YNJON CIUZC
NNQPP PGQFG YACVJ EBGMP FGDVG YAOYP EUTPP ZGCBM
FHFKQ EIPOG YBKCA PFNGY WFYSR SUUZM ZHUYD LLVRC
HITUF LXVKI PHJSK QCXOU PYMCY YXTOB FWGNR SYUZM
ZHVYQ ZGGDF THIVG VYCXY TFHSJ PZQBR FHCDC WSPYM
YYGFC CWCWC EIERY YAGDF PVGNB THIRC CYQBC WMGDF
PSYYS WXJKT PXKCA ZPGBC ONJOU ZLNNQ SYCFG PMVWY
ENTOQ DCVGY DUNKP RYCXB SYCFW DNQXC EBCDU LMEEP
CYPDJ JNJOM MDGMR ZZJSQ LNVOL ECQXQ LHFKR DIOON
ZCPDY SOIOQ EURVC SUFLC PHJKK XYTOB THVYG EUUKL
LHERM CZQBK LHCMJ PMOYG DNUKR OIYXD LWKXE EBGGY
WFIBG AJGNR SYKBM YLKXE THDYR SBCXB DVTKA PXJSQ
WYICY RUKXQ ENJOQ EIPOQ ZHGSR SYTCG OYCXB SYCFC
OBKCQ SIWVB PLUMY FAJDD TLGKL OUTOB XCUDD TFNOB
SCUFG DCQXZ FNVRC MFQMI DFKNM FNYSR SUHKG YNCXB
THCZN CIRBG LNGDG YENSL RHQSQ PGQSQ EGCXY RYFDM
PUUOG EUYKW QLQWR SYJYJ PUPNN PYTOB THUSB PUVDF
PZCBC YXYKQ LHQDF PLDVM NECXB EBGWM CNCBY CIWXB
TNNYM VYFCS DJKMG ZOUVW DNTYL RUPND CYURH FMVSL
QLQXR ZZKDU LMCXC HMRYM YCVGY DMJSL JUURC DNWNG
PXKDF PBGKP ONJOA WURZG YADOF THFRG XBGDS CHGNF
TMJOY ONGXB ZHUDU LHISL RUNSR EFGBG QZQPY RIPIY
YXUKU DYXOP LFQPR SYYKP OYPCU LNERG YAJSK EBTYS
Letter frequenies
Standard frequenies inEnglish
0 2 4 6 8 10 12 14
a b de f g
hi j
kl m no pq
r s t uv wx y
z
Frequenies inthe ipher
0 2 4 6 8 10 12 14
ABCDEFGHI J KLMNOP Q
RSTUVWXYZ
Analysis
What we notie
•
Noletterhasafrequenylessthan1.3%,whihisinonsistantwiththeletterfrequenies in English.•
Noletterhasafrequeny morethan10%,sothere'snoobviousandidatefore.Itouldbe C' or Y, but these two letters ould justas wellbea, h,i, m,o, r,s, t.
•
The histogramdoesn't lookat alllikethe standard histogram.What we an onlude
•
The languageused ould be something else then English, but⋄
we knowthat the originaltext wasin English;⋄
nolanguagehas suh standard letter frequeny histogram.•
It's obviously not asimple Caesar Cipher.•
It doesn't seem to be amonoalphabetisubstitution ipher.•
A simple frequeny analysis is not enough tobreak it.The Vigenère cipher
Season 03
Episode 14
Document Lesson
History and onept
TheVigenèreipherwasrstdesribedbyGiovanBattistaBellasoinabookpublished
in1553.It isalsoknown asLeChire Indéhirable,asitseemedforalongtime thatit
wasunbreakable.In the 19thentury, itwas mistakenlyattributedtoBlaisede Vigenère,
a Frenh diplomatandryptographer fromthe 16th entury.Vigenère did not inventthe
so-alled Vigenèreipher, but he did devise astronger autokey based onthe same table.
Messages are enrypted with the help of a tabula reta, also alled Vigenère square,
or Vigenèretable. It onsistsof the alphabetwritten out 26times indierent rows, eah
alphabetshifted ylially to the left ompared to the previous alphabet, orresponding
to the 26possible Caesariphers.
How to enipher a message
Atdierentpointsintheenryption proess, theipheruses adierentalphabetfrom
one of the rows. The alphabetused ateah point depends ona repeatingkeyword.
Plain text : The world is aat disk. Code word : RADIO
Enryption proess :
•
The rst letter is enipheredusing the lineof the letter R :t is oded into K.•
Forthe seondletter, we use the line of the letter A :h is oded intoH.•
Forthe thirdletter, we use the lineof the letter D : eis oded intoH.•
Forthe fourth letter,weuse the lineof the letter I : w isoded intoE.•
Forthe fthletter, we use the line ofthe letter O: ois oded into C.•
Forthe sixthletter, we use the lineof the letterR : r isoded intoI.•
Forthe seventh letter,we use the lineof the letter A : lis oded into L.•
Andso on...It'sinterestingtonotiethattheletters handehave bothbeenenipheredintoH!So
the most ommon letter in English has been eniphered with the same letter as another
one, muh less ommon. On another hand, another e in the text may not be eniphered
intoH.
Spaesandpuntuationmarks arenormallynotonsidered beforeenryption,andthe
plain text may be given ingroups of 5 letters,to make deryption even harder, aswords
of one or two letters are easy tospot inEnglish.
Belowis apratial way to present this proess, with the ipher textin the lastrow.
t h e w o r l d i s a f l a t d i s
R A D I O R A D I O R A D I O R A D I
K H H E C I L G Q G R F O I H U I V S
How to deipher a message
To deipher a message enrypted with this method,you need to know the key. Write
down the enrypted message and, below, repeat the key word as many times as needed.
Inathirdrow, wewillwritehedeipheredmessage. Thetableisthesameastheoneused
for enryption, but upside down.
K H H E C I L G Q G R F O I H U I V S
R A D I O R A D I O R A D I O R A D I
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
To deode the rst letter, look up in the tabula reta the letter K in the rowR. You
nd the letter t. For the seond letter, look up the letter H in the row A. You nd the
letter h, and soon.
Season 03 • Episode 14 • The Vigenère cipher
5A mathematial view
The Vigenère ipher an be implemented easily using numbers instead of letters and
modular arithmeti.
In modular arithmeti, we only onsider positive integers strily lower than a given
number, alled the modulus. For example, if the modulus is 26, we will only use the
integers from 0 to 25. Any whole number
n
is ongruent to one of these integers : the remainder of the division ofn
by the modulus. For example, if we divide 47 by 26, the remainder is 21,as47 = 1 × 26 + 21
. Wesay that 47and 21 are ongruent, and write47 ≡ 21 [26] .
Eahletteris assoiatedtoatwo-digitnumber:00toA,01toBand soonuntil25to
Z,This orrespondane lets ustransformany messageintoastringof two-digit numbers.
t h e w o r l d i s a f l a t d i s
19 07 04 22 14 17 11 03 08 18 00 05 11 00 19 03 08 18 10
The key is alsowrittenas astring of numbers : RADIO beomes 1700 0308 14.
To enipher the message, write the numerial version in atable and, in aseond row,
write down the numerial key repeatedly, as we did previously with the alphabetial
messages. Then, is a third row, simply add the numbers in eah olumn, reduing the
results modulo 26.
19 07 04 22 14 17 11 03 08 18 00 05 11 00 19 03 08 18 10
17 00 03 08 14 17 00 03 08 14 17 00 03 08 14 17 00 03 08
10 07 07 04 02 08 11 06 16 06 17 05 14 08 07 20 08 21 18
The numerial enypted message ouldthen beturned bak intoanalphabetialone,
but it's useless.Sending anumerialmessageis just asseure as analphabetial one.
Advantages and drawbaks
T
he so-alled Vigenère ipheroered ahigherlevelof serey thanthe monoal-
phabetiiphers.Itwasonsideredunbreakableforafewenturies,asstraightforward
frequeny analysis didn't work on it. Still, it was never widely used beause it was too
time-onsuming toimplement.When alotofmessages had tobesent inashorttime, for
example duringawar,armies ouldnot aord the timeneeded toenipher anddeipher.
The Vigenère ipher was in fat broken by some ryptanalists as soon as in the 16th
entury.Around 1830,CharlesBabbage broketheso-alledVigenèreipheraswellasthe
stronger auto-key ipher atually devised by Vigenère. As his disovery was kept seret
by the British government, itwas mistakenly attributed to Friedrih Kasiski, a Prussian
infantryoer, who made the same disovery some years afterBabbage.
It still took a large amount of time, intuition and luk to break it, so it was still
a quite seure system. With the advent of omputers, breaking a Vigenère ipher has
beomemuheasierandquiker. It'sinterestingtonote thatCharlesBabbage, oneofthe
rst to break the Vigenèreipher, also introdued the main onepts that would lead to
omputers.
Animportantweaknessofthisipheristherepetitionofthekey.Thisreatesaperiodi
use of the same monoalphabeti ipher. A soon as the length of the key is known, the
iphertextan bedivided aordingtothe period,and eahgroupof letterstreatedwith
The real Vigenère auto-key ipher
V
igenère didn't invent the ipher that bears his name,but he did devise a
stronger one, with no repetition of the key, and therefore no periodiity in the en-
ryptement, making itreally immuneto frequeny analysis.
The trik is to use the key only to enrypt the rst few letters of the message, and
then to use the message itself,hene the name auto-key.
Usingthesameexampleasbefore,wewillenrypttherst velettersusingthe letters
of the key RADIO, and will then use the letters of the message itself, as shown in the
followingtable :
t h e w o r l d i s a f l a t d i s
R A D I O T H E W O R L D I S A F L A
K H H E C K S H E G R O O I L D N D C
Toderypt theiphermessage, wemust rstuse thelettersof thekey. Whenwereah
the end ofthe key,we usethe the lettersof theplain text, inthe same orderasthey were
derypted.
Th e V ig e n è re c ip h e r S e a so n 0 3 E p is o d e 1 4 D o c u m e n t Ta b u la re c ta
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
Document 1
Sentenes toenipherA mathematiian is a mahine for turning oee into theorems.
(Paul Erdös)
Perfet numbers like perfet men are very rare. (René Desartes)
Mathematiians are born, not made. (Henri Poinaré)
It is impossible to be a mathematiian without being a poet in soul.
(Soa Kovalevskaya)
The searh for truth is more preious than its possession. (Albert Einstein)
If there is a God, he's a great mathematiian. (Paul Dira)
Math is like love a simple idea but it an get ompliated. (R. Drabek)
God made the integers; all the rest is the work of man.
(Leopold Kroneker)
There are three types of people in this world : Those who an ount, and
those who an't. (Anonymous)
The essene of mathematis is not to make simple things ompliated, but
to make ompliated things simple. (S. Gudder)
The human mind has never invented a labor-saving mahine
equal to algebra. (Anonymous)
Go down deep enough into anything and you will nd mathematis.
Season 03 • Episode 14 • The Vigenère cipher
9Mathematis is as muh an aspet of ulture as it is a olletion of
algorithms. (Carl Boyer)
Musi is the pleasure the human mind experienes from ounting without
being aware that it is ounting. (Gottfried Leibniz)
Mathematis is the supreme judge; from its deisions there is no appeal.
(Tobias Dantzig)
I used to love mathematis for its own sake, and I still do, beause it allows
for no hyporisy and no vagueness. (Stendhal)
If there is a God, he's a great mathematiian. (Paul Dira)
Philosophy is a game with objetives and no rules. Mathematis is a game
with rules and no objetives. (Anonymous)
Mathematis onsists in proving the most obvious thing
in the least obvious way. (George Polya)
Obvious is the most dangerous word in mathematis. (E.T. Bell)
Arithmeti is being able to ount up to twenty
without taking o your shoes. (Mikey Mouse)
I have hardly ever known a mathematiian who was apable of reasoning.
(Plato)
You know we all beame mathematiians for the same reason :
we were lazy. (Max Rosenliht)
These days, even the most pure and abstrat mathematis
is in danger to be applied. (Anonymous)
What is a rigorous denition of rigor? (Anonymous)
Only two things are innite, the universe and human stupidity, and I'm not
sure about the former. (Albert Einstein)
There are 10 kinds of people in the world, those who understand binary
math, and those who don't. (Anonymous)
Statistis : the mathematial theory of ignorane. (Morris Kline)
Most people use statistis the way a drunk uses a lamp post, more for
support than enlightenment. (Anonymous)
Geometry is the siene of orret reasoning on inorret gures.
(George Polya)
Without geometry life is pointless. (Anonymous)
Inspiration is needed in geometry, just as muh as in poetry.
(Aleksandr Pushkin)
Calulus has its limits. (Anonymous)
Mathematis is the siene whih uses easy words for hard ideas.
(Anonymous)
A mathematiian who is not also a poet will never be
a omplete mathematiian. (Karl Weierstrass)