Skip to content

Commit cfeb117

Browse files
committed
feat(compsec): add Encrypt-then-MAC definition
- Definition of Encrypt-then-MAC - Add comparison of the three compositions
1 parent e9a9055 commit cfeb117

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

‎compsec/course.tex‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2449,4 +2449,29 @@ \subsection{All together: confidentiality and integrity (symmetric)}
24492449
\end{itemize}
24502450
\end{defnbox}
24512451

2452+
\begin{defnbox}[title=Encrypt-then-MAC]
2453+
Send $C \,\|\, MAC_K(C)$ with $C = E_K(M)$: encrypt first, then MAC the
2454+
\textbf{ciphertext}.
2455+
\begin{itemize}
2456+
\item[$\checkmark$] \textbf{Integrity of the ciphertext} $\to$ ensures you only read
2457+
valid messages! The cipher cannot be attacked.
2458+
\item[$\checkmark$] Integrity of the plaintext can be verified.
2459+
\item[$\checkmark$] No information on the plaintext either, since it is encrypted.
2460+
\end{itemize}
2461+
\end{defnbox}
2462+
2463+
\begin{keybox}[title=Which composition to use?]
2464+
\begin{center}
2465+
\begin{tabular}{l|c|c|c}
2466+
& \textbf{E\&M} & \textbf{MtE} & \textbf{EtM} \\ \hline
2467+
Ciphertext integrity & $\times$ & $\times$ & $\checkmark$ \\
2468+
Plaintext integrity & $\checkmark$ & $\checkmark$ & $\checkmark$ \\
2469+
Hides the plaintext & $\times$ & $\checkmark$ & $\checkmark$
2470+
\end{tabular}
2471+
\end{center}
2472+
\textbf{Encrypt-then-MAC} wins: the receiver checks the MAC \emph{before} decrypting, so
2473+
forged ciphertexts are rejected without ever being fed to the decryption algorithm
2474+
(fail-safe default, Lecture 2). Use separate keys for encryption and MAC.
2475+
\end{keybox}
2476+
24522477
\end{document}

0 commit comments

Comments
 (0)