\documentclass[10pt,envcountsect]{beamer}

\mode<presentation> {
  \usetheme{Warsaw}
}

\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage{pst-all}
\usepackage{multicol}

\newcommand{\histob}[4]{
\pspolygon[fillstyle=solid,fillcolor=gray](#1,0)(#2,0)(#2,#3)(#1,#3)
\uput[ur](#1,-2){#4}
}

\newcounter{vig}
\newcommand{\vig}{\stepcounter{vig}\Alph{vig}}
\newcommand{\resetvig}[1]{\setcounter{vig}{#1}}


\begin{document}

\title{Session 14 -- The Vigenère cipher}
\subtitle{European section -- Season 03}
\date{}

\begin{frame}
  \titlepage
\end{frame}


\begin{frame}{A cipher text}

\scriptsize
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
RBVRC MUTC


\end{frame}

\begin{frame}{Standard frequencis in English}

\begin{center}

\bigskip


\psset{xunit=0.35cm,yunit=0.3cm}
\begin{pspicture}(-2,-2)(27,14)
\psaxes[Dy=2](0,0)(0.1,14)
\psline(0,0)(27,0)
\histob{0}{1}{8.2}{a}
\histob{1}{2}{1.5}{b}
\histob{2}{3}{2.8}{c}
\histob{3}{4}{4.3}{d}
\histob{4}{5}{12.7}{e}
\histob{5}{6}{2.2}{f}
\histob{6}{7}{2.0}{g}
\histob{7}{8}{6.1}{h}
\histob{8}{9}{7.0}{i}
\histob{9}{10}{0.2}{j}
\histob{10}{11}{0.8}{k}
\histob{11}{12}{4.0}{l}
\histob{12}{13}{2.4}{m}
\histob{13}{14}{6.7}{n}
\histob{14}{15}{7.5}{o}
\histob{15}{16}{1.9}{p}
\histob{16}{17}{0.1}{q}
\histob{17}{18}{6.0}{r}
\histob{18}{19}{6.3}{s}
\histob{19}{20}{9.1}{t}
\histob{20}{21}{2.8}{u}
\histob{21}{22}{1.0}{v}
\histob{22}{23}{2.4}{w}
\histob{23}{24}{0.2}{x}
\histob{24}{25}{2.0}{y}
\histob{25}{26}{0.1}{z}
\end{pspicture}
\end{center}

\end{frame}


\begin{frame}{Frequencies in the cipher}


\begin{center}
\psset{xunit=0.35cm,yunit=0.3cm}
\begin{pspicture}(-2,-2)(27,14)
\psaxes[Dy=2](0,0)(0.1,14)
\psline(0,0)(27,0)
\histob{0}{1}{1.3}{A}
\histob{1}{2}{3.7}{B}
\histob{2}{3}{7.3}{C}
\histob{3}{4}{4.2}{D}
\histob{4}{5}{3.2}{E}
\histob{5}{6}{3.8}{F}
\histob{6}{7}{5.1}{G}
\histob{7}{8}{3.1}{H}
\histob{8}{9}{2.7}{I}
\histob{9}{10}{2.8}{J}
\histob{10}{11}{3.3}{K}
\histob{11}{12}{4.6}{L}
\histob{12}{13}{3.2}{M}
\histob{13}{14}{5.5}{N}
\histob{14}{15}{3.4}{O}
\histob{15}{16}{5.1}{P}
\histob{16}{17}{3.5}{Q}
\histob{17}{18}{3.8}{R}
\histob{18}{19}{3.9}{S}
\histob{19}{20}{2.6}{T}
\histob{20}{21}{4.1}{U}
\histob{21}{22}{3.0}{V}
\histob{22}{23}{2.3}{W}
\histob{23}{24}{3.6}{X}
\histob{24}{25}{8.0}{Y}
\histob{25}{26}{2.8}{Z}
\end{pspicture}

\end{center}

\end{frame}

\begin{frame}{What we notice}

\Large
\pause
\begin{itemize}
\item No frequency less than 1.3\%.\pause
\item No frequency more than 10\%.\pause
\item C and Y could stand for e, but just as well for a, h, i, m, o, r, s, t.\pause
\item The global shape of the histogram.
\end{itemize}

\end{frame}

\begin{frame}{What we can conclude}

\Large

\begin{itemize}
\item Not in English ? But,\pause
	\begin{itemize} \Large
	\item we know it's in English ;\pause
	\item no language has such standard letter frequency histogram.\pause
	\end{itemize}
\item Not a simple Caesar Cipher.\pause
\item Not a monoalphabetic substitution cipher.\pause
\item Frequency analysis is not enough.
\end{itemize}


\end{frame}

\begin{frame}{Blaise de Vigenère (1523 -- 1596)}

\begin{center}
\includegraphics[scale=1.2]{images/vigenere.eps}
\end{center}
\end{frame}

\begin{frame}{La cifra del Sig. Giovan Battista Belaso -- Venetia 1553}

\begin{center}
\includegraphics[scale=0.35]{images/bellaso.eps}
\end{center}
\end{frame}

\begin{frame}{The tabula recta}

\begin{center}
\includegraphics[scale=0.3]{images/vigeneresquare.eps}
\end{center}


\end{frame}

\begin{frame}{How to encipher a message}

\huge

\begin{center}
\begin{tabular}{cccccccccc}
t&h&e&w&o&r&l&d&i&s\\
R&A&D&I&O&R&A&D&I&O\\
.&.&.&.&.&.&.&.&.&.\\
\end{tabular}

\bigskip

\begin{tabular}{ccccccccc}
a&f&l&a&t&d&i&s&c\\
R&A&D&I&O&R&A&D&I\\
.&.&.&.&.&.&.&.&.\\
\end{tabular}
\end{center}

\end{frame}

\begin{frame}{How to encipher a message}

\huge

\begin{center}
\begin{tabular}{cccccccccc}
t&h&e&w&o&r&l&d&i&s\\
R&A&D&I&O&R&A&D&I&O\\
\red K&.&.&.&.&.&.&.&.&.\\
\end{tabular}

\bigskip

\begin{tabular}{ccccccccc}
a&f&l&a&t&d&i&s&c\\
R&A&D&I&O&R&A&D&I\\
.&.&.&.&.&.&.&.&.\\
\end{tabular}
\end{center}

\end{frame}

\begin{frame}{How to encipher a message}

\huge

\begin{center}
\begin{tabular}{cccccccccc}
t&h&e&w&o&r&l&d&i&s\\
R&A&D&I&O&R&A&D&I&O\\
\red K&\red H&.&.&.&.&.&.&.&.\\
\end{tabular}

\bigskip

\begin{tabular}{ccccccccc}
a&f&l&a&t&d&i&s&c\\
R&A&D&I&O&R&A&D&I\\
.&.&.&.&.&.&.&.&.\\
\end{tabular}
\end{center}

\end{frame}




\begin{frame}{How to encipher a message}

\huge

\begin{center}
\begin{tabular}{cccccccccc}
t&h&e&w&o&r&l&d&i&s\\
R&A&D&I&O&R&A&D&I&O\\
\red K&\red H&\red H&\red E&\red C&\red I&\red L&\red G&\red Q&\red G\\
\end{tabular}

\bigskip

\begin{tabular}{ccccccccc}
a&f&l&a&t&d&i&s&c\\
R&A&D&I&O&R&A&D&I\\
\red R&\red F&\red O&\red I&\red H&\red U&\red I&\red V&\red S\\
\end{tabular}

\end{center}

\end{frame}

\begin{frame}{How to decipher a message}

\huge

\begin{center}
\begin{tabular}{cccccccccc}
K&H&H&E&C&I&L&G&Q&G\\
R&A&D&I&O&R&A&D&I&O\\
.&.&.&.&.&.&.&.&.&.\\
\end{tabular}

\bigskip

\begin{tabular}{ccccccccc}
R&F&O&I&H&U&I&V&S\\
R&A&D&I&O&R&A&D&I\\
.&.&.&.&.&.&.&.&.\\
\end{tabular}

\end{center}

\end{frame}

\begin{frame}{How to decipher a message}

\huge

\begin{center}
\begin{tabular}{cccccccccc}
K&H&H&E&C&I&L&G&Q&G\\
R&A&D&I&O&R&A&D&I&O\\
\green t&.&.&.&.&.&.&.&.&.\\
\end{tabular}

\bigskip

\begin{tabular}{ccccccccc}
R&F&O&I&H&U&I&V&S\\
R&A&D&I&O&R&A&D&I\\
.&.&.&.&.&.&.&.&.\\
\end{tabular}

\end{center}

\end{frame}

\begin{frame}{How to decipher a message}

\huge

\begin{center}
\begin{tabular}{cccccccccc}
K&H&H&E&C&I&L&G&Q&G\\
R&A&D&I&O&R&A&D&I&O\\
\green t&\green h&.&.&.&.&.&.&.&.\\
\end{tabular}

\bigskip

\begin{tabular}{ccccccccc}
R&F&O&I&H&U&I&V&S\\
R&A&D&I&O&R&A&D&I\\
.&.&.&.&.&.&.&.&.\\
\end{tabular}

\end{center}

\end{frame}

\begin{frame}{How to decipher a message}

\huge

\begin{center}

\begin{tabular}{cccccccccc}
K&H&H&E&C&I&L&G&Q&G\\
R&A&D&I&O&R&A&D&I&O\\
\green t&\green h&\green e&\green w&\green o&\green r&\green l&\green d&\green i&\green s\\
\end{tabular}

\bigskip

\begin{tabular}{ccccccccc}
R&F&O&I&H&U&I&V&S\\
R&A&D&I&O&R&A&D&I\\
\green a&\green f&\green l&\green a&\green t&\green d&\green i&\green s&\green c\\
\end{tabular}

\end{center}

\end{frame}

\begin{frame}{Your task}

\Huge

\begin{center}
Encode and decode a quote about mathematics
\end{center}


\end{frame}




\end{document}
