From 34a3c16f0357851cbb61abdd050194bc1a952045 Mon Sep 17 00:00:00 2001
From: mdw <mdw>
Date: Wed, 30 Jan 2002 09:57:35 +0000
Subject: [PATCH] Encryption mode diagrams.

---
 enc-symm.tex | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/enc-symm.tex b/enc-symm.tex
index 18a05c6..6434b4f 100644
--- a/enc-symm.tex
+++ b/enc-symm.tex
@@ -528,6 +528,28 @@
 \end{slide}
 
 \begin{slide}
+  \head{Electronic Code Book (ECB), \seq: diagram}
+
+  \vfil
+  \[ \begin{graph}
+    []!{0; <1cm, 0cm>: <0cm, 1.5cm>::}
+    *+=(1, 0)+[F]{\mathstrut x_0}="x" :[dd] *+[F]{E}="e"
+      :[dd] *+=(1, 0)+[F]{\mathstrut y_0}
+      "e" [l] {K} :"e" "x" [rrr]
+    *+=(1, 0)+[F]{\mathstrut x_1}="x" :[dd] *+[F]{E}="e"
+      :[dd] *+=(1, 0)+[F]{\mathstrut y_1}
+      "e" [l] {K} :"e" "x" [rrr]
+    *+=(1, 0)+[F--]{\mathstrut x_i}="x" :@{-->}[dd] *+[F]{E}="e"
+      :@{-->}[dd] *+=(1, 0)+[F--]{\mathstrut y_i}
+      "e" [l] {K} :@{-->}"e" "x" [rrr]
+    *+=(1, 0)+[F]{\mathstrut x_n}="x" :[dd] *+[F]{E}="e"
+      :[dd] *+=(1, 0)+[F]{\mathstrut y_n}
+      "e" [l] {K} :"e" "x" [rrr]
+  \end{graph} \]
+  \vfil
+\end{slide}
+
+\begin{slide}
   \head{Electronic Code Book (ECB), \seq: analysis}
   
   ECB fails to disguise equality of message blocks.  Hence, it is insecure in
@@ -576,6 +598,29 @@
 \end{slide}
 
 \begin{slide}
+  \head{Counter (CTR), \seq: diagram}
+
+  \vfil
+  \[ \begin{graph}
+    []!{0; <1cm, 0cm>: <0cm, 1.5cm>::}
+    *+=(1, 0)+[F]{\mathstrut x_0}="x" :[dd] *{\xor}="xor"
+      :[dd] *+=(1, 0)+[F]{\mathstrut y_0}
+      "xor" [l] *+[F]{E}="e" [u] {c} :"e" [d] {K} :"e" :"xor" "x" [rrr]
+    *+=(1, 0)+[F]{\mathstrut x_1}="x" :[dd] *{\xor}="xor"
+      :[dd] *+=(1, 0)+[F]{\mathstrut y_1}
+      "xor" [l] *+[F]{E}="e" [u] {c+1} :"e" [d] {K} :"e" :"xor" "x" [rrr]
+    *+=(1, 0)+[F--]{\mathstrut x_i}="x" :@{-->}[dd] *{\xor}="xor"
+      :@{-->}[dd] *+=(1, 0)+[F--]{\mathstrut y_i}
+      "xor" [l] *+[F]{E}="e" [u] {c+i} :@{-->}"e" [d] {K} :@{-->}"e"
+      :@{-->}"xor" "x" [rrr]
+    *+=(1, 0)+[F]{\mathstrut x_n}="x" :[dd] *{\xor}="xor"
+      :[dd] *+=(1, 0)+[F]{\mathstrut y_n}
+      "xor" [l] *+[F]{E}="e" [u] {c+n} :"e" [d] {K} :"e" :"xor" "x" [rrr]
+  \end{graph} \]
+  \vfil
+\end{slide}
+
+\begin{slide}
   \head{Counter (CTR), \seq: analysis of the stateful version}
   
   We write $q' = q\mu/l$ for the total number of blocks queried by the
@@ -692,6 +737,36 @@
 \end{slide}
 
 \begin{slide}
+  \head{Ciphertext Block Chaining (CBC), \seq: diagram}
+
+  \vfil
+  \[ \begin{graph}
+    []!{0; <1cm, 0cm>: <0cm, 1.5cm>::}
+    *+=(1, 0)+[F]{\mathstrut x_0}="x"
+      :[d] *{\xor}="xor"
+      [ll] *+=(1, 0)+[F]{I} :"xor"
+      :[d] *+[F]{E}="e" :[dd] *+=(1, 0)+[F]{\mathstrut y_0}="i"
+      "e" [l] {K} :"e" "i"
+    [rrruuuu] *+=(1, 0)+[F]{\mathstrut x_1}="x"
+      :[d] *{\xor}="xor"
+      "i" :`r [ru] `u "xor" "xor"
+      :[d] *+[F]{E}="e" :[dd] *+=(1, 0)+[F]{\mathstrut y_1}="i"
+      "e" [l] {K} :"e" "i"
+    [rrruuuu] *+=(1, 0)+[F--]{\mathstrut x_i}="x"
+      :@{-->}[d] *{\xor}="xor"
+      "i" :@{-->}`r [ru] `u "xor" "xor"
+      :@{-->}[d] *+[F]{E}="e" :@{-->}[dd] *+=(1, 0)+[F--]{\mathstrut y_i}="i"
+      "e" [l] {K} :@{-->}"e" "i"
+    [rrruuuu] *+=(1, 0)+[F]{\mathstrut x_n}="x"
+      :[d] *{\xor}="xor"
+      "i" :@{-->}`r [ru] `u "xor" "xor"
+      :[d] *+[F]{E}="e" :[dd] *+=(1, 0)+[F]{\mathstrut y_n}="i"
+      "e" [l] {K} :"e" "i"
+  \end{graph} \]
+  \vfil
+\end{slide}
+
+\begin{slide}
   \head{Ciphertext Block Chaining (CBC), \seq: analysis}
 
   As before, we set $q' = q\mu/l$ as the number of blocks queried by an
-- 
2.11.0

