\documentclass[12pt]{article}
\usepackage[Mickael]{ammaths}

\begin{document}

\module{The Caesar cipher}{03}{09}{1 period}
\en\nocouleur

\prereq{Concepts of cryptography.}

\object{\begin{itemize}
        \item Discover a simple encryption algorithm.
	\item Practise the encryption and decryption processes.
	\end{itemize}}

\mater{\begin{itemize}
	\item Beamer about the Caesar cipher.
	\item Lesson about the Caesar cipher.
	\end{itemize}}

\modpart{How the Caesar cipher works}{15 mins}

The teacher explains, with a beamer, the history of the Caesar cipher and how it works.

\modpart{Coding and decoding a short message}{20 mins}

Each student encodes a simple question that he will send to another student, who will decode the question using the key indicated by the sender, and then send back an encrypted answer.

\modpart{Breaking the code}{20 mins}

Working in pairs, students try to decrypt some message without knowing the key.





\pagebreak

\moddocdis{The Caesar cipher}{03}{09}{Lesson}



According to Suetonius, a historian in the Roman Empire, Julius Caesar used a simple code to preserve the secrecy of
some messages.

\begin{quote}
``If he had anything confidential to say, he wrote it in cipher, that is, by so changing the order of the letters of the
alphabet, that not a word could be made out. If anyone wishes to decipher these, and get at their meaning, he must
substitute the fourth letter of the alphabet, namely D, for A, and so with the others.''
\end{quote}

Any encryption technique in which each letter in the plaintext is replaced by a letter some fixed number of positions
down the alphabet has become known as a \emph{Caesar cipher}.

\begin{center}
\includegraphics[scale=0.25]{images/caesarcipher3.eps}
\end{center}


\sectionblack{An example}

\begin{center}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
v & e & n & i & v & i & d & i & v & i & c & i \\
\hline
Y & H & Q & L & Y & L & G & L & Y & L & F & L \\
\hline
\end{tabular}
\end{center}

\bigskip

\sectionblack{The implementation chain of a cipher}

\newcommand{\cle}{\newrgbcolor{fefefe}{1 1 1}
\newrgbcolor{qrqrqr}{0 0 0}
\psset{xunit=0.1cm,yunit=0.1cm,algebraic=true,dotstyle=*,dotsize=3pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\begin{pspicture*}(0.06,-1.36)(11.64,4.22)
\pspolygon[linecolor=qrqrqr,fillcolor=qrqrqr,fillstyle=solid](4.44,1.82)(4.44,1.2)(11.32,1.2)(11.32,1.82)
\pspolygon[linecolor=qrqrqr,fillcolor=qrqrqr,fillstyle=solid](9.92,1.82)(9.92,0.3)(10.64,0.3)(10.64,1.82)
\pscircle[fillcolor=black,fillstyle=solid](2.46,1.44){0.22}
\pscircle[linecolor=fefefe,fillcolor=fefefe,fillstyle=solid](2.46,1.44){0.16}
\psline(4.44,1.82)(11.32,1.82)
\psline[linecolor=qrqrqr](4.44,1.82)(4.44,1.2)
\psline[linecolor=qrqrqr](11.32,1.2)(11.32,1.82)
\psline[linecolor=qrqrqr](11.32,1.82)(4.44,1.82)
\psline[linecolor=qrqrqr](9.92,1.82)(9.92,0.3)
\psline[linecolor=qrqrqr](9.92,0.3)(10.64,0.3)
\psline[linecolor=qrqrqr](10.64,0.3)(10.64,1.82)
\psline[linecolor=qrqrqr](10.64,1.82)(9.92,1.82)
\end{pspicture*}}

\newcommand{\algo}{
\newrgbcolor{qrqrqr}{0 0 0}
\psset{unit=0.75cm}
\begin{pspicture}(0,0)(1,1)
\pspolygon[linecolor=qrqrqr,fillcolor=qrqrqr,fillstyle=solid](0,0)(0,1)(1,1)(1,0)
\end{pspicture}

}


\begin{center}
\psset{nodesep=3pt}
\begin{tabular}{ccccc}
Sender & & & & Receiver \\[10pt]
\rnode{A}{\fbox{\parbox{1.5cm}{\tiny This is plain text, that anyone could read if it were sent without being encoded.}}} & & & & \rnode{F}{\fbox{\parbox{1.5cm}{\tiny This is plain text, that anyone could read if it were sent without being encoded.}}} \\[5pt]
\small Plaintext & & & &\small  Plaintext  \\[10pt]
 & \rnode{C}{\algo} & \parbox{1.7cm}{\rnode{D}{\fbox{\parbox{1.5cm}{\tiny Wklv lv hq hqfubswhg whaw xquhdgdeoh zlwkrxw iluvw ehlqj ghfubswhg.}}}\vspace{0.5cm}}  & \rnode{E}{\algo} &  \\[5pt]
 & \small Algorithm & \small Ciphertext & \small Algorithm &  \\[10pt]
\rnode{B}{\cle} & & & & \rnode{G}{\cle} \\
\small Key & & & &\small  Key \\[10pt]
\end{tabular}
\ncline{->}{A}{C}
\ncline{->}{B}{C}
\ncline{->}{C}{D}
\ncline{->}{D}{E}
\ncline{->}{E}{F}
\ncline{->}{E}{G}
\end{center}




\end{document}
