chiark / gitweb /
doc/wrestlers.tex: Reinstate the upstream `\bibliography' for reference.
[tripe] / doc / wrestlers.tex
1 %%% -*-latex-*-
2 %%%
3 %%% The Wrestlers Protocol: secure, deniable key-exchange
4 %%%
5 %%% (c) 2006 Mark Wooding
6 %%%
7
8 \makeatletter
9 \def\@doit#1{#1}
10 \ifx\iffancystyle\xxundefined\expandafter\@doit\else\expandafter\@gobble\fi
11 {\newif\iffancystyle\fancystyletrue}
12 \ifx\ifshort\xxundefined\expandafter\@doit\else\expandafter\@gobble\fi
13 {\newif\ifshort\shortfalse}
14 \iffancystyle\expandafter\@gobble\else\expandafter\@doit\fi{\newif\ifpdfing}
15 \makeatother
16
17 \typeout{Options:}
18 \typeout{  Fancy style:   \iffancystyle ON\else OFF\fi}
19 \typeout{  Short version: \ifshort      ON\else OFF\fi}
20
21 \errorcontextlines=\maxdimen
22 \showboxdepth=\maxdimen
23 \showboxbreadth=\maxdimen
24
25 \iffancystyle
26   \documentclass{strayman}
27   \parskip=0pt plus 1pt  \parindent=1.2em
28   \usepackage[T1]{fontenc}
29   \usepackage[palatino, helvetica, courier, maths=cmr]{mdwfonts}
30   \usepackage[within = subsection, mdwmargin]{mdwthm}
31   \usepackage{mdwlist}
32   \usepackage{sverb}
33   \ifpdfing\else
34     \PassOptionsToPackage{dvips}{xy}
35   \fi
36 \else
37   \PassOptionsToClass{runningheads}{llncs}
38   \documentclass{llncs}
39 \fi
40
41 \PassOptionsToPackage{show}{slowbox}
42 %\PassOptionsToPackage{hide}{slowbox}
43 \usepackage{mdwtab, mdwmath, crypto}
44 \usepackage{slowbox}
45 \usepackage{amssymb, amstext}
46 \usepackage{url, multicol}
47 \usepackage{tabularx}
48 \DeclareUrlCommand\email{\urlstyle{tt}}
49 \ifslowboxshow
50   \usepackage[all]{xy}
51   \turnradius{4pt}
52 \fi
53 \usepackage{mathenv}
54
55 \newcommand{\Nupto}[1]{\{0, 1, \ldots, #1 - 1\}}
56 \iffancystyle
57   \let\next\title
58 \else
59   \def\next[#1]{\titlerunning{#1}\title}
60 \fi
61 \next
62   [The Wrestlers Protocol]
63   {The Wrestlers Protocol%
64     \ifshort\thanks{This is an extended abstract; the full version
65       \cite{Wooding:2006:WP} is available from
66       \texttt{http://eprint.iacr.org/2006/386/}.}\fi \\
67     A simple, practical, secure, deniable protocol for key-exchange}
68 \iffancystyle
69   \author{Mark Wooding \\ \email{mdw@distorted.org.uk}}
70 \else
71   \author{Mark Wooding}
72   \institute{\email{mdw@distorted.org.uk}}
73 \fi
74 \date{2 November 2006}
75
76 \iffancystyle
77   \bibliographystyle{mdwalpha}
78   \let\epsilon\varepsilon
79   \let\emptyset\varnothing
80   \let\le\leqslant\let\leq\le
81   \let\ge\geqslant\let\geq\ge
82   \numberwithin{table}{section}
83   \numberwithin{figure}{section}
84   \numberwithin{equation}{subsection}
85   \let\random\$
86 \else
87   \bibliographystyle{splncs}
88   \expandafter\let\csname claim*\endcsname\claim
89   \expandafter\let\csname endclaim*\endcsname\endclaim
90 \fi
91
92 \let\Bin\Sigma
93 \let\emptystring\lambda
94 \edef\Pr{\expandafter\noexpand\Pr\nolimits}
95 \newcommand{\bitsto}{\mathbin{..}}
96 \newcommand{\E}{{\mathcal{E}}}
97 \newcommand{\M}{{\mathcal{M}}}
98 \iffancystyle
99   \def\description{%
100     \basedescript{%
101       \let\makelabel\textit%
102       \desclabelstyle\multilinelabel%
103       \desclabelwidth{1in}%
104     }%
105   }
106 \fi
107 \def\fixme#1{\marginpar{FIXME}[FIXME: #1]}
108 \def\hex#1{\texttt{#1}_{x}}
109
110 \newenvironment{longproof}[1]{%
111   \ifshort#1\expandafter\ignore
112   \else\proof\fi
113 }{%
114   \ifshort\else\endproof\fi
115 }
116
117 \def\dbox#1{%
118   \vtop{%
119     \def\\{\unskip\egroup\hbox\bgroup\strut\ignorespaces}%
120     \hbox{\strut#1}%
121   }%
122 }
123
124 \def\Wident{\Xid{W}{ident}}
125 \def\Wkx{\Xid{W}{kx}}
126 \def\Wdkx{\Xid{W}{dkx}}
127 \def\Func#1#2{\mathcal{F}[#1\to#2]}
128 \def\diff#1#2{\Delta_{#1, #2}}
129 \def\Hid{H_{\textit{ID}}}
130
131 %% protocol run diagrams
132 \def\PRaction#1{#1\ar[r]}
133 \def\PRcreatex#1{\PRaction{\textsf{Create session\space}#1}}
134 \def\PRcreate#1#2#3{\PRcreatex{(\text{#1},\text{#2},#3)}}
135 \def\PRreceivex#1{\PRaction{\textsf{Receive\space}#1}}
136 \def\PRreceive#1#2{\PRreceivex{\msg{#1}{#2}}}
137 \def\PRsession#1{\relax\mathstrut#1\ar[r]}
138 \def\msg#1#2{(\cookie{#1},#2)}
139 \def\PRresult#1{#1}
140 \def\PRsendx#1{\PRresult{\textsf{Send\space}#1}}
141 \def\PRsend#1#2{\PRsendx{\msg{#1}{#2}}}
142 \def\PRcomplete#1{\textsf{Complete:\space}#1}
143 \def\PRstate#1{\textsf{State:\space}#1}
144 \def\PRignore{\textsf{(ignored)}}
145 \def\PRreveal{\textsf{Session-state reveal}\ar[r]}
146 \def\protocolrun#1{\[\xymatrix @R=0pt @C=2em {#1}\]}
147
148 \def\protocol{%
149   \unskip\bigskip
150   \begin{tabular*}{\linewidth}%
151     {@{\qquad}l@{\extracolsep{0ptplus1fil}}r@{\qquad}}}
152 \def\endprotocol{\end{tabular*}}
153 \def\send#1#2{\noalign{%
154     \centerline{\xy\ar @{#1}|*+{\mathstrut#2}<.5\linewidth, 0pt>\endxy}}}
155
156 %% class-ids for proof of extractor lemma
157 \let\Cid=\Lambda
158 \let\Csession=S
159 \let\Cindex=r
160 \let\Cquery=Q
161 \let\Chash=H
162 \let\Ccheck=c
163 \let\Ccheckset=V
164 \let\Ccount=\nu
165
166 \def\HG#1{\mathbf{H}_{#1}}
167
168 \iffancystyle\else
169   \let\xsssec\subsubsection\def\subsubsection#1{\xsssec[#1]{#1.}}
170 \fi
171
172 \begin{document}
173
174 %%%--------------------------------------------------------------------------
175
176 \maketitle
177 \iffancystyle \thispagestyle{empty} \fi
178
179 \begin{abstract}
180   We describe and prove (in the random-oracle model) the security of a simple
181   but efficient zero-knowledge identification scheme, whose security is based
182   on the computational Diffie-Hellman problem.  Unlike other recent proposals
183   for efficient identification protocols, we don't need any additional
184   assumptions, such as the Knowledge of Exponent assumption.
185
186   From this beginning, we build a simple key-exchange protocol, and prove
187   that it achieves `SK-security' -- and hence security in Canetti's Universal
188   Composability framework.
189
190   Finally, we show how to turn the simple key-exchange protocol into a
191   slightly more complex one which provides a number of valuable `real-life'
192   properties, without damaging its security.
193 \end{abstract}
194
195 \iffancystyle
196 \newpage
197 \thispagestyle{empty}
198 \columnsep=2em \columnseprule=0pt
199 \tableofcontents[\begin{multicols}{2}\raggedright][\end{multicols}]
200 %%\listoffigures[\begin{multicols}{2}\raggedright][\end{multicols}]
201 %% \listoftables[\begin{multicols}{2}\raggedright][\end{multicols}]
202 \newpage
203 \fi
204
205 %%%--------------------------------------------------------------------------
206
207 \section{Introduction}
208
209 This paper proposes protocols for \emph{identification} and
210 \emph{authenticated key-exchange}.
211
212 An identification protocol allows one party, say Bob, to be sure that he's
213 really talking to another party, say Alice.  It assumes that Bob has some way
214 of recognising Alice; for instance, he might know her public key.  Our
215 protocol requires only two messages -- a challenge and a response -- and has
216 a number of useful properties.  It is very similar to, though designed
217 independently of, a recent protocol by Stinson and Wu
218 \cite{cryptoeprint:2006:337}; we discuss their protocol and compare it to
219 ours in \ifshort the full version of this paper. \else
220 section~\ref{sec:stinson-ident}.  \fi
221
222 Identification protocols are typically less useful than they sound.  As Shoup
223 \cite{cryptoeprint:1999:012} points out, it provides a `secure ping', by
224 which Bob can know that Alice is `there', but provides no guarantee that any
225 other communication was sent to or reached her.  However, there are
226 situations where this an authentic channel between two entities -- e.g., a
227 device and a smartcard -- where a simple identification protocol can still be
228 useful.
229
230 An authenticated key-exchange protocol lets Alice and Bob agree on a shared
231 secret, known to them alone, even if there is an enemy who can read and
232 intercept all of their messages, and substitute messages of her own.  Once
233 they have agreed on their shared secret, of course, they can use standard
234 symmetric cryptography techniques to ensure the privacy and authenticity of
235 their messages.
236
237
238 \subsection{Desirable properties of our protocols}
239
240 Our identification protocol has a number of desirable properties.
241 \begin{itemize}
242 \item It is \emph{simple} to understand and implement.  In particular, it
243   requires only two messages.
244 \item It is fairly \emph{efficient}, requiring two scalar multiplications by
245   each of the prover and verifier.
246 \item It is provably \emph{secure} (in the random oracle model), assuming the
247   intractability of the computational Diffie-Hellman problem.
248 \end{itemize}
249
250 Our key-exchange protocol also has a number of desirable
251 properties.
252 \begin{itemize}
253 \item It is fairly \emph{simple} to understand and implement, though there
254   are a few subtleties.  In particular, it is \emph{symmetrical}.  We have
255   implemented a virtual private network system based on this protocol.
256 \item It is \emph{efficient}, requiring four scalar multiplications by each
257   participant.  The communication can be reduced to three messages by
258   breaking the protocol's symmetry.
259 \item It is provably \emph{secure} (again, in the random oracle model),
260   assuming the intractability of the computational Diffie-Hellman problem,
261   and the security of a symmetric encryption scheme.
262 \item It provides \emph{perfect forward secrecy}.  That is, even if a user's
263   long-term secrets are compromised, past sessions remain secure.
264 \item It is \emph{deniable}.  It is possible to construct simulated
265   transcripts of protocol executions between any number of parties without
266   knowing any of their private keys.  The simulated transcripts are (almost)
267   indistinguishable from real protocol transcripts.  Hence, a transcript
268   does not provide useful evidence that a given party was really involved in
269   a given protocol execution.
270 \end{itemize}
271
272 \ifshort\else
273 \subsection{Asymptotic and concrete security results}
274
275 Most security definitions for identification (particularly zero-knowledge)
276 and key-exchange in the literature are \emph{asymptotic}.  That is, they
277 consider a family of related protocols, indexed by a \emph{security
278 parameter}~$k$; they that any \emph{polynomially-bounded} adversary has only
279 \emph{negligible} advantage.  A polynomially-bounded adversary is one whose
280 running time is a bounded by some polynomial~$t(k)$.  The security definition
281 requires that, for any such polynomially-bounded adversary, and any
282 polynomial $p(k)$, the adversary's advantage is less than $p(k)$ for all
283 sufficiently large values of $k$.
284
285 Such asymptotic notions are theoretically interesting, and have obvious
286 connections to complexity theory.  Unfortunately, such an asymptotic result
287 tells us nothing at all about the security of a particular instance of a
288 protocol, or what parameter sizes one needs to choose for a given level of
289 security against a particular kind of adversary.  Koblitz and Menezes
290 \cite{cryptoeprint:2006:229} (among other useful observations) give examples
291 of protocols, proven to meet asymptotic notions of security, whose security
292 proofs guarantee nothing at all for the kinds of parameters typically used in
293 practice.
294
295 Since, above all, we're interested in analysing a practical and implemented
296 protocol, we follow here the `practice-oriented provable security' approach
297 largely inspired by Bellare and Rogaway, and exemplified by
298 \cite{Bellare:1994:SCB,Bellare:1995:XMN,Bellare:1995:OAE,Bellare:1996:ESD,%
299 Bellare:1996:KHF,Bellare:1997:CST}; see also \cite{Bellare:1999:POP}.
300 Rather than attempting to say, formally, whether or not a protocol is
301 `secure', we associate with each protocol an `insecurity function' which
302 gives an upper bound on the advantage of any adversary attacking the protocol
303 within given resource bounds.
304 \fi
305
306 \subsection{Formal models for key-exchange}
307
308 \ifshort
309
310 The first model for studying the \emph{computational} security of
311 key-exchange protocols (rather than using protocol-analysis logics like that
312 of \cite{Burrows:1989:LAa}) was given by Bellare and Rogaway
313 \cite{Bellare:1994:EAK}; the model has since been enhanced, both by the
314 original authors and others, in \cite{Bellare:1995:PSS,%
315 Blake-Wilson:1997:KAP,Blake-Wilson:1998:EAA}.  The model defines security
316 in terms of a game: key-exchange protocols are secure if an adversary can't
317 distinguish the key agreed by a chosen `challenge session' from a key chosen
318 independently at random.  Other models for key-exchange have been proposed in
319 \cite{Bellare:1998:MAD} and \cite{cryptoeprint:1999:012}; these use a
320 different notion of security, involving implementation of an ideal
321 functionality.
322
323 \else
324
325 Many proposed key-exchange protocols have turned out to have subtle security
326 flaws.  The idea of using formal methods to analyse key-exchange protocols
327 begins with the logic of Burrows, Abadi and Needham \cite{Burrows:1989:LAa}.
328 Their approach requires a `formalising' step, in which one expresses in the
329 logic the contents of the message flows, and the \emph{beliefs} of the
330 participants.
331
332 Bellare and Rogaway \cite{Bellare:1994:EAK} describe a model for studying the
333 computational security of authentication and key-exchange protocols in a
334 concurrent setting, i.e., where multiple parties are running several
335 instances of a protocol simultaneously.  They define a notion of security in
336 this setting, and show that several simple protocols achieve this notion.
337 Their original paper dealt with pairs of parties using symmetric
338 cryptography; they extended their definitions in \cite{Bellare:1995:PSS} to
339 study three-party protocols involving a trusted key-distribution centre.
340
341 Blake-Wilson, Johnson and Menezes \cite{Blake-Wilson:1997:KAP} applied the
342 model of \cite{Bellare:1994:EAK} to key-exchange protocols using asymmetric
343 cryptography, and Blake-Wilson and Menezes \cite{Blake-Wilson:1998:EAA}
344 applied it to protocols based on the Diffie-Hellman protocol.
345
346 The security notion of \cite{Bellare:1994:EAK} is based on a \emph{game}, in
347 which an adversary nominates a \emph{challenge session}, and is given either
348 the key agreed by the participants of the challenge session, or a random
349 value independently sampled from an appropriate distribution.  The
350 adversary's advantage -- and hence the insecurity of the protocol -- is
351 measured by its success probability in guessing whether the value it was
352 given is really the challenge key.  This challenge-session notion was also
353 used by the subsequent papers described above.
354
355 Bellare, Canetti and Krawczyk \cite{Bellare:1998:MAD} described a pair of
356 models which they called the \textsc{am} (for `authenticated links model')
357 and \textsc{um} (`unauthenticated links model').  They propose a modular
358 approach to the design of key-exchange protocols, whereby one first designs a
359 protocol and proves its security in the \textsc{am}, and then applies a
360 authenticating `compiler' to the protocol which they prove yields a protocol
361 secure in the realistic \textsc{um}.  Their security notion is new.  They
362 define an `ideal model', in which an adversary is limited to assigning
363 sessions fresh, random and unknown keys, or matching up one session with
364 another, so that both have the same key.  They define a protocol to be secure
365 if, for any adversary~$A$ in the \textsc{am} or \textsc{um}, there is an
366 ideal adversary~$I$, such that the outputs of $A$ and $I$ are computationally
367 indistinguishable.
368
369 In \cite{cryptoeprint:1999:012}, Shoup presents a new model for key-exchange,
370 also based on the idea of simulation.  He analyses the previous models,
371 particularly \cite{Bellare:1994:EAK} and \cite{Bellare:1998:MAD}, and
372 highlights some of their inadequacies.
373
374 \fi
375
376 Canetti and Krawczyk \cite{cryptoeprint:2001:040,Canetti:2001:AKE} describe a
377 new notion of security in the model of \cite{Bellare:1998:MAD}, based on the
378 challenge-session notion of \cite{Bellare:1994:EAK}.  The security notion,
379 called `SK-security', seems weaker in various ways than those of earlier
380 works such as \cite{Bellare:1994:EAK} or \cite{cryptoeprint:1999:012}.
381 However, the authors show that their notion suffices for constructing `secure
382 channel' protocols, which they also define.
383
384 \ifshort\else
385 In \cite{Canetti:2001:UCS}, Canetti describes the `universal composition'
386 framework.  Here, security notions are simulation-based: one defines security
387 notions by presenting an `ideal functionality'.  A protocol securely
388 implements a particular functionality if, for any adversary interacting with
389 parties who use the protocol, there is an adversary which interacts with
390 parties using the ideal functionality such that no `environment' can
391 distinguish the two.  The environment is allowed to interact freely with the
392 adversary throughout, differentiating this approach from that of
393 \cite{Bellare:1998:MAD} and \cite{cryptoeprint:1999:012}, where the
394 distinguisher was given only transcripts of the adversary's interaction with
395 the parties.  With security defined in this way, it's possible to prove a
396 `universal composition theorem': one can construct a protocol, based upon
397 various ideal functionalities, and then `plug in' secure implementations of
398 the ideal functionalities and appeal to the theorem to prove the security of
399 the entire protocol.  The UC framework gives rise to very strong notions of
400 security, due to the interactive nature of the `environment' distinguisher.
401 \fi
402
403 Canetti and Krawczyk \cite{Canetti:2002:UCN} show that the SK-security notion
404 of \cite{Canetti:2001:AKE} is \emph{equivalent} to a `relaxed' notion of
405 key-exchange security in the UC framework\ifshort\space of
406 \cite{Canetti:2001:UCS}\fi, and suffices for the construction of UC secure
407 channels.
408
409 The result of \cite{Canetti:2002:UCN} gives us confidence that SK-security is
410 the `right' notion of security for key-exchange protocols.  Accordingly,
411 SK-security is the standard against which we analyse our key-exchange
412 protocol.
413
414
415 \subsection{Outline of the paper}
416
417 The remaining sections of this paper are as follows.
418 \begin{itemize}
419 \item Section \ref{sec:prelim} provides the essential groundwork for the rest
420   of the paper.  It introduces important notation, and describes security
421   notions and intractability assumptions.
422 \item Section \ref{sec:zk-ident} describes our zero-knowledge identification
423   protocol and proves its security.
424 \item Section \ref{sec:kx} describes the simple version of our key-exchange
425   protocol, and proves its security and deniability.  It also describes some
426   minor modifications which bring practical benefits without damaging
427   security.
428 \item Finally, section \ref{sec:conc} presents our conclusions.
429 \end{itemize}
430
431 \ifshort
432 The full version of this paper describes how to make our protocols
433 identity-based by using bilinear pairings using the techniques introduced in
434 \cite{Boneh:2003:IBE}.  It also contains proofs of the various theorems
435 stated here.
436 \fi
437
438 %%%--------------------------------------------------------------------------
439
440 \section{Preliminaries}
441 \label{sec:prelim}
442
443 \ifshort
444 \subsection{Basics}
445 \let\prelimsec\subsubsection
446 \else
447 \let\prelimsec\subsection
448 \fi
449
450 \prelimsec{Miscellaneous notation}
451
452 We write $\Func{D}{R}$ for the set of all functions with domain $D$ and range
453 $R$.
454
455 \prelimsec{Groups}
456
457 Let $(G, +)$ be a cyclic group\footnote{
458   We find that additive group notation is easier to read.  In particular, in
459   multiplicative groups, one ends up with many interesting things tucked away
460   in little superscripts.}%
461 of prime order $q$, and generated by an element $P$.  We shall write the
462 identity of $G$ as $0_G$, or simply as $0$ when no ambiguity is likely to
463 arise.  Thus, we have $\langle P \rangle = G$ and $q P = 0$.  Any $X \in G$
464 can be written as $X = x P$ for some $x \in \{0, 1, \ldots, q - 1\}$.
465
466 We consider a cyclic group of order $n$ as a $\Z/n\Z$-module, and in
467 particular our group $G$ can be seen as a vector space over $\gf{q}$.  This
468 makes the notation slightly more convenient.
469
470 \prelimsec{Bit strings and encodings}
471 \label{sec:bitenc}
472
473 Let $\Bin = \{0, 1\}$ be the set of binary digits.  Then $\Bin^n$ is the set
474 of $n$-bit strings, and $\Bin^*$ the set of all (finite) bit strings.  If $x
475 \in \Bin^n$ is a bit string, we write its length as $|x| = n$.  For a bit
476 string $x \in \Bin^n$, and for $0 \le i < n$, we write $x[i]$ as the $i$th
477 bit of $x$.  The empty string is denoted $\emptystring$.
478
479 Let $x$ and $y$ be two bit strings.  If $|x| = |y| = n$, we write $x \xor y$
480 to mean the bitwise exclusive-or of $x$ and $y$\ifshort\else: if $z = x \xor
481 y$ then $|z| = n$, and $z[i] = (x[i] + y[i]) \bmod 2$ for $0 \le i < n$\fi.
482 We write $x \cat y$ to mean the concatenation of $x$ and $y$\ifshort\else: if
483 $z = x \cat y$ then $|z| = |x| + |y|$ and $z[i] = x[i]$ if $0 \le i < |x|$
484 and $z[i] = y[i - |x|]$ if $|x| < i \le |x| + |y|$\fi.
485
486 Finally, we let $\bot$ be a value distinct from any bit string.
487
488 We shall want to encode group elements $X \in G$ and indices $x \in I =
489 \gf{q}$ as bit strings.
490 \ifshort
491 To this end, we shall assume the existence of efficient, unambiguous
492 encodings of group elements as $\ell_G$-bit strings, and indices as
493 $\ell_I$-bit strings.  To reduce clutter, we shall leave encoding and
494 decoding as implicit operations.
495 \else
496 To this end, we shall assume the existence of
497 integers $\ell_G, \ell_I > 0$ and functions
498 \[
499   e_S\colon S \to \Bin^{\ell_S}
500   \quad \textrm{and} \quad
501   d_S\colon \Bin^{\ell_S} \to S \cup \{ \bot \}
502   \qquad
503   \textrm{for } S \in \{ G, \F \}.
504 \]
505 with the following properties.
506 \begin{itemize}
507 \item The functions are \emph{unique} and \emph{unambiguous}, i.e., for any
508   $t \in \Bin^{\ell_S}$, we have
509   \[ d_S(t) = \begin{cases}
510        s & if there is some $s \in S$ such that $t = e_S(s)$, or \\
511        \bot & if no such $s$ exists.
512   \end{cases}
513   \]
514 \item The functions should be \emph{efficient} to compute.  Indeed, we shall
515   be assuming that the time taken for encoding and decoding is essentially
516   trivial.
517 \end{itemize}
518 Note that, as we have defined them, all encodings of group elements are the
519 same length, and similarly for encodings of indices.  This is necessary for
520 the security of our protocols.
521
522 We shall frequently abuse notation by omitting the encoding and decoding
523 functions where it is obvious that they are required.
524 \fi
525
526 \ifshort\else
527 \prelimsec{Games, adversaries, and oracles}
528 \label{sec:games}
529
530 Many of the security definitions and results given here make use of
531 \emph{games}, played with an \emph{adversary}.  An adversary is a
532 probabilistic algorithm.  In some games, the adversary is additionally
533 equipped with \emph{oracles}, which perform computations with values chosen
534 by the adversary and secrets chosen by the game but not revealed to the
535 adversary.  We impose limits on the adversary's resource usage: in
536 particular, the total time it takes, and the number of queries it makes to
537 its various oracles.  Throughout, we include the size of the adversary's
538 program as part of its `time', in order to model adversaries which contain
539 large precomputed tables.
540
541 The games provide models of someone trying to attack a construction or
542 protocol.  For security, we will either define a notion of `winning' the
543 game, and require that all adversaries have only a very small probability of
544 winning, or we consider two different games and require that no adversary can
545 distinguish between the two except with very small probability.
546
547 Our proofs make frequent use of sequences of games; see
548 \cite{cryptoeprint:2004:332,cryptoeprint:2004:331}.  The presentation owes
549 much to Shoup \cite{cryptoeprint:2004:332}.  We begin with a game $\G0$ based
550 directly on a relevant security definition, and construct a sequence of games
551 $\G1$, $\G2$, \dots, each slightly different from the last.  We define all of
552 the games in a sequence over the same underlying probability space -- the
553 random coins tossed by the algorithms involved -- though different games may
554 have slightly differently-defined events and random variables.  Our goal in
555 doing this is to bound the probability of the adversary winning the initial
556 game $\G0$ by simultaneously (a) relating the probability of this event to
557 that of corresponding events in subsequent games, and (b) simplifying the
558 game until the probability of the corresponding event can be computed
559 directly.
560
561 The following simple lemma from \cite{Shoup:2001:OR} will be frequently
562 useful.
563 \begin{lemma}[Difference Lemma]
564   \label{lem:shoup}
565   Let $S$, $T$, $F$ be events.  Suppose $\Pr[S \mid \bar F] =
566   \Pr[T \mid \bar F]$.  Then $|\Pr[S] - \Pr[T]| \le \Pr[F]$.
567 \end{lemma}
568 \begin{proof}
569   A simple calculation:
570   \begin{eqnarray*}[rl]
571     |\Pr[S] - \Pr[T]|
572     & = |(\Pr[S \mid F]\Pr[F] + \Pr[S \mid \bar F]\Pr[\bar F]) -
573          (\Pr[T \mid F]\Pr[F] + \Pr[T \mid \bar F]\Pr[\bar F])| \\
574     & = \Pr[F] \cdot |\Pr[S \mid F] - \Pr[T \mid F]| \\
575     & \le \Pr[F]
576   \end{eqnarray*}
577   and we're done!
578 \end{proof}
579 \fi
580
581
582 \prelimsec{The random oracle model}
583 \label{sec:ro}
584
585 \ifshort\else
586 In particular, most of our results will make use of the \emph{random oracle}
587 model \cite{Bellare:1993:ROP}, in which all the participants, including the
588 adversary, have access to a number of `random oracles'.  A random oracle with
589 domain $D$ and range $R$ is an oracle which computes a function chosen
590 uniformly at random from the set of all such functions.  (In the original
591 paper \cite{Bellare:1993:ROP}, random oracles are considered having domain
592 $\Bin^*$ and range $\Bin^\omega$; we use finite random oracles here, because
593 they're easier to work with.)
594
595 Given a protocol proven secure in the random oracle model, we can instantiate
596 each random oracle by a supposedly-secure hash function and be fairly
597 confident that either our protocol will be similarly secure, or one of the
598 hash functions we chose has some unfortunate property.
599
600 Proofs in the random oracle must be interpreted carefully.  For example,
601 Canetti, Goldreich and Halevi \cite{Canetti:2004:ROM} show that there are
602 schemes which can be proven secure in the random oracle model but provably
603 have no secure instantiation in the standard model.
604 \fi
605
606 The random oracle model \ifshort\cite{Bellare:1993:ROP} \fi is useful for
607 constructing reductions and simulators for two main reasons.
608 \begin{enumerate}
609 \item One can use the transcript of an adversary's queries to random oracles
610   in order to extract knowledge from it.
611 \item One can `program' a random oracle so as to avoid being bound by prior
612   `commitments', or to guide an adversary towards solving a selected instance
613   of some problem.
614 \end{enumerate}
615 Our proofs only make use of the first feature.  This becomes particularly
616 important when we consider issues of zero-knowledge and deniability in a
617 concurrent setting, because we want to be able to claim that we retain these
618 features when the random oracle is instantiated using a cryptographic hash
619 function, and hash functions definitely aren't `programmable' in this way!
620 The former property seems rather more defensible -- one would indeed hope
621 that the only sensible way of working out (anything about) the hash of a
622 particular string is to actually compute the hash function, and the random
623 oracle model is, we hope, just giving us a `hook' into this process.
624
625 \ifshort\else
626 (Our protocols can be modified to make use of bilinear pairings so as to
627 provide identity-based identification and key-exchange, using the techniques
628 of \cite{Boneh:2003:IBE}.  Proving the security of the modifications we
629 discuss would involve `programming' random oracles, but this doesn't affect
630 the zero-knowledge or deniability of the resulting protocols.)
631 \fi
632
633
634 \ifshort\else
635 \prelimsec{Notation for algorithms}
636
637 We shall have occasion to describe algorithms by means of a pseudocode.  Our
638 choice of pseudocode is unlikely to be particularly controversial.  We let $x
639 \gets y$ denote the action of setting $x$ to the value $y$; similarly, $x
640 \getsr Y$ denotes the action of sampling $x$ from the set $Y$ uniformly at
641 random.
642
643 The expression $a \gets A^{O(\cdot, x)}(y)$ means `assign to $a$ the value
644 output by algorithm $A$ on input $y$, and with oracle access to the algorithm
645 which, given input $z$, computes $O(z, x)$'.
646
647 We make use of conditional (\IF-\ELSE) and looping (\FOR-\DO and \WHILE-\DO)
648 constructions; in order to reduce the amount of space taken up, the bodies of
649 such constructions are shown by indentation only.
650
651 We don't declare the types of our variables explicitly, assuming that these
652 will be obvious by inspection; also, we don't describe our variables' scopes
653 explicitly, leaving the reader to determine these from context.
654
655 Finally, the notation $\Pr[\textit{algorithm} : \textit{condition}]$ denotes
656 the probability that \textit{condition} is true after running the given
657 \textit{algorithm}.
658 \fi
659
660 \prelimsec{Diffie-Hellman problems}
661 \label{sec:dhp}
662
663 The security of our protocols is related to the hardness of the
664 computational, decisional, and gap Diffie-Hellman problems in the group $G$.
665 We define these problems and what it means for them to be `hard' here.
666
667 The \emph{computational} Diffie-Hellman problem (CDH) is as follows: given
668 two group elements $X = x P$ and $Y = y P$, find $Z = x y P$.
669 \ifshort\else
670 \begin{definition}[The computational Diffie-Hellman problem]
671   Let $(G, +)$ be a cyclic group generated by $P$.  For any adversary $A$, we
672   say that $A$'s \emph{success probability} at solving the computational
673   Diffie-Hellman problem in $G$ is
674   \[ \Succ{cdh}{G}(A) =
675       \Pr[ x \getsr I; y \getsr \Z/\#G\Z : A(x P, y P) = x y P ]
676   \]
677   where the probability is taken over the random choices of $x$ and $y$ and
678   any random decisions made by $A$.  We say that the \emph{CDH insecurity
679   function} of $G$ is
680   \[ \InSec{cdh}(G; t) = \max_A \Succ{cdh}{G}(A) \]
681   where the maximum is taken over adversaries which complete in time $t$.
682 \end{definition}
683 Certainly, if one can compute discrete logarithms in the group $G$ (i.e.,
684 given $x P$, find $x$), then one can solve the computational Diffie-Hellman
685 problem.  The converse is not clear, though.  Shoup \cite{Shoup:1997:LBD}
686 gives us some confidence in the difficulty of the problem by showing that a
687 \emph{generic} adversary -- i.e., one which makes no use of the specific
688 structure of a group -- has success probability no greater than $q^2/\#G$.
689
690 This isn't quite sufficient for our purposes.  Our proofs will be able to
691 come up with (possibly) a large number of guesses for the correct answer, and
692 at most one of them will be correct.  Unfortunately, working out which one is
693 right seems, in general, to be difficult.  This is the \emph{decision}
694 Diffie-Hellman problem (DDH), which \cite{Shoup:1997:LBD} shows, in the
695 generic group model, is about as hard as CDH.  (See \cite{Boneh:1998:DDP} for
696 a survey of the decision Diffie-Hellman problem.)
697 \par\fi
698 Our reference problem will be a `multiple-guess computational Diffie-Hellman
699 problem' (MCDH), which is captured by a game as follows.  An adversary is
700 given a pair of group elements $(x P, y P)$, and an oracle $V(\cdot)$ which
701 accepts group elements as input.  The adversary wins the game if it queries
702 $V(x y P)$.
703
704 \begin{figure}
705   \begin{program}
706     $\Game{mcdh}{G}(A)$: \+ \\
707       $w \gets 0$; \\
708       $x \getsr \Z/\#G\Z$; $y \getsr \Z/\#G\Z$; \\
709       $A^{V(\cdot)}(x P, y P)$; \\
710       \RETURN $w$;
711     \next
712     Function $V(Z)$: \+ \\
713       \IF $Z = x y P$ \THEN \\ \ind
714         $w \gets 1$; \\
715         \RETURN $1$; \- \\
716       \RETURN $0$;
717   \end{program}
718
719   \caption{The multiple-guess computational Diffie-Hellman problem:
720     $\Game{mcdh}{G}(A)$}
721   \label{fig:mcdh}
722 \end{figure}
723
724 \begin{definition}[The multiple-guess computational Diffie-Hellman problem]
725   \label{def:mcdh}
726   Let $(G, +)$ be a cyclic group generated by $P$.  For some adversary $A$,
727   we say that $A$'s \emph{success probability} at solving the multiple-guess
728   computational Diffie-Hellman problem in $G$ is
729   \[ \Succ{mcdh}{G}(A) = \Pr[\Game{mcdh}{G}(A) = 1] \]
730   where $\Game{mcdh}{G}(A)$ is shown in figure~\ref{fig:mcdh}.  We say that
731   the \emph{MCDH insecurity function of $G$} is
732   \[ \InSec{mcdh}(G; t, q_V) = \max_A \Succ{mcdh}{G}(A) \]
733   where the maximum is taken over adversaries which complete in time $t$ and
734   make at most $q_V$-oracle queries.
735 \end{definition}
736 \ifshort
737 We can (loosely) relate the difficulty of MCDH to the difficulty of
738 the standard CDH problem, in which the adversary is allowed only a single
739 guess.
740 \else
741 Note that our MCDH problem is not quite the `gap Diffie-Hellman problem'
742 (GDH).  The gap problem measures the intractibility of solving CDH even with
743 the assistance of an oracle for solving (restricted) decision Diffie-Hellman
744 problems in the group.  Specifically, the adversary is given $(X, Y) = (x P,
745 y P)$ and tries to find $Z = x y P$, as for CDH, but now it has access to an
746 oracle $D(R, S)$ which answers $1$ if $S = x R$ and $0$ otherwise.
747
748 Clearly MCDH is at least as hard as GDH, since our simple verification oracle
749 $V(Z)$ can be simulated with the gap problem's DDH oracle, as $D(Y, Z)$.
750 However, we can (loosely) relate the difficulty of MCDH to the difficulty of
751 CDH.
752 \fi
753 \begin{proposition}[Comparison of MCDH and CDH security]
754   For any cyclic group $(G, +)$,
755   \[ \InSec{mcdh}(G; t, q_V) \le
756        \ifshort q_V\,\InSec{mcdh}(G; t + O(q_V), 1) \else
757                 q_V\,\InSec{cdh}(G; t + O(q_V)) \fi.
758   \]
759 \end{proposition}
760 \begin{longproof}{The proof of this proposition may be found in the full
761     version of this paper.}
762   Let $A$ be an adversary attacking the multiple-guess computational
763   Diffie-Hellman problem in $G$, and suppose that it runs in time $t$ and
764   issues $q_V$ queries to its verification oracle.
765
766   We use a sequence of games.  Game $\G0$ is the original MCDH attack game.
767   In each game $\G{i}$, we let the event $S_i$ be the probability that the
768   adversary wins the game.
769
770   Game $\G1$ is the same as $\G0$, except that we change the behaviour of the
771   verification oracle.  Specifically, we make the oracle always return $0$.
772   We claim that this doesn't affect the adversary's probability of winning,
773   i.e., $\Pr[S_1] = \Pr[S_0]$.  To see this, note that if none of the
774   adversary's $V(\cdot)$ queries was correct, then there is no change in the
775   game; conversely, if any query was correct, then the adversary will have
776   won regardless of its subsequent behaviour (which may differ arbitrarily
777   between the two games).
778
779   We are now ready to construct from $A$ an adversary $B$ attacking the
780   standard computational Diffie-Hellman problem.
781   \begin{program}
782     Adversary $B(X, Y)$: \+ \\
783       $n \gets 0$; \\
784       \FOR $i \in \Nupto{q_V}$ \DO $Q_i \gets 0$; \\
785       $A^{V(\cdot)}$; \\
786       $r \getsr \Nupto{n}$; \\
787       \RETURN $Q_r$;
788     \next
789     Function $D(Z')$: \+ \\
790       $Q_n \gets Z'$; \\
791       $n \gets n + 1$; \\
792       \RETURN $0$;
793   \end{program}
794   Observe that $B$ provides $A$ with an accurate simulation of game $\G1$.
795   Moreover, at the end of the algorithm, we have $0 < n \le q_V$, and the
796   values $Q_0$, $Q_1$, \dots, $Q_{n-1}$ are the values of $A$'s oracle
797   queries.  Hence, with probability $Pr[S_1]$, at least of one of the $Q_i$
798   is the correct answer to the CDH problem.  Let $\epsilon = \Pr[S_1] =
799   \Pr[S_0]$; we claim that $B$'s probability of success is at least
800   $\epsilon/q_V$.  The proposition follows directly from this claim and that,
801   because $A$ was chosen arbitrarily, we can maximize and count resources.
802
803   We now prove the above claim.  For $0 \le i < q_V$, let $W_i$ be the
804   event that $Q_i = x y P$, i.e., that $Q_i$ is the correct response.  A
805   simple union bound shows that
806   \[ \sum_{0\le i<j} \Pr[W_i \mid n = j] \ge \epsilon. \]
807   We now perform a calculation:
808   \begin{eqnarray*}[rl]
809     \Succ{cdh}{G}(B)
810     & =  \sum_{0\le i<q_V} \Pr[W_i \land r = i] \\
811     & =  \sum_{0<j\le q_V} \Pr[n = j]
812          \biggl( \sum_{0\le i<j} \Pr[W_i \land r = i \mid n = j] \biggr) \\
813     & =  \sum_{0<j\le q_V} \Pr[n = j]
814          \biggl( \frac{1}{j} \sum_{0\le i<j} \Pr[W_i \mid n = j] \biggr) \\
815     &\ge \sum_{0<j\le q_V} \Pr[n = j] \frac{\epsilon}{j} \\
816     &\ge \frac{\epsilon}{q_V} \sum_{0<j\le q_V} \Pr[n = j] \\
817     & =  \frac{\epsilon}{q_V}.
818   \end{eqnarray*}
819   which completes the proof.
820 \end{longproof}
821
822 \ifshort\else
823 \prelimsec{Example groups and encodings}
824
825 For nonnegative integers $0 \le n < 2^\ell$, there is a natural binary
826 encoding $N_\ell\colon \Nupto{2^\ell} \to \Bin^\ell$ which we can define
827 recursively as follows.
828 \[ N_0(0) = \emptystring \qquad
829    N_\ell(n) = \begin{cases}
830      N_{\ell-1}(n) \cat 0              & if $0 \le n < 2^{\ell-1}$ \\
831      N_{\ell-1}(n - 2^{\ell-1}) \cat 1 & if $2^{\ell-1} \le n < 2^\ell$.
832    \end{cases}
833 \]
834 Given an encoding $a = N_\ell(n)$ we can recover $n$ as
835 \[ n = \sum_{0\le i<\ell} a[i] 2^i. \]
836 Hence, given some limit $L \le 2^\ell$, we can encode elements of $\Nupto{L}$
837 using the functions $(e, d)$:
838 \[ e(L, \ell, n) = N_\ell(n) \qquad
839    d(L, \ell, a) = \begin{cases}
840      N_\ell(a) & if $N_\ell(a) < L$ \\
841      \bot      & otherwise
842    \end{cases}
843 \]
844 The reader can verify that the functions $e(L, \ell, \cdot)$ and $d(L, \ell,
845 \cdot)$ satisfy the requirements of section~\ref{sec:bitenc}.
846
847 Given some $q$ with $q < 2^{\ell_I}$, then, we can define an encoding
848 $(e_\F, d_\F)$ by $e_\F(n) = e(q, \ell_I, n)$ and $d_\F(a) = d(q, \ell_I,
849 a)$.
850
851 Let $p$ and $q$ be primes, with $q \mid (p - 1)$.  Then there is an order-$q$
852 subgroup of $\F_p^*$.  In practice, an order-$q$ element can be found easily
853 by taking elements $h \in \F_p^*$ at random and computing $g = h^{(p-1)/2}$
854 until $g \ne 1$; then $G = \langle g \rangle$ is a group of $q$ elements.
855 Assuming that $p$ and $q$ are sufficiently large, the Diffie-Hellman problems
856 seem to be difficult in $G$.  Some texts recommend additional restrictions on
857 $p$, in particular that $(p - 1)/2q$ be either prime or the product of large
858 primes.  Primes of this form protect against small-subgroup attacks; but our
859 protocols are naturally immune to these attacks, so such precautions are
860 unnecessary here.  Elements of $G$ can be encoded readily, since each element
861 $n + p\Z$ of $\F_p = \Z/p\Z$ has an obvious `representative' integer $n$ such
862 that $0 \le n < p$, and given $2^{\ell_G} > p$, we can encode $n$ as $e(p,
863 \ell_G, n)$, as above.
864
865 Alternatively, let $\F = \gf{p^f}$ be a finite field, and $E$ be an elliptic
866 curve defined over $\F$ such that the group $E(\F)$ of $\F$-rational points
867 of $E$ has a prime-order cyclic subgroup $G$.  Elements of $G$ can be
868 represented as pairs of elements of $\F$.  If $f = 1$, i.e., $\F = \Z/p\Z$
869 then field elements can be encoded as above.  If $p = 2$, we can represent
870 the field as $\F_2/(p(x))$ for some irreducible polynomial $p(x) \in \F_2[x]$
871 of degree $f$.  An element $r \in \F$ can then be represented by a polynomial
872 $r(x)$ with degree less than $f$, and coefficients $c_i \in \{0, 1\}$, i.e.,
873 \[ r(x) = \sum_{0\le i<f} c_i x^i \]
874 and hence we can uniquely encode $r$ as an $f$-bit string $a$ such that $a[i]
875 = c_i$.
876 \fi
877
878
879 \prelimsec{Symmetric encryption}
880 \label{sec:sym-enc}
881
882 Our key-exchange protocol requires a symmetric encryption scheme.  Our
883 definition is fairly standard, except that, rather than specifying a
884 key-generation algorithm, we assume that key generation simply involves
885 selecting a string of a given length uniformly at random.
886 \begin{definition}[Symmetric encryption schemes]
887   A \emph{symmetric encryption scheme} $\E = (\kappa, E, D)$ consists of:
888   \begin{itemize}
889   \item an integer $\kappa \ge 0$,
890   \item a randomized \emph{encryption algorithm} $E$ which, on input $K \in
891     \Bin^\kappa$ and $p \in \Bin^*$ outputs some $c \in \Bin^*$, written $c
892     \gets E_K(p)$;
893   \item a \emph{decryption algorithm} $D$ which, on input $K \in \Bin^\kappa$
894     and $c \in \Bin^*$ outputs some $p' \in \Bin^* \cup \{\bot\}$, written
895     $p' \gets D_K(c)$.
896   \end{itemize}
897   Furthermore, a symmetric encryption scheme must be \emph{sound}: that is,
898   if $c \gets E_K(p)$ for some $K \in \Bin^\kappa$ and $p \in \Bin^*$, and
899   $p' \gets D_K(c)$ then $p = p'$.
900 \end{definition}
901 Our security notion for symmetric encryption is the standard notion of
902 left-or-right indistinguishability of ciphertexts under chosen-ciphertext
903 attack.
904 \begin{definition}[IND-CCA]
905   \label{def:ind-cca}
906   Let $\E = (\kappa, E, D)$ be a symmetric encryption scheme, and $A$ be an
907   adversary.  Let $\id{lr}_b(x_0, x_1) = x_b$ for $b \in \{0, 1\}$.  Let
908   \[ P_b =
909      \Pr[K \getsr \Bin^\kappa;
910          b \gets A^{E_K(\id{lr}_b(\cdot, \cdot)), D_K(\cdot)}() :
911          b = 1]
912   \]
913   An adversary is \emph{valid} if
914   \begin{itemize}
915   \item for any query to its encryption oracle $E_K(\id{lr}_b(x_0, x_1))$ we
916     have $|x_0| = |x_1|$, and
917   \item no query to the decryption oracle $D_K(\cdot)$ is equal to any reply
918     from an encryption query.
919   \end{itemize}
920   If $A$ is valid, then we define its \emph{advantage} in attacking the
921   security of $\E$ as follows
922   \[ \Adv{ind-cca}{\E} = P_1 - P_0. \]
923   Further, we define the \emph{IND-CCA insecurity function of $\E$} to be
924   \[ \InSec{ind-cca}(\E; t, q_E, q_D) = \max_A \Adv{ind-cca}{\E}(A) \]
925   where the maximum is taken over all valid adversaries $A$ which run in time
926   $t$, and issue at most $q_E$ encryption and $q_D$ decryption queries.
927 \end{definition}
928
929
930 \subsection{Simulations}
931 \label{sec:sim}
932
933 In section~\ref{sec:zk-ident}, we shall prove that our identification
934 protocol is zero-knowledge; in section~\ref{sec:denial}, we show that our
935 key-exchange protocol is deniable.  In both of these proofs, we shall need to
936 demonstrate \emph{simulatability}.
937
938 \ifshort
939
940 We consider an adversary~$A$ interacting with a `world'~$W$; we model both as
941 probabilistic algorithms.  Both $A$ and~$W$ are given a common input~$c$; the
942 world is additionally given a private input~$w$; these are chosen by a
943 randomized initialization function $I$.  The adversary is additionally given
944 an auxiliary input~$u$ computed from $w$ by a randomized algorithm~$U$.  All
945 these algorithms -- the adversary and the world, but also the initialization
946 and auxiliary-input algorithms $I$ and~$U$ -- have access to a number of
947 random oracles $\mathcal{H} = (H_0, H_1, \ldots, H_{n-1})$.  The adversary
948 eventually decides to stop interacting, and produces an output~$a$.
949
950 A \emph{simulator} for $A$'s interaction with $W$ is an algorithm $S^A$ which
951 attempts to produce a similar output distribution, but without interacting
952 with $W$.  The simulator is given the same inputs $(c, u)$ as we gave
953 to~$A$, and $S$ is also allowed to query the random oracles~$\mathcal{H}$.
954
955 To measure the effectiveness of a simulator, we consider a distinguisher~$D$
956 which is given $(c, u, a)$, and access to $\mathcal{H}$, and returns a bit
957 $b$ representing its verdict as to whether the output $a$ was produced by the
958 adversary or the simulator.
959
960 \else
961
962 \subsubsection{General framework}
963 Consider a game in which an adversary~$A$ interacts with some `world'~$W$,
964 which we shall represent as a probabilistic algorithm.  The world may in fact
965 represent a number of honest parties communicating in a concurrent fashion,
966 but we can consider them as a single algorithm for our present purposes.
967
968 Initially the world and the adversary are both given the same \emph{common
969 input}~$c$; in addition, the world is given a \emph{private input}~$w$.
970 Both $c$ and~$w$ are computed by an \emph{initialization function}~$I$, which
971 is considered to be part of the definition of the game.  Finally, the
972 adversary decides somehow that it has finished interacting, and outputs a
973 value~$a$.  All this we notate as
974 \[ (w, c) \gets I(); a \gets A^{W(w, c)}(c). \]
975 This game is \emph{simulatable} if there is an algorithm~$S$ -- the
976 \emph{simulator} -- which can compute the same things as~$A$, but all by
977 itself without interacting with the world.  That is, we run the simulator on
978 the common input~$c$, allowing it to interact in some way with the
979 adversary~$A$, and finally giving us an output~$s$.
980 \[ (w, c) \gets I(); s \gets S^A(c). \]
981 We shall say that the simulator is \emph{effective} if it's difficult to tell
982 whether a given string was output by the adversary after interacting with the
983 world, or by the simulator running by itself.  That is, for any algorithm~$D$
984 -- a \emph{distinguisher} -- running in some bounded amount of time, its
985 advantage
986 \begin{spliteqn*}
987   \Pr[(w, c) \gets I(); a \gets A^{W(w, c)}(c);
988         b \gets D(c, a) : b = 1] - {} \\
989   \Pr[(w, c) \gets I(); s \gets S^A(c); b \gets D(c, s) : b = 1]
990 \end{spliteqn*}
991 is small.  (Note that we gave the distinguisher the common input as well as
992 the output of the adversary or the simulator.)
993
994 It's usual to study \emph{transcripts} of interactions in these kinds of
995 settings.  We are considering arbitrary adversarial outputs here, so this
996 certainly includes adversaries which output a transcript of their
997 interactions.  Indeed, for any adversary~$A$, we could construct an
998 adversary~$A_T$ which performs the same computation, and outputs the same
999 result, but also includes a complete transcript of $A$'s interaction with the
1000 world.  Therefore we're just providing additional generality.
1001
1002 \subsubsection{Random oracles}
1003 We shall be considering interactions in which all the parties have access to
1004 several random oracles.  We could simply say that the random oracles are part
1005 of the world~$W$.  In the setting described above, only the adversary
1006 actually interacts with the world (and therefore would be able to query
1007 random oracles).  The simulator would be forced to `make up' its own random
1008 oracle, and the distinguisher would have to study the distributions of the
1009 random-oracle queries and their responses to make up its mind about which it
1010 was given.
1011
1012 However, this would be a poor model for the real world, since once we
1013 instantiate the random oracle with a hash function, we know that everyone
1014 would in actually be able to compute the hash function for themselves.  Thus
1015 a distinguisher in the real world would be able to tell the difference
1016 immediately between a real interaction and the simulated transcript, since
1017 the `random oracle' queries recorded in the latter would be wrong!
1018
1019 Therefore we decide not to include the random oracles as part of the world,
1020 but instead allow all the participants -- adversary, simulator and
1021 distinguisher -- access to them.  If we denote by~$\mathcal{H} = (H_0, H_1,
1022 \ldots, H_{n-1})$ the collection of random oracles under consideration, the
1023 expression for the distinguisher's advantage becomes
1024 \begin{spliteqn*}
1025   \Pr[(w, c) \gets I(); a \gets A^{W(w, c), \mathcal{H}}(c);
1026         b \gets D^{\mathcal{H}}(c, a) : b = 1] - {} \\
1027   \Pr[(w, c) \gets I(); s \gets S^{A, \mathcal{H}}(c);
1028         b \gets D^{\mathcal{H}}(c, s) : b = 1].
1029 \end{spliteqn*}
1030
1031 \subsubsection{Auxiliary inputs}
1032 If an adversary's output can be effectively simulated, then we can
1033 confidently state that the adversary `learnt' very little of substance from
1034 its interaction, and certainly very little it can \emph{prove} to anyone
1035 else.  However, as we have described the setting so far, we fix an adversary
1036 before we choose inputs to the world, so our model says little about what an
1037 adversary which has already acquired some knowledge might learn beyond that.
1038 For example, an adversary might overhear some other conversation between
1039 honest parties and be able to use this to its advantage.
1040
1041 To this end, we give the adversary an \emph{auxiliary input}~$u$, computed by
1042 an algorithm~$U$.  We give $U$ both $c$ and $w$, in order to allow the
1043 adversary to gain some (possibly partial) knowledge of the secrets of the
1044 other parties.  We also allow $U$ access to the random oracles~$\mathcal{H}$,
1045 because clearly in the `real world' it would be ridiculous to forbid such an
1046 algorithm from computing a publicly-known hash function.
1047
1048 The simulator and distinguisher are also given the auxiliary input.  The
1049 simulator is meant to represent the adversary's ability to compute things on
1050 its own, without interacting with the world, and since the adversary is given
1051 the auxiliary input, the simulator must be too.  The distinguisher must be
1052 given the auxiliary input because otherwise the simulator could just `make
1053 up' plausible-looking inputs.
1054
1055 \fi
1056
1057 \ifshort
1058 Because we're interested in a concrete, quantitative analysis, we must
1059 constrain the resource usage of the various algorithms described above.
1060 Specifically, we shall be interested in
1061 \else
1062
1063 \subsubsection{Resource limits}
1064 We shall not allow our algorithms to perform completely arbitrary
1065 computations and interactions.  Instead, we impose limits on the amount of
1066 time they are allowed to take, the number of random-oracle queries they make,
1067 and so on.  Specifically, we are interested in
1068 \fi
1069 \begin{itemize}
1070 \item the time $t_A$ taken by the adversary and $t_D$ taken by the
1071   distinguisher,
1072 \item the number of oracle queries $\mathcal{Q}_A = (q_{A,0}, q_{A,1},
1073   \ldots, q_{A,n-1})$ made by the adversary, and $\mathcal{Q}_D$ made by the
1074   distinguisher,
1075 \item a number of resource bounds $\mathcal{R}$ on the adversary's
1076   interaction with the world (e.g., number of messages of various kinds sent
1077   and received), and
1078 \item a number of bounds $\mathcal{U}$ on the contents of the adversary's
1079   auxiliary input~$u$.
1080 \end{itemize}
1081 Sometimes we shall not be interested in proving simulatability of adversaries
1082 with auxiliary inputs.  We write $\mathcal{U} = 0$ to indicate that auxiliary
1083 input is not allowed.
1084
1085 \ifshort\else
1086
1087 \subsubsection{World syntax}
1088 It will be worth our while being more precise about what a `world' actually
1089 is, syntactically.  We define a world to be a single, randomized algorithm
1090 taking inputs $(\iota, \sigma, \tau, \mu) \in (\Bin^*)^4$; the algorithm's
1091 output is a pair $(\sigma', \rho) \in (\Bin^*)^2$.  We show how the
1092 adversary's interaction is mapped on to this world algorithm in
1093 figure~\ref{fig:sim-world}.
1094 \begin{itemize}
1095 \item The `input' $\iota$ is the result of the initialization function~$I$.
1096   That is, it is the pair $(w, c)$ of the world's private input and the
1097   common input.
1098 \item The `state' $\sigma$ is empty on the world's first invocation; on each
1099   subsequent call, the value of the world's output $\sigma'$ is passed back.
1100   In this way, the world can maintain state.
1101 \item The `type $\tau$ is a token giving the type of invocation this is.
1102 \item The `message' $\mu$ is any other information passed in; its form will
1103   typically depend on the type~$\tau$ of the invocation.
1104 \item The `new state' $\sigma'$ is the value of $\sigma$ to pass to the next
1105   invocation of the world.
1106 \item The `reply $\rho$ is the actual output of the invocation.
1107 \end{itemize}
1108 There are two special invocation types.  The adversary is \emph{forbidden}
1109 from making special invocations.
1110 \begin{itemize}
1111 \item The special invocation type $\cookie{init}$ is used to allow the world to
1112   prepare an initial state.  The world is invoked as
1113   \[ W^{\mathcal{H}}(\iota, \emptystring, \cookie{init}, \emptystring) \]
1114   and should output an initial state $\sigma'$.  The world's reply $\rho$ is
1115   ignored.  (Recall that $\emptystring$ represents the empty string.)
1116 \item The special invocation type $\cookie{random}$ is used to inform the
1117   world that the adversary has issued a random oracle query.  The world is
1118   invoked as
1119   \[ W^{\mathcal{H}}(\iota, \sigma, \cookie{random}, (i, x, h)) \]
1120   to indicate that the adversary has queried its random oracle $H_i(\cdot)$
1121   on the input $x$, giving output~$h$.  The world may output an updated state
1122   $\sigma'$; its reply $\rho$ is ignored.
1123 \end{itemize}
1124 The latter special query is a technical device used to allow the `fake-world'
1125 simulators we define below to be aware of the adversary's random oracle
1126 queries without being able to `program' the random oracle.  Including it here
1127 does little harm, and simplifies the overall exposition.
1128
1129 \begin{figure}
1130   \begin{program}
1131     Interaction $A^{W(w, c), \mathcal{H}}(c, u)$: \+ \\
1132       $(\sigma, \rho) \gets
1133         W((w, c), \emptystring, \cookie{init}, \emptystring)$; \\
1134       $a \gets A^{\id{world}(\cdot, \cdot),
1135                   \id{random}(\cdot, \cdot)}(c, u)$; \\
1136       \RETURN $a$;
1137     \newline
1138     Function $\id{world}(\tau, \mu)$: \+ \\
1139       \IF $\tau \in \{\cookie{init}, \cookie{random}\}$ \THEN
1140         \RETURN $\bot$; \\
1141       $(\sigma, \rho) \gets W((w, c), \sigma, \tau, \mu)$; \\
1142       \RETURN $\rho$; \-
1143     \next
1144     Function $\id{random}(i, x)$: \+ \\
1145       $h \gets H_i(x)$; \\
1146       $(\sigma, \rho) \gets
1147         W((w, c), \sigma, \cookie{random}, (i, x, h))$; \\
1148       \RETURN $h$;
1149   \end{program}
1150
1151   \caption{Interacting with a world: Interaction $A^{W, \mathcal{H}}$}
1152   \label{fig:sim-world}
1153 \end{figure}
1154
1155 \subsubsection{Definitions}
1156 We are now ready to begin making definitions.
1157 \fi
1158
1159 \begin{definition}[Simulation security]
1160   \label{def:sim}
1161   Consider the game described above, with the initialization function~$I$,
1162   and the world~$W$: let $A$ be an adversary, and let~$U$ be an
1163   auxiliary-input function; let $S$ be a simulator, and let $D$ be a
1164   distinguisher.  We define $D$'s \emph{advantage against $S$'s simulation of
1165     $A$'s interaction with~$W$ with auxiliary inputs provided by~$U$} to be
1166   \[ \Adv{sim}{W, I, S}(A, U, D) =
1167        \Pr[\Game{real}{W, I, S}(A, U, D) = 1] -
1168        \Pr[\Game{sim}{W, I, S}(A, U, D)= 1]
1169   \]
1170   where the games are as shown in figure~\ref{fig:sim}.
1171   Furthermore, we define the \emph{simulator's insecurity function} to be
1172   \[ \InSec{sim}(W, I, S;
1173       t_D, t_A, \mathcal{Q}_D, \mathcal{Q}_A, \mathcal{R}, \mathcal{U}) =
1174       \max_{D, A, U} \Adv{sim}{W, I, S}(A, U, D)
1175   \]
1176   where the maximum is taken over all distinguishers~$D$ running in
1177   time~$t_D$ and making at most $\mathcal{Q}_D$ random-oracle queries, and
1178   all adversaries~$A$ running in time~$t_A$, making at most $\mathcal{Q}_A$
1179   random-oracle queries, not exceeding the other stated resource
1180   bounds~$\mathcal{R}$ on its interaction with~$W$, and auxiliary-input
1181   functions producing output not exceeding the stated bounds~$\mathcal{U}$.
1182 \end{definition}
1183 \begin{remark}
1184   The usual definitions of zero-knowledge, for example, require the simulator
1185   to work for all choices of inputs (common, private and auxiliary), rather
1186   than for random choices.  Our definition therefore looks weaker.  Our proof
1187   of zero-knowledge actually carries through to the traditional
1188   stronger-looking definition.  Critically, however, the standard
1189   universal quantification over inputs fails to capture deniability in the
1190   random oracle model, since the inputs can't therefore depend on the random
1191   oracle.  Our formulation therefore actually gives \emph{stronger}
1192   deniability than the usual one.
1193 \end{remark}
1194
1195 \begin{figure}
1196   \begin{program}
1197     $\Game{real}{W, I, S}(A, U, D)$: \+ \\
1198       $(w, c) \gets I()$; \\
1199       $u \gets U^{\mathcal{H}}(w, c)$; \\
1200       $a \gets A^{W(w, c), \mathcal{H}}(c, u)$; \\
1201       $b \gets D^{\mathcal{H}}(c, u, a)$; \\
1202       \RETURN $b$;
1203     \next
1204     $\Game{sim}{W, I, S}(A, U, D)$: \+ \\
1205       $(w, c) \gets I()$; \\
1206       $u \gets U^{\mathcal{H}}(w, c)$; \\
1207       $s \gets S^{A, \mathcal{H}}(c, u)$; \\
1208       $b \gets D^{\mathcal{H}}(c, u, s)$; \\
1209       \RETURN $b$;
1210   \end{program}
1211
1212   \caption{Games for simulation: $\Game{real}{W, I}$ and $\Game{sim}{W, I}$}
1213   \label{fig:sim}
1214 \end{figure}
1215
1216 \ifshort\else
1217 \subsubsection{Fake-world simulators}
1218 The simulators we shall be considering in the present paper are of a specific
1219 type which we call `fake-world simulators'.  They work by running the
1220 adversary in a fake `cardboard cut-out' world, and attempting to extract
1221 enough information from the adversary's previous interactions and random
1222 oracle queries to maintain a convincing illusion.
1223
1224 That is, the behaviour of a fake-world simulator~$S$ is simply to allow the
1225 adversary to interact with a `fake world'~$W'$, which was not given the world
1226 private input.  That is, there is some world $W'$ such that
1227 \[ S^{A, \mathcal{H}}(c, u) \equiv A^{W'(u, c), \mathcal{H}}(c, u) \]
1228 Fake-world simulators are convenient because they allow us to remove from
1229 consideration the distinguisher~$D$ as the following definition shows.
1230 \begin{definition}[Fake-world simulation security]
1231   \label{def:fakesim}
1232   Let $I$, $W$ and $U$ be as in definition~\ref{def:sim}.  Let $A$ be an
1233   adversary which outputs a single bit.  Let $S$ be a fake-world simulator.
1234   We define $A$'s \emph{advantage against $S$'s fake-world simulation of $W$
1235   with auxiliary inputs provided by~$U$} to be
1236   \begin{spliteqn*}
1237     \Adv{fw}{W, I, S}(A, U) =
1238       \Pr[(w, c) \gets I(); u \gets U^{\mathcal{H}}(w, c);
1239            b \gets A^{W(w, c), \mathcal{H}}(c, u) : b = 1] - {} \\
1240        \Pr[(w, c) \gets I(); u \gets U^{\mathcal{H}}(w, c);
1241            b \gets S^{A, \mathcal{H}}(c, u) : b = 1]
1242   \end{spliteqn*}
1243   Furthermore, we define the \emph{simulator's insecurity function} to be
1244   \[ \InSec{fw}(W, I, S;
1245       t_D, t, \mathcal{Q}, \mathcal{R}, \mathcal{U}) =
1246       \max_{A, U} \Adv{fw}{W, I, S}(A, U)
1247   \]
1248   where the maximum is taken over all adversaries~$A$ running in time~$t$,
1249   making at most $\mathcal{Q}$ random-oracle queries, not exceeding the other
1250   stated resource bounds~$\mathcal{R}$ on its interaction with~$W$, and
1251   auxiliary-input functions producing output not exceeding the stated
1252   bounds~$\mathcal{U}$.
1253 \end{definition}
1254 It remains for us to demonstrate that this is a valid way of analysing
1255 simulators; the following simple proposition shows that this is indeed the
1256 case.
1257 \begin{proposition}[Fake-world simulation]
1258   \label{prop:fakesim}
1259   Let $I$ be an initialization function and let $W$ be a world.  Then, for
1260   any fake-world simulator~$S$,
1261   \[ \InSec{sim}(W, I, S; t_D, t_A, \mathcal{Q}_D, \mathcal{Q}_A,
1262        \mathcal{R}, \mathcal{U}) \le
1263      \InSec{fw}(W, I, S; t_A + t_D, \mathcal{Q}_D + \mathcal{Q}_A,
1264        \mathcal{R}, \mathcal{U})
1265   \]
1266   (where addition of query bounds $\mathcal{Q}$ is done elementwise).
1267 \end{proposition}
1268 \begin{proof}
1269   Let $W$ and $I$ as in the proposition statement be given; also let a
1270   distinguisher~$D$ running in time~$t_D$ and making $\mathcal{Q}_D$
1271   random-oracle queries, an adversary~$A$ running in time~$t_A$ and making
1272   $\mathcal{Q}_A$ random-oracle queries and interacting with its world within
1273   the stated bounds~$\mathcal{R}$, an auxiliary-input function~$U$ satisfying
1274   the constraints~$\mathcal{U}$ on its output, and a fake-world simulator~$S$
1275   all be given.
1276
1277   We construct an adversary~$B$ outputting a single bit as follows
1278   \begin{program}
1279     Adversary $B^{W, \mathcal{H}}(c, u)$: \+ \\
1280       $a \gets A^{W, \mathcal{H}}(c, u)$; \\
1281       $b \gets D^{\mathcal{H}}(c, u, a)$; \\
1282       \RETURN $b$;
1283   \end{program}
1284   A glance at definitions \ref{def:sim} and~\ref{def:fakesim} and the
1285   resources used by $B$ shows that
1286   \[ \Adv{sim}{W, I, S}(A, U) = \Adv{fw}{W, I, S}(B, U)
1287       \le \InSec{fw}(W, I, S;  t_D + t_A, \mathcal{Q}_D + \mathcal{Q}_A,
1288        \mathcal{R}, \mathcal{U})
1289   \]
1290   as required.
1291 \end{proof}
1292 \fi
1293
1294 %%%--------------------------------------------------------------------------
1295
1296 \section{A zero-knowledge identification scheme}
1297 \label{sec:zk-ident}
1298
1299
1300 \subsection{Description}
1301
1302 Here we present a simple zero-knowledge identification scheme.  Fix some
1303 group $G$ with prime order $q = \#G$.  Suppose Alice chooses a private key $x
1304 \inr \gf{q}$, and publishes the corresponding public key $X = x P$.  Let
1305 $H_I\colon G^2 \to \Bin^{\ell_I}$ be a secure hash function.  Here's a simple
1306 protocol which lets her prove her identity to Bob.
1307 \begin{enumerate}
1308 \item Bob selects a random $r \inr \gf{q}$, and computes $R = r P$, $Y = r X$,
1309   and $c = r \xor H_I(R, Y)$.  He sends the pair $(R, c)$ to Alice as his
1310   \emph{challenge}.
1311 \item Alice receives $(R, c)$.  She computes $Y' = x R$ and $r' = c \xor
1312   H_I(R', Y')$, and checks that $R = r' P$.  If so, she sends $Y'$ as her
1313   \emph{response}; otherwise she sends $\bot$.
1314 \item Bob receives $Y'$ from Alice.  He checks that $Y' = Y$.  If so, he
1315   accepts that he's talking to Alice; otherwise he becomes suspicious.
1316 \end{enumerate}
1317 We name this the Wrestlers Identification Protocol in~$G$, $\Wident^G$ (we
1318 drop the superscript to refer to the protocol in general, or when no
1319 ambiguity is likely to result).  A summary is shown in
1320 figure~\ref{fig:wident}.
1321
1322 \begin{figure}
1323   \begin{description}
1324   \item[Setup] Group $G = \langle P \rangle$; $\#G = q$ is prime.
1325     $H_I(\cdot, \cdot)$ is a secure hash.
1326   \item[Private key] $x \inr \gf{q}$.
1327   \item[Public key] $X = x P$.
1328   \item[Challenge] $(R, c)$ where $r \inr \gf{q}$, $R = r P$, $c = r \xor
1329     H_I(R, r X)$.
1330   \item[Response] $x R = r X$ if $R = (c \xor H_I(R, x R)) P$; otherwise
1331     $\bot$.
1332   \end{description}
1333
1334   \caption{Summary of the Wrestlers Identification Protocol, $\Wident$}
1335   \label{fig:wident}
1336 \end{figure}
1337
1338
1339 \subsection{Security}
1340
1341 In order to evaluate the security of our protocol, we present a formal
1342 description of the algorithms involved in figure~\ref{fig:wident}.  Here, the
1343 hash function $H_I(\cdot, \cdot)$ is modelled as a random oracle.
1344
1345 \begin{figure}
1346   \begin{program}
1347     Function $\id{setup}()$: \+ \\
1348       $x \getsr \gf{q}$; \\
1349       $X \gets x P$; \\
1350       \RETURN $(x, X)$;
1351     \ifshort\newline\else\next\fi
1352     Function $\id{challenge}^{H_I(\cdot, \cdot)}(R, c, X)$: \+ \\
1353       $r \getsr \gf{q}$; \\
1354       $R \gets r P$; $Y \gets r X$; \\
1355       $h \gets H_I(R, Y)$; $c \gets r \xor h$; \\
1356       \RETURN $(Y, R, c)$; \- \\[\medskipamount]
1357     Function $\id{verify}(Y, Y')$: \+ \\
1358       \IF $Y' = Y$ \THEN \RETURN $1$; \\
1359       \RETURN $0$;
1360     \next
1361     Function $\id{response}^{H_I(\cdot, \cdot)}(R, c, x)$: \+ \\
1362       $Y' \gets x R$; \\
1363       $h \gets H_I(R', Y')$; $r' \gets c \xor h$; \\
1364       \IF $R \ne r' P$ \THEN \RETURN $\bot$; \\
1365       \RETURN $Y'$;
1366   \end{program}
1367
1368   \caption{Functions implementing $\Wident$ in the random oracle model}
1369   \label{fig:wident-ro}
1370 \end{figure}
1371
1372 \subsubsection{Completeness}
1373 Suppose that Bob really is talking to Alice.  Note that $Y' = x R = x (r P) =
1374 r (x P) = r X = Y$.  Hence $r' = c \xor H_I(R', Y') = c \xor H_I(R, Y) = r$,
1375 so $r' P = r P = R$, so Alice returns $Y' = Y$ to Bob.  Therefore $\Wident$
1376 is \emph{complete}: if Bob really is communicating with Alice then he
1377 accepts.
1378
1379 \subsubsection{Soundness}
1380 We next show that impersonating Alice is difficult.  The natural way to prove
1381 this would be to give an adversary a challenge and prove that its probability
1382 of giving a correct response is very small.  However, we prove a stronger
1383 result: we show that if the adversary can respond correctly to any of a large
1384 collection of challenges then it can solve the MCDH problem.
1385
1386 Consider the game $\Game{imp}{\Wident}$ shown in
1387 figure~\ref{fig:wident-sound}.  An adversary's probability of successfully
1388 impersonating Alice in our protocol, by correctly responding to any one of
1389 $n$ challenges, is exactly its probability of winning the game (i.e., causing
1390 it to return $1$).
1391
1392 \begin{figure}
1393   \begin{program}
1394     $\Game{imp-$n$}{\Wident}(A)$: \+ \\
1395       $H_I \getsr \Func{G^2}{\Bin^{\ell_I}}$; \\
1396       $(x, X) \gets \id{setup}()$; \\
1397       $\id{win} \gets 0$; \\
1398       $\Xid{R}{map} \gets \emptyset$; \\
1399       $\mathbf{c} \gets \id{challenges}(n)$; \\
1400       $(R', Y') \gets A^{H_I(\cdot, \cdot), \id{check}(\cdot, \cdot)}
1401         (X, \mathbf{c})$; \\
1402       \RETURN $\id{win}$;
1403     \newline
1404     Function $\id{challenges}(n)$: \+ \\
1405       \FOR $i \in \Nupto{n}$ \DO \\ \ind
1406         $(Y, R, c) \gets \id{challenge}^{H_I(\cdot, \cdot)}$; \\
1407         $\Xid{R}{map} \gets \Xid{R}{map} \cup \{ R \mapsto Y \}$; \\
1408         $\mathbf{c}[i] \gets (R, c)$; \- \\
1409       \RETURN $\mathbf{c}$; \next
1410     Function $\id{check}(R', Y')$: \\
1411       \IF $R' \notin \dom \Xid{R}{map}$ \THEN \RETURN $0$; \\
1412       $Y \gets \Xid{R}{map}(R')$; \\
1413       \IF $\id{verify}(Y, Y')$ \THEN \\ \ind
1414         $\id{win} \gets 1$; \\
1415         \RETURN $1$; \- \\
1416       \RETURN $0$;
1417   \end{program}
1418
1419   \caption{Soundness of $\Wident$: $\Game{imp-$n$}{\Wident}(A)$}
1420   \label{fig:wident-sound}
1421 \end{figure}
1422
1423 \begin{theorem}[Soundness of $\Wident$]
1424   \label{thm:wident-sound}
1425   Let $A$ be any adversary running in time $t$ and making $q_I$ queries to
1426   its random oracle, and $q_V$ queries to its verification oracle.  Let $G$
1427   be a cyclic group.  Then
1428   \[ \Pr[\Game{imp-$n$}{\Wident^G}(A) = 1] \le
1429      \InSec{mcdh}(G; t', q_I + q_V)
1430   \]
1431   where $t' = t + O(q_I) + O(q_V)$.
1432 \end{theorem}
1433 \begin{remark}
1434   Note that the security bound here is \emph{independent} of the value of
1435   $n$.
1436 \end{remark}
1437 \begin{longproof}{The proof of this theorem can be found in the full version
1438     of the paper.}
1439   We prove this by defining a sequence of games $\G{i}$.  The first will be
1440   the same as the attack game $\Game{imp-$n$}{\Wident}(A)$ and the others
1441   will differ from it in minor ways.  In each game $\G{i}$, let $S_i$ be the
1442   event that $A$ wins the game -- i.e., that it successfully impersonates the
1443   holder of the private key~$x$.
1444
1445   Let game $\G0$ be the attack game $\Game{imp}{\Wident}(A)$, and let $(R',
1446   Y')$ be the output of $A$ in the game.
1447
1448   We define a new game $\G1$ which is the same as $\G0$, except that we query
1449   the random oracle $H_I$ at $(R', Y')$ whenever the adversary queries
1450   $\id{check}(R', Y')$.  (We don't charge the adversary for this.)  This
1451   obviously doesn't affect the adversary's probability of winning, so
1452   $\Pr[S_1] = \Pr[S_0]$.
1453
1454   Game $\G2$ is like $\G1$, except that we change the way we generate
1455   challenges and check their responses.  Specifically, we new functions
1456   $\id{challenges}_2$ and $\id{check}_2$, as shown in
1457   figure~\ref{fig:wident-sound-2}.
1458
1459   \begin{figure}
1460     \begin{program}
1461       Function $\id{challenges}_2(n)$: \+ \\
1462         $r^* \getsr I$; $R^* \gets r^* P$; $Y^* \gets r^* X$; \\
1463         \FOR $i \in \Nupto{n}$ \DO \\ \ind
1464           $r \getsr I$; $R \gets r R^*$; $Y \gets r Y^*$; \\
1465           $h \gets H_I(R, Y)$; $c \gets r \xor h$; \\
1466           $\Xid{R}{map} \gets \Xid{R}{map} \cup \{ R \mapsto r \}$; \\
1467           $\mathbf{c}[i] \gets (R, c)$; \- \\
1468         \RETURN $\mathbf{c}$;
1469       \next
1470       Function $\id{check}_2(R', Y')$: \+ \\
1471         \IF $R' \notin \dom \Xid{R}{map}$ \THEN \RETURN $0$; \\
1472         $r \gets \Xid{R}{map}(R')$; \\
1473         \IF $\id{verify}(Y^*, Y'/r)$ \THEN \\ \ind
1474           $\id{win} \gets 1$; \\
1475           \RETURN $1$; \- \\
1476         \RETURN $0$;
1477     \end{program}
1478
1479     \caption{Soundness of $\Wident$: $\id{challenges}_2$ and $\id{check}_2$}
1480     \label{fig:wident-sound-2}
1481   \end{figure}
1482
1483   While we're generating and checking challenges in a more complicated way
1484   here, we're not actually changing the distribution of the challenges, or
1485   changing the winning condition.  Hence $\Pr[S_2] = \Pr[S_1]$.
1486
1487   Now we change the rules again.  Let $\G3$ be the same as $\G2$ except that
1488   we change the winning condition.  Instead, we say that the adversary wins
1489   if any of the queries to its random oracle $H_I(R', Y')$ would be a correct
1490   response -- i.e., $\id{check}_2(R', Y')$ would return $1$.  Since we query
1491   the oracle on $(R', Y')$ on its behalf at the end of the game, no adversary
1492   can do worse in this game than it does in $\G2$, so we have $\Pr[S_3] \ge
1493   \Pr[S_2]$.  (It's not hard to see that this only helps quite stupid
1494   adversaries.  We can transform any adversary into one for which equality
1495   holds here.)
1496
1497   Finally, let $\G4$ be the same as $\G3$ except that we change the way we
1498   generate challenges again: rather than computing $h$ and setting $c \gets h
1499   \xor r$, we just choose $c$ at random.  Specifically, we use the new
1500   function, $\id{challenges}_4$, shown in figure~\ref{fig:wident-sound-4}.
1501
1502   \begin{figure}
1503     \begin{program}
1504       Function $\id{challenges}_4(n)$: \+ \\
1505         $r^* \getsr I$; $R^* \gets r^* P$; $Y^* \gets r^* X$; \\
1506         \FOR $i \in \Nupto{n}$ \DO \\ \ind
1507           $r \getsr I$; $R \gets r R^*$; \\
1508           $c \getsr \Bin^{\ell_I}$; \\
1509           $\Xid{R}{map} \gets \Xid{R}{map} \cup \{ R \mapsto r \}$; \\
1510           $\mathbf{c}[i] \gets (R, c)$; \- \\
1511         \RETURN $\mathbf{c}$;
1512     \end{program}
1513
1514     \caption{Soundness of $\Wident$: $\id{challenges}_4$}
1515     \label{fig:wident-sound-4}
1516   \end{figure}
1517
1518   Since $H_I(\cdot, \cdot)$ is a random function, the adversary can only
1519   distinguish $\G4$ from $\G3$ if it queries its random oracle at some $(R, r
1520   Y^*)$.  But if it does this, then by the rule introduced in $\G3$ it has
1521   already won.  Therefore we must have $\Pr[S_4] = \Pr[S_3]$.
1522
1523   Our $\id{challenges}_4$ function is interesting, since it doesn't actually
1524   make use of $r^*$ or $Y^*$ when generating its challenges.  This gives us
1525   the clue we need to bound $\Pr[S_4]$: we can use adversary $A$ to solve the
1526   multiple-guess Diffie-Hellman problem in $G$ by simulating the game $\G4$.
1527   Specifically, we define the adversary $B$ as shown in
1528   figure~\ref{fig:wident-sound-cdh}.  That is, for each query $A$ makes to
1529   its random oracle at a new pair $(R', Y')$, we see whether this gives us
1530   the answer we're looking for.  We have $\Pr[S_0] \le \Pr[S_4] =
1531   \Succ{mcdh}{G}(B) \le \InSec{gdh}(G; t', q_I + q_V)$ as required.
1532
1533   \begin{figure}
1534     \begin{program}
1535       Adversary $B^{V(\cdot)}(X, R^*)$: \+ \\
1536         $F \gets \emptyset$; $\Xid{R}{map} \gets \emptyset$; \\
1537         \FOR $i \in \Nupto{n}$ \DO \\ \ind
1538           $r \getsr I$; $R \gets r R^*$; $c \getsr \Bin^{\ell_I}$; \\
1539           $\Xid{R}{map} \gets \Xid{R}{map} \cup \{ R \mapsto r \}$; \\
1540           $\mathbf{c}[i] \gets (R, c)$; \- \\
1541         $(R', Y') \gets A^{H_I(\cdot, \cdot), \id{check}(\cdot, \cdot)}
1542           (X, \mathbf{c})$; \\
1543         \IF $Y' \neq \bot$ \THEN $H_I(R', Y')$;
1544       \next
1545       Oracle $H_I(R', Y')$: \+ \\
1546         \IF $(R', Y') \in \dom F$ \THEN \\ \quad
1547           $h \gets F(x)$; \\
1548         \ELSE \\ \ind
1549           $\id{check}(R', Y')$; \\
1550           $h \getsr \Bin^{\ell_I}$;
1551           $F \gets F \cup \{ (R', Y') \mapsto h \}$; \- \\
1552         \RETURN $h$;
1553       \- \\[\medskipamount]
1554       Oracle $\id{check}(R', Y')$: \+ \\
1555         \IF $R' \in \dom \Xid{R}{map}$ \THEN
1556           $V(Y'/\Xid{R}{map}(R'))$;
1557     \end{program}
1558
1559     \caption{Soundness of $\Wident$: reduction from MCDH}
1560     \label{fig:wident-sound-cdh}
1561   \end{figure}
1562 \end{longproof}
1563
1564 \subsubsection{Zero-knowledge}
1565 Finally we must prove that $\Wident$ is (statistical) zero-knowledge -- i.e.,
1566 that, except with very small probability, Bob learns nothing of use to him
1567 except that he's interacting with Alice.  To do this, we show that, for any
1568 algorithm $B$ which Bob might use to produce his challenge to the real Alice,
1569 there exists a simulator $S$ which produces transcripts distributed very
1570 similarly to transcripts of real conversations between $B$ and Alice, the
1571 difference being that $S$ doesn't know Alice's key.  We shall show that the
1572 statistical difference between the two distributions is $2^{-\ell_I}$.
1573
1574 The intuition here is that Bob ought to know what answer Alice is going to
1575 give him when he constructs his challenge.  This is certainly true if he's
1576 honest: his challenge is $R = r P$ for some $r$ he knows, so he won't learn
1577 anything useful when Alice responds with $x R = r X$.  However, if Bob sends
1578 a challenge $R$ when he doesn't know the corresponding $r$, he learns
1579 something potentially useful.  The accompanying check value $c = r \xor
1580 H_I(R, r X)$ keeps him honest.
1581
1582 To show this, we present an \emph{extractor} which, given any challenge $(R,
1583 c)$ Bob can construct, and his history of random-oracle queries, either
1584 returns a pair $(r, Y)$ such that $R = r P$ and $Y = r X$, or $\bot$;
1585 moreover, the probability that Alice returns a response $Y' \ne \bot$ given
1586 the challenge $(R, c)$ is $2^{-\ell}$.  We can, of course, readily convert
1587 this extractor into a simulator to prove the zero-knowledge property of our
1588 protocol.
1589
1590 We shall actually consider a slightly more complex setting.  We grant Bob
1591 access to an oracle which produces random, correctly-formed challenges.  We
1592 require this to model the legitimate challenges of other parties when we
1593 analyse the security of our key exchange protocol.
1594
1595 \begin{definition}[Discrete-log extractors]
1596   Let $T$, $B$ be randomized algorithms.  Define the game
1597   $\Game{dl-ext}{G}(T, B)$ as shown in figure~\ref{fig:dlext}.  The
1598   \emph{success probability of $T$ as a discrete-log extractor against $B$}
1599   is defined as
1600   \[ \Succ{dl-ext}{G}(T, B) = \Pr[\Game{dl-ext}{G}(T, B) = 1]. \]
1601 \end{definition}
1602
1603 \begin{figure}
1604   \begin{program}
1605     $\Game{dl-ext}{G}(T, B):$ \+ \\
1606       $H_I \getsr \Func{G^2}{\Bin^{\ell_I}}$;
1607       $Q_H \gets \emptyset$; $Q_C \gets \emptyset$; \\
1608       $(x, X) \gets \id{setup}()$; \\
1609       $(R, c) \gets B^{\Xid{H_I}{trap}(\cdot, \cdot), C()}(x, X)$; \\
1610       $(r, Y) \gets T(R, c, Q_H)$; \\
1611       $Y' \gets x R$; $h' \gets H_I(R, Y')$; $r' \gets c \xor h'$; \\
1612       \IF $r \ne \bot$ \THEN \\ \quad
1613         \IF $Y = \bot \lor R \ne r P \lor Y \ne Y'$ \THEN \RETURN $0$; \\
1614       \IF $R = r' P$ \THEN $(r^*, Y^*) \gets (r', Y')$; \\
1615       \ELSE $(r^*, Y^*) \gets (\bot, \bot)$; \\
1616       \IF $(R, c) \in Q_C$ \THEN \RETURN $1$; \\
1617       \IF $(r, Y) = (r', Y')$ \THEN \RETURN $1$; \\
1618       \RETURN $0$;
1619     \next
1620     Oracle $\Xid{H_I}{trap}(R', Y')$: \+ \\
1621       $h \gets H_I(R', Y')$; \\
1622       $Q_H \gets Q_H \cup \{(R', Y', h)\}$; \\
1623       \RETURN $h$; \- \\[\medskipamount]
1624     Oracle $C()$: \+ \\
1625       $r \getsr \gf{q}$; \\
1626       $R \gets r P$; $c \gets r \xor H_I(R, r X)$; \\
1627       $Q_C \gets Q_C \cup \{(R, c)\}$; \\
1628       \RETURN $(R, c)$
1629   \end{program}
1630
1631   \caption{Discrete log extraction game: $\Game{dl-ext}{G}(T, B)$}
1632   \label{fig:dlext}
1633 \end{figure}
1634
1635 Let's unpack this definition slightly.  We make the following demands of our
1636 extractor.
1637 \begin{itemize}
1638 \item It is given a bare `transcript' of $B$'s execution.  In particular, it
1639   is given only its output and a list of $B$'s random-oracle queries in no
1640   particular order.
1641 \item While the extractor is not given the private key~$x$, the adversary~$B$
1642   is given the private key.
1643 \item We require that, if the extractor produces values $r, Y \ne \bot$ then
1644   $r$ and $Y$ are \emph{correct}; i.e., that $R = r P$ and $Y = x R$.
1645 \item The extractor is explicitly \emph{not} given the outputs of the
1646   challenge-generation oracle $C()$, nor of the random-oracle queries issued
1647   by $C()$.  However, we allow the extractor to fail (i.e., return $\bot$) if
1648   $B$ simply parrots one of its $C$-outputs.
1649 \item The extractor is allowed -- indeed \emph{required} -- to fail if the
1650   challenge $(R, c)$ is \emph{invalid} (i.e., Alice would return $\bot$ given
1651   the challenge).
1652 \end{itemize}
1653 The resulting definition bears a striking similarity to the concept of
1654 \emph{plaintext awareness} in \cite{Bellare:1998:RAN}.
1655
1656 Such an extractor indeed exists, as the following lemma states.
1657 \begin{lemma}[Effectiveness of extractor $T_\Wident$]
1658   \label{lem:dlext}
1659   There exists a \emph{universal discrete-log extractor} $T_\Wident$, shown
1660   in figure~\ref{fig:twident}, such that, for any algorithm $B$,
1661   \[ \Succ{dl-ext}{G}(T_\Wident, B) \ge 1 - \frac{1}{2^{\ell_I}}. \]
1662   Moreover, if $B$ issues at most $q_H$ random-oracle queries, then the
1663   running time of $T_\Wident$ is $O(q_H)$.
1664 \end{lemma}
1665 \ifshort
1666 The proof of this lemma is given in the full version of this paper.
1667 \else
1668 We prove this result at the end of the section.  For now, let us see how to
1669 prove that $\Wident$ is zero-knowledge.
1670 \fi
1671
1672 \begin{figure}
1673   \begin{program}
1674     Extractor $T_\Wident(R, c, Q_H)$: \+ \\
1675       \FOR $(R', Y', h)$ \IN $Q_H$ \DO \\ \ind
1676         $r \gets h \xor c$; \\
1677         \IF $R = R' = r P \land Y' = r X$ \THEN \RETURN $(r, Y')$; \- \\
1678       \RETURN $(\bot, \bot)$;
1679   \end{program}
1680
1681   \caption{The discrete-log extractor $T_\Wident$}
1682   \label{fig:twident}
1683 \end{figure}
1684
1685 We use the set-up described in section~\ref{sec:sim}.  Our initialization
1686 function~$I_\Wident$ just chooses a random $x \in \gf{q}$ as the world
1687 private input and sets $X = x P$ as the common input.  In the `real world',
1688 the adversary is allowed to submit a (single) challenge to the prover; it is
1689 given the prover's response, and must then compute its output.  This is shown
1690 on the left hand side of figure~\ref{fig:wident-sim}.
1691
1692 The zero-knowledge property of the scheme is described by the following
1693 theorem.
1694 \begin{theorem}[Statistical zero-knowledge of $\Wident$]
1695   \label{thm:wident-zk}
1696   Let $I_\Wident$, $W_\Wident$ and $S_\Wident$ be the real-prover world and
1697   simulator shown in figure~\ref{fig:wident-sim}.  Then, for any~$t$,
1698   $q_I$ and $q_C$,
1699   \[ \InSec{sim}(W_\Wident, I_\Wident, S_\Wident; t, q_I, q_C, 0) \le
1700        \frac{q_C}{2^\ell_I}.
1701   \]
1702   where $q_C$ is the maximum number of challenges allowed by the adversary.
1703 \end{theorem}
1704 \begin{longproof}{}
1705   The simulator simply uses the extractor~$T_\Wident$ to extract the answer
1706   from the adversary's history of random oracle queries.  Observe that
1707   $S_\Wident$ is a fake-world simulator.  By lemma~\ref{lem:dlext}, the
1708   extractor fails with probability only $2^{-\ell_I}$.  The theorem follows
1709   by a simple union bound and proposition~\ref{prop:fakesim}.
1710 \end{longproof}
1711
1712 %\ifshort\else
1713 \begin{figure}
1714   \begin{program}
1715     Initialization function $I_\Wident()$: \+ \\
1716       $x \getsr \gf{q}$; \\
1717       $X \gets x P$; \\
1718       \RETURN $(x, X)$;
1719     \- \\[\medskipamount]
1720     Real-prover world $W_\Wident^{H_I(\cdot, \cdot)}
1721         ((x, X), \sigma, \tau, \mu)$: \+ \\
1722       \IF $\tau = \cookie{challenge}$ \THEN \\ \ind
1723         $(R, c) \gets \mu$; \\
1724         $Y \gets \id{response}^{H_I(\cdot, \cdot)}(R, c, x)$; \\
1725         \RETURN $(1, Y)$; \- \\
1726       \ELSE \\ \ind
1727         \RETURN $(\sigma, \bot)$;
1728   \next
1729   Simulator $S_\Wident$'s fake world \\
1730   \hspace{1in} $W_{\text{sim}}^{H_I(\cdot, \cdot)}
1731       ((X, u), \sigma, \tau, \mu)$: \+ \\
1732       \IF $\tau = \cookie{init}$ \THEN \\ \ind
1733         \RETURN $(\emptyset, \emptystring)$; \- \\
1734       $Q_H \gets \sigma$; \\
1735       \IF $\tau = \cookie{challenge}$ \THEN \\ \ind
1736         $(R, c) \gets \mu$; \\
1737         $(r, Y) \gets T_\Wident(R, c, Q_H)$; \\
1738         \RETURN $(Q_H, Y)$; \- \\
1739       \ELSE \IF $\tau = \cookie{random}$ \THEN \\ \ind
1740         $(i, (R', Y'), h) \gets \mu$; \\
1741         $Q_H \gets Q_H \cup \{(R', Y', h)\}$; \\
1742         \RETURN $(Q_H, \emptystring)$; \- \\
1743       \ELSE \\ \ind
1744         \RETURN $(\sigma, \bot)$;
1745   \end{program}
1746
1747   \caption{Real-prover and simulator for zero-knowledge of $\Wident$}
1748   \label{fig:wident-sim}
1749 \end{figure}
1750 %\fi
1751
1752 \ifshort\else
1753 We now return to proving that the extractor $T_\Wident$ functions as claimed.
1754 The following two trivial lemmata will be useful, both now and later.
1755 \begin{lemma}[Uniqueness of discrete-logs]
1756   \label{lem:unique-dl}
1757   Let $G = \langle P \rangle$ be a cyclic group.  For any $X \in G$ there is
1758   a unique $x \in \gf{q}$ where $X = x P$.
1759 \end{lemma}
1760 \begin{proof}
1761   Certainly such an $x$ exists, since $G$ is cyclic and finite.  Suppose $X =
1762   x P = x' P$: then $0 = x P - x' P = (x - x') P$.  Hence $(x - x')$ is a
1763   multiple of $q$, i.e., $x = x'$.
1764 \end{proof}
1765 \begin{lemma}[Uniqueness of check values]
1766   \label{lem:unique-c}
1767   Let $G = \langle P \rangle$ be a cyclic group of prime order $q$; let $H_I$
1768   be a function $H_I\colon \Bin^{2\ell_G} \to \Bin^{\ell_I}$.  Fix some $x
1769   \in \gf{q}$ and define the set
1770   \[ V_x = \bigl\{\, (R, c) \in G \times \Bin^{\ell_I} \bigm|
1771                 R = \bigl( c \xor H_I(R, x R) \bigr) P \,\bigr\}.
1772   \]
1773   Then, for any $R$, $c$, $c'$, if $(R, c) \in V_x$ and $(R, c') \in V_x$
1774   then $c = c'$.
1775 \end{lemma}
1776 \begin{proof}
1777   From lemma~\ref{lem:unique-dl}, we see that there is a unique $r \in \gf{q}$
1778   for which $R = r P$.  Now, if $(R, c) \in V_x$, we must have $r = c \xor
1779   H_I(R, x R)$.  It follows that $c = r \xor H_I(R, x R)$.
1780 \end{proof}
1781
1782 \begin{proof}[Proof of lemma~\ref{lem:dlext}]
1783   Let $B$ be any randomized algorithm, and let $(R, c, Q_H)$ be as given to
1784   the extractor by $\Game{dl-ext}{G}(T_\Wident, B)$.  Let the quantities
1785   $H_I$, $Q_C$, $r$, $r'$, $x$ and $X$ be as in that game.
1786
1787   Suppose that the extractor returns values $(r, Y) \ne (\bot, \bot)$.  Let
1788   $h = r \xor c$; then there must be a query $(R, Y, h) \in Q_H$, and we have
1789   $R = r P$ and $Y = r X = r (x P) = x (r P) = x R = Y'$, so the extractor's
1790   output must be correct unless it fails.
1791
1792   Furthermore, in the case where the extractor did not fail, we have $h =
1793   H_I(R, Y) = H_I(R, Y')$ and $c = r \xor h$, so the challenge was valid.
1794   Therefore, if the challenge was invalid, the extractor will fail.
1795
1796   We now deal with the challenge-generation oracle.  Suppose that $(R, c')
1797   \in Q_C$ for some $c'$.  Now, if $c = c'$ then $(R, c')$ is a repeat of
1798   some challenge from the challenge-generation oracle, and the extractor is
1799   permitted to fail.  On the other hand, suppose $c \ne c'$; then, the
1800   challenge $(R, c)$ must be invalid by lemma~\ref{lem:unique-c}, so the
1801   extractor is required to fail, and we have established that indeed it will.
1802   From now on, suppose that $R$ is distinct from all the $R$-values returned
1803   by $C()$.
1804
1805   Let $Y = x R$.  Suppose that $B$ queried its random oracle at $(R, Y)$.
1806   Let $h = H_I(Y)$, so $r' = c \xor h$.  If the challenge is valid then $R =
1807   r' P$; therefore $Y = x R = x r' P = r' X$, so we have $(R, Y, h) \in Q_H$
1808   with $R = r P$ and $Y = r X$.  Hence the extractor returns $r = r'$ as
1809   required.
1810
1811   It remains to deal with the case where there is no random-oracle query at
1812   $(R, Y)$.  But then $h = H_I(R, Y)$ is uniformly distributed, and
1813   independent of the entire game up to this point.  Let $r$ be the correct
1814   discrete log of $R$; by lemma~\ref{lem:unique-dl} there is only one
1815   possible value.  The extractor always fails under these circumstances, but
1816   a correct responder would reply with probability
1817   \[ \Pr[h = c \xor r] = \frac{1}{2^{\ell_I}}. \]
1818   This concludes the proof.
1819 \end{proof}
1820 \begin{remark}
1821   Note that the fact that the algorithm~$B$ was given the private key is
1822   irrelevant to the above argument.  However, we shall need this property
1823   when we come to prove deniability for the key-exchange protocol.
1824 \end{remark}
1825 \begin{remark}
1826   It's easy to see from the above proof that the extractor works flawlessly
1827   on the `honest verifier' algorithm $\id{challenge}$ shown in
1828   figure~\ref{fig:wident-ro}.  This shows that $\Wident$ is perfect
1829   zero-knowledge against honest verifiers.  We're much more interested in
1830   dishonest verifiers, though.
1831 \end{remark}
1832 \fi
1833
1834
1835 \ifshort\else
1836 \subsection{An identity-based identification scheme}
1837 \label{sec:wident-id}
1838
1839 Boneh and Franklin \cite{Boneh:2003:IBE} showed how to construct an
1840 identity-based encryption scheme using bilinear pairings.  The resulting
1841 encryption scheme looks somewhat like a pairing-based version of ElGamal's
1842 encryption scheme \cite{ElGamal:1985:PKCb}.  We can easily apply their
1843 techniques to our identification protocol, and thereby obtain an
1844 identity-based identification scheme.  Providing the necessary formalisms to
1845 prove theorems analogous to our theorems~\ref{thm:wident-sound}
1846 and~\ref{thm:wident-zk} would take us too far from our objectives; but given
1847 appropriate security notions, we can readily adapt our existing proofs to the
1848 new setting.
1849
1850 \subsubsection{Bilinear pairings}
1851 Before we describe the necessary modifications to the protocol, we first give
1852 a (very brief!) summary of cryptographic pairings.  (The Boneh-Franklin paper
1853 \cite{Boneh:2003:IBE} gives more detail; also \cite{Menezes:2005:IPB}
1854 provides a useful introduction to the topic.)
1855
1856 Let $(G, +)$, $(G', +)$ and $(G_T, \times)$ be cyclic groups with prime order
1857 $q$; let $P \in G$ and $P' \in G'$ be elements of order $q$ in $G$ and $G'$
1858 respectively.  We say that a mapping $\hat{e}\colon G \times G' \to G_T$ is a
1859 \emph{non-degenerate bilinear pairing} if it satisfies the following
1860 properties.
1861 \begin{description}
1862 \item[Bilinearity] For all $R \in G$ and $S', T' \in G'$, we have $\hat{e}(R,
1863   S' + T') = \hat{e}(R, S')\,\hat{e}(R, T')$; and for all $R, S \in G$ and $T'
1864   \in G'$ we have $\hat{e}(R + S, T') = \hat{e}(R, T')\,\hat{e}(S, T')$.
1865 \item[Non-degeneracy] $\hat{e}(P, P') \ne 1$.
1866 \end{description}
1867 For practical use, we also want $\hat{e}(\cdot, \cdot)$ to be efficient to
1868 compute.  The reader can verify that $\hat{e}(a P, b P') = \hat{e}(P,
1869 P')^{ab}$.  It is permitted for the two groups $G$ and $G'$ to be equal.
1870
1871 We require a different intractability assumption, specifically that the
1872 \emph{bilinear} Diffie-Hellman problem (BDH) -- given $(a P, b P, a P', c P')
1873 \in G^2 \times G'^2$, find $\hat{e}(P, P')^{abc} \in G_T$ -- is difficult.
1874 This implies the difficulty of the computational Diffie-Hellman problem in
1875 all three of $G$, $G'$ and~$G_T$.
1876
1877 \subsubsection{The identity-based scheme}
1878 We need a trusted authority; following \cite{Schneier:1996:ACP} we shall call
1879 him Trent.  Trent's private key is $t \in \gf{q}$; his public key is $T =
1880 t P$.
1881
1882 Finally, we need cryptographic hash functions $H_I\colon G \times G_T \to
1883 \Bin^{\ell_I}$ and $\Hid\colon \Bin^* \to G'$; a formal security analysis
1884 would model these as random oracles.
1885
1886 Alice's public key is $A = \Hid(\texttt{Alice}) \in G'$.  Her private key is
1887 $K_A = t A \in G'$ -- she needs Trent to give this to her.  Bob can interact
1888 with Alice in order to verify her identity as follows.
1889 \begin{enumerate}
1890 \item Bob computes $\gamma_A = \hat{e}(T, A) \in G_T$.  (He can do this once
1891   and store the result if he wants, but it's not that onerous to work it out
1892   each time.)
1893 \item Bob chooses $r \inr \gf{q}$, and sets $R = r P$.  He also computes
1894   $\psi = \gamma_A^r$, $h = H_I(R, \psi)$ and $c = r \xor h$.  He sends his
1895   challenge $(R, c)$ to Alice.
1896 \item Alice receives $(R', c')$.  She computes $\psi' = \hat{e}(R, K_A)$, $h'
1897   = H_I(R', \psi')$, and $r' = c' \xor h')$.  She checks that $R' = r' P$; if
1898   so, she sends $\psi'$ back to Bob; otherwise she refuses to talk to him.
1899 \item Bob receives $\psi'$.  If $\psi = \psi'$ then he accepts that he's
1900   talking to Alice.
1901 \end{enumerate}
1902 This works because $\psi = \gamma_A^r = \hat{e}(T, A)^r = \hat{e}(t P, A)^r =
1903 \hat{e}(r P, A)^t = \hat{e}(R, t A) = \psi'$.
1904
1905 \subsubsection{Informal analysis}
1906 An analogue to lemma~\ref{lem:dlext} can be proven to show how to extract $r$
1907 from a verifier's random-oracle queries; statistical zero knowledge would
1908 then follow easily, as in theorem~\ref{thm:wident-zk}.  Soundness is
1909 intuitively clear, since an adversary must compute $\psi = \hat{e}(P,
1910 P')^{art}$ given $A = a P'$, $R = r P$ and $T = t P$, which is an instance of
1911 the BDH problem.  An analogue of theorem~\ref{thm:wident-sound} would have to
1912 prove this for an adversary capable of making identity requests as well as
1913 obtaining challenges.  Finally, our key-exchange protocol can be constructed
1914 out of this identity-based identification scheme, yielding an identity-based
1915 authenticated key-exchange protocol.  We leave it to the reader to work
1916 through the details.
1917 \fi
1918
1919
1920 \ifshort\else
1921 \subsection{Comparison with the protocol of Stinson and Wu}
1922 \label{sec:stinson-ident}
1923
1924 Our protocol is similar to a recent proposal by Stinson and Wu
1925 \cite{cryptoeprint:2006:337}.  They restrict their attention to Schnorr
1926 groups $G \subset \F_p^*$.  Let $\gamma$ be an element of order $q = \#G$.
1927 The prover's private key is $a \inr \gf{q}$ and her public key is
1928 $\alpha = \gamma^a$.  In their protocol, the challenger chooses
1929 $r \inr \gf{q}$, computes $\rho = \gamma^r$ and $\psi = \alpha^r$, and sends
1930 a challenge $(\rho, H(\psi))$.  The prover checks that $\rho^q \ne 1$,
1931 computes $\psi = \rho^a$, checks the hash, and sends $\psi$ back by way of
1932 response.  They prove their protocol's security in the random-oracle model.
1933
1934 Both the Wrestlers protocol and Stinson-Wu require both prover and verifier
1935 to compute two exponentiations (or scalar multiplications) each.  The
1936 sizes of the messages used by the two protocols are also identical.
1937
1938 (An earlier version of the Stinson-Wu protocol used a cofactor
1939 exponentiation: if we set $f = (p - 1)/q$, then we use $\psi = \alpha^{rf}) =
1940 \rho^{af} = \gamma^{afr}$.  This is more efficient in typical elliptic curve
1941 subgroups, since the cofactor of such subgroups is usually small: indeed,
1942 \cite{SEC1} recommends rejecting groups with cofactor $f > 4$.  However, in
1943 the Schnorr groups used by Stinson and Wu, the cofactor is much larger than
1944 $q$, and their new variant is more efficient.)
1945
1946 We note that the zero-knowledge property of the Stinson-Wu protocol requires
1947 the Diffie-Hellman knowledge of exponent assumption (KEA).  Very briefly:
1948 suppose $A$ is a randomized algorithm which takes as input $X \in G$ and
1949 outputs a pair $(r P, r X)$; intuitively, the KEA asserts $A$ must have done
1950 this by choosing $r$ somehow and then computing its output from it.
1951 Formally, it asserts the existence of an `extractor' algorithm which takes as
1952 input the element $X$ and the random coins used by $A$ and outputs $r$ with
1953 high probability.  This is a very strong assumption, and one which is
1954 unnecessary for our protocol, since we can present an \emph{explicit}
1955 extractor.
1956
1957 The KEA assumption as stated in \cite{cryptoeprint:2006:337} allows the
1958 extractor to fail with some negligible probability, over and above the
1959 probability that a dishonest verifier managed to guess the correct
1960 $h = H(\psi)$ without making this random-oracle query.  Not only does our
1961 protocol achieve zero- knowledge without the KEA, our extractor is, in this
1962 sense, `perfect'.
1963
1964 Our protocol is just as strong as Stinson-Wu under attack from active
1965 intruders: see table~\ref{tab:wident-active} for a very brief sketch of the
1966 case-analysis which would be the basis of a proof of this.
1967
1968 \begin{table}
1969   \begin{tabular}[C]{|*{3}{c|}p{8cm}|}
1970     \hlx{hv[1]}
1971     \multicolumn{2}{|c|}{\textbf{Challenge}} &
1972     \textbf{Response} &
1973     \textbf{Security}
1974     \\ \hlx{v[1]hv}
1975     %% unpleasant hacking to make the R and c columns the same width :-(
1976     \settowidth{\dimen0}{\textbf{Challenge}}%
1977     \dimen0=.5\dimen0
1978     \advance\dimen0by-\tabcolsep
1979     \advance\dimen0by-.5\arrayrulewidth
1980     \hbox to\dimen0{\hfil$R$\hfil}
1981          & $c$  & $Y$  & Nothing to prove.                      \\ \hlx{v}
1982     $R$  & $c'$ & ---  & Prover rejects by lemma~\ref{lem:unique-c};
1983                          $Y'$ probably wrong by
1984                          theorem~\ref{thm:wident-sound}.         \\ \hlx{v}
1985     $R$  & $c$  & $Y'$ & Response is incorrect.                 \\ \hlx{v}
1986     $R'$ & ---  & $Y$  & Response is incorrect.                 \\ \hlx{v}
1987     $R'$ & $c$  & $Y'$ & Prover rejects with probability $1 - 2^{-\ell_I}$;
1988                          $Y'$ probably wrong by
1989                          theorem~\ref{thm:wident-sound}.         \\ \hlx{v}
1990     $R'$ & $c'$ & $Y'$ & Simulate prover using extractor
1991                          (lemma~\ref{lem:dlext}); $Y'$ probably wrong by
1992                          theorem~\ref{thm:wident-sound}.         \\ \hlx{vh}
1993   \end{tabular}
1994
1995   \caption{Security of $\Wident$ against active intruders (summary)}
1996   \label{tab:wident-active}
1997 \end{table}
1998
1999 An identity-based analogue of Stinson-Wu can be defined using a bilinear
2000 pairing, just as we did in section~\ref{sec:wident-id}.  However, to prove
2001 the zero-knowledge property, one needs to make a bilinear analogue of the
2002 knowledge of exponent assumption.
2003
2004 We suspect that a key-exchange protocol like ours can be constructed using
2005 Stinson-Wu rather than the Wrestlers identification scheme.  We haven't,
2006 however, gone through all the details, since we believe our protocol is just
2007 as efficient and is based on much more conservative assumptions.
2008 \fi
2009
2010 %%%--------------------------------------------------------------------------
2011
2012 \section{A simple key-exchange protocol}
2013 \label{sec:kx}
2014
2015 In this section, we describe a simple key-exchange protocol built out of the
2016 identification protocol shown previously.
2017
2018 The key-exchange protocol arises from the following observation.  If Bob
2019 sends a challenge, presumably to Alice, and gets a correct response, then not
2020 only did he really send the challenge to Alice but he knows that she received
2021 it correctly.
2022
2023 So, if Alice and Bob authenticate each other, by the end of it, they should
2024 each have chosen a random private value, sent the corresponding public value
2025 to the other, and been convinced that it arrived safely.
2026
2027 Unfortunately, life isn't quite this kind, and we have to do some more work
2028 to make this scheme secure.
2029
2030
2031 Our key exchange protocol essentially consists of two parallel instances of
2032 the identification protocol.  If Alice receives a correct response to her
2033 challenge, she will know that Bob received her challenge correctly, and
2034 \emph{vice versa}.  If we let Alice's challenge be $R_0 = r_0 P$ and Bob's
2035 challenge be $R_1 = r_1 P$ then each can compute a shared secret $Z = r_0 R_1
2036 = r_0 r_1 P = r_1 R_0$ unknown to an adversary.  There are, unfortunately, a
2037 few subtleties involved in turning this intuition into a secure key-exchange
2038 protocol, which we now describe.
2039
2040
2041 \subsection{Overview}
2042 \label{sec:kx-overview}
2043
2044 We present a quick, informal description of our basic key-exchange protocol.
2045 In addition to our group $G$, we shall also need a secure symmetric
2046 encryption scheme $\E = (\kappa, E, D)$, and two secure hash functions
2047 $H_I\colon \Bin^{2\ell_G} \to \Bin^{\ell_I}$ and $H_K\colon \Bin^{\ell_G+1}
2048 \to \Bin^\kappa$.
2049
2050 Suppose that Alice's and Bob's private keys are $a$ and $b$ respectively, and
2051 their public keys are $A = a P$ and $B = b P$.
2052 \begin{enumerate}
2053 \item Alice chooses a random index $r \inr \gf{q}$.  She computes $R = r P$ and
2054   $c = r \xor H_I(R, r B)$.  She sends the pair $(R, c)$ to Bob.
2055 \item Similarly, Bob chooses a random $s \inr \gf{q}$.  He computes $S = s P$
2056   and $d = s \xor H_I(S, s A)$.  He sends $(S, d)$ to Alice.
2057 \item Alice receives $(S', d')$ from Bob.  She computes $s' = d' \xor H_I(S',
2058   a S')$, and verifies that $S' = s' P$.  If so, she computes $K_A = H_K(0
2059   \cat r S')$, and sends $R, E_{K_A}(a S')$ to Bob.
2060 \item Similarly, Bob receives $(R', c')$ from Alice.  He verifies that $R' =
2061   \bigl( c' \xor H_I(R', b R') \bigr) P$.  If so, he computes $K_B = H_K(0
2062   \cat s R')$ and sends S, $E_{K_B}(b R')$ to Alice.
2063 \item Alice receives a ciphertext $(S'', \chi_B)$ from Bob.  She checks that
2064   $S'' = S'$, decrypts $\chi_B$, and checks that $D_{K_A}(\chi_B) = r B$.  If
2065   so, she uses $H_K(1 \cat r S')$ as her shared secret.
2066 \item Similarly, Bob receives $(R'', \chi_A)$ from Alice, and checks $R'' =
2067   R'$ and $D_{K_B}(\chi_A) = s A$.  If so, he uses $H_K(1 \cat s R')$ as his
2068   shared secret.
2069 \end{enumerate}
2070 This is the Wrestlers Key Exchange protocol, $\Wkx^{G, \E}$ (again, we omit
2071 the superscripts when referring to the general protocol, or when confusion is
2072 unlikely).  A diagrammatic summary of the protocol is shown in
2073 figure~\ref{fig:wkx}.
2074
2075 \begin{figure}
2076   \begin{description}
2077   \item[Setup] Group $G = \langle P \rangle$; $\#G = q$ is prime.
2078     $H_I(\cdot, \cdot)$ and $H_K(\cdot)$ are secure hashes.  $\E = (\kappa,
2079     E, D)$ is an IND-CCA2 symmetric encryption scheme.
2080   \item[Parties] $U_i$ for $0 \le i < n$.
2081   \item[Private keys] $x_i \inr \gf{q}$.
2082   \item[Public keys] $X_i = x_i P$.
2083   \end{description}
2084   \begin{protocol}
2085     $r_i \getsr I$; $R_i \gets r_i P$; &
2086     $r_j \getsr I$; $R_j \gets r_j P$; \\
2087     $c_i \gets r_i \xor H_I(R_i, r_i X_j)$; &
2088     $c_j \gets r_j \xor H_I(R_j, r_j X_i)$; \\
2089     \send{->}{(R_i, c_i)}
2090     \send{<-}{(R_j, c_j)}
2091     Check $R_j = \bigl(c_j \xor H_I(x_i R_j)\bigr) P$; &
2092     Check $R_i = \bigl(c_i \xor H_I(x_j R_i)\bigr) P$; \\
2093     $Z \gets r_i R_j$; $(K_0, K_1) \gets H_K(Z)$; &
2094     $Z \gets r_j R_i$; $(K_0, K_1) \gets H_K(Z)$; \\
2095     $\chi_i \gets E_{K_0}(x_i R_j)$; &
2096     $\chi_j \gets E_{K_0}(x_j R_i)$; \\
2097     \send{->}{(R_i, \chi_i)}
2098     \send{<-}{(R_j, \chi_j)}
2099     Check $D_{K_0}(\chi_j) = r_i X_j$; &
2100     Check $D_{K_0}(\chi_i) = r_j X_i$; \\
2101     Shared key is $K_1$. & Shared key is $K_1$.
2102   \end{protocol}
2103
2104   \caption{Summary of the Wrestlers Key Exchange protocol, $\Wkx$}
2105   \label{fig:wkx}
2106 \end{figure}
2107
2108 Assume, for the moment, that Alice and Bob's messages are relayed honestly.
2109 Then:
2110 \begin{itemize}
2111 \item $a S' = a S = a (s P) = s (a P) = s A$, so $s' = d' \xor H_I(S' a S') =
2112   d \xor H_I(S, s A) = s$, and $S' = S = s P = s' P$, and therefore Alice
2113   responds to Bob's message;
2114 \item similarly $b R' = r B$, so $r' = r$ and $R' = r' P$, and therefore Bob
2115   responds to Alice's message;
2116 \item $b R' = b R = b (r P) = r (b P) = r B$, and $a S' = a S = a (s P) = s
2117   (a P) = s A$, and therefore both parties compute their responses correctly;
2118   and
2119 \item $r S' = r S = r (s P) = s (r P) = s R = s R'$, so $K_A = K_B$, and
2120   therefore they can decrypt each others' responses, and agree the same
2121   shared secret.
2122 \end{itemize}
2123 This shows that the protocol is basically valid, but says little about its
2124 security.  The remainder of this section will describe our protocol in more
2125 formal detail, and prove its security in a model with multiple parties and an
2126 adversary who controls the network.
2127
2128 Observe that the protocol as we've presented here is \emph{symmetrical}.
2129 There's no notion of `initiator' or `responder'.  There are a total of four
2130 messages which must be sent before both parties accept.  However, this can be
2131 reduced to three by breaking the symmetry of the protocol and combining one
2132 or other party's challenge and response messages.  We choose to analyse the
2133 symmetrical version, since to do so, it suffices to consider only the two
2134 different kinds of messages.  Since our security model allows the messages to
2135 be adversarially delayed and reordered, it is easy to show that the security
2136 of an optimized, asymmetrical protocol is no worse than the symmetrical
2137 version we present here.
2138
2139
2140 \subsection{Security model and security definition}
2141 \label{sec:um}
2142
2143 Our model is very similar to that of Canetti and Krawczyk
2144 \cite{Canetti:2001:AKE}, though we have modified it in two ways.
2145 \begin{enumerate}
2146 \item We allow all the participants (including the adversary) in the protocol
2147   access to the various random oracles required to implement it.
2148 \item Since we want to analyse a specific, practical scheme, asymptotic
2149   results are useless.  We measure the adversary's resource usage carefully,
2150   and produce a quantitative bound on the adversary's advantage in the
2151   SK-security game.
2152 \end{enumerate}
2153
2154 \ifshort
2155
2156 Readers interested in the details of the model should see Canetti and
2157 Krawczyk's paper \cite{Canetti:2001:AKE}, or the full version of this paper.
2158
2159 \else
2160
2161 \subsubsection{Overview}
2162 We briefly describe our modified model, pointing out the changes we have
2163 made, and how they apply to our protocol.  Much of Canetti and Krawczyk's
2164 model (for example, the local and global outputs) is useful for proving more
2165 general security properties such as demonstrating that SK-security suffices
2166 for constructing secure channels, and we shall not concern ourselves with
2167 such details.  Other parts deal with issues such as security parameters and
2168 ensuring that all the computation is polynomially bounded, which are
2169 irrelevant since we are dealing with a single concrete protocol rather than a
2170 family of them.
2171
2172 The entities in the model are the \emph{adversary}~$A$, and a (fixed) number
2173 of \emph{parties}~$P_i$, for $0 \le i < n$.  If the protocol under
2174 consideration makes use of random oracles, then all the participants -- the
2175 adversary and the parties -- are all allowed access to the random oracles.
2176
2177 The parties and the adversary play a `game'.  At the beginning of the game,
2178 the participants are given some inputs computed by a randomized
2179 \emph{initialization procedure}~$\id{init}$.  This produces as output a pair
2180 $(i_U, \mathbf{i})$; the value $i_U$ is the \emph{global input}, and is given
2181 to all the participants including the adversary.  The vector $\mathbf{i}$ has
2182 $n$ components, and party $P_i$ is given $(i_U, \mathbf{i}[i])$ as input.
2183
2184 \subsubsection{Sessions}
2185 Parties don't act directly.  Instead, each party runs a number of
2186 \emph{sessions}.  A session is represented by a triple $S = (P_i, P_j, s)$,
2187 where $i, j \in \Nupto{n}$ identify the owning party and a \emph{partner},
2188 and $s \in \Bin^{\ell_S}$ is a \emph{session-id}.  (The original model
2189 includes a r\^ole, for distinguishing between initiators and responders.  Our
2190 protocol is symmetrical, so this distinction isn't useful.)  If $P_i$ runs a
2191 session $S = (P_i, P_j, s)$ and $P_j$ runs a session $S' = (P_j, P_i, s)$
2192 then we say that $S$ and $S'$ are \emph{matching}, and that $P_j$ is $P_i$'s
2193 \emph{partner} for the session.
2194
2195 At most one participant in the game is \emph{active} at any given time.
2196 Initially the adversary is active.  The adversary may \emph{activate} a
2197 session in one of two ways.
2198 \begin{enumerate}
2199 \item It may \emph{create a session} of a party~$P_i$, by selecting a
2200   session-id~$s \in \Bin^{\ell_S}$ and a partner $j$.  There is no
2201   requirement that $P_j$ ever have a matching session.  However, all sessions
2202   of a party must be distinct, i.e., sessions with the same partner must have
2203   different session-ids.
2204 \item It may \emph{deliver a message}~$\mu \in \Bin^*$, from party~$P_j$, to
2205   an existing session~$S = (P_i, P_j, s)$.  There is no requirement that any
2206   party previously sent $\mu$: the adversary is free to make up messages as
2207   it sees fit.
2208 \end{enumerate}
2209 The adversary becomes inactive, and the session becomes active.  The session
2210 performs some computation, according to its protocol, and may request a
2211 message~$\mu$ be delivered to the matching session running in its partner
2212 (which may not exist).  The session may also \emph{terminate}.  In the case
2213 we are interested in, of key-exchange protocols, a session~$S = (P_i, P_j,
2214 s)$ may terminate in one of two ways:
2215 \begin{enumerate}
2216 \item it may \emph{complete}, outputting $(i, j, s, K)$, for some
2217   \emph{session key}~$K$, or
2218 \item it may \emph{abort}, outputting $(i, j, s, \bot)$.
2219 \end{enumerate}
2220 Once it has performed these actions, the session deactivates and the
2221 adversary becomes active again.  The adversary is given the message~$\mu$, if
2222 any, and informed of whether the session completed or aborted, but, in the
2223 case of completion, not of the value of the key~$K$.  A session is
2224 \emph{running} if it has been created and has not yet terminated.
2225
2226 \subsubsection{Other adversarial actions}
2227 As well as activating sessions, the adversary has other capabilities, as
2228 follows.
2229 \begin{itemize}
2230 \item It may \emph{expire} any session~$S$, causing the owning party to
2231   `forget' the session key output by that session.
2232 \item It may \emph{corrupt} any party~$P_i$, at will: the adversary learns
2233   the entire state of the corrupted party, including its initial
2234   input~$\mathbf{i}[i]$, the state of any sessions it was running at the
2235   time, and the session keys of any completed but unexpired sessions.  Once
2236   corrupted, a party can no longer be activated.  Of course, the adversary
2237   can continue to send messages allegedly from the corrupted party.
2238 \item It may \emph{reveal the state} of a running session~$S$, learning any
2239   interesting values specific to that session, but \emph{not} the owning
2240   party's long-term secrets.
2241 \item It may \emph{reveal the session-key} of a completed session~$S$.
2242 \item It may elect to be \emph{challenged} with a completed session~$S$,
2243   provided.  Challenge sessions form part of the security notion for
2244   key-exchange protocols.  See below for more details.
2245 \end{itemize}
2246 We say that a session $S = (P_i, P_j, s)$ is \emph{locally exposed} if
2247 \begin{itemize}
2248 \item it has had its state revealed,
2249 \item it has had its session-key revealed, or
2250 \item $P_i$ has been corrupted, and $S$ had not been expired when this
2251   happened.
2252 \end{itemize}
2253 A session is \emph{exposed} if it is locally exposed, or if its matching
2254 session exists and has been locally exposed.
2255
2256 At the beginning of the game, a bit $b^*$ is chosen at random.  The adversary
2257 may choose to be \emph{challenged} with any completed, unexposed
2258 session;\footnote{%
2259   The original Canetti-Krawczyk definition restricts the adversary to a
2260   single challenge session, but our proof works independent of the number of
2261   challenge sessions, so we get a stronger result by relaxing the requirement
2262   here.)}
2263 the adversary is then given either the session's key -- if $b^* = 1$ -- or a
2264 string chosen at random and independently of the game so far from a
2265 protocol-specific distribution -- if $b^* = 0$.  At the end of the game, the
2266 adversary outputs a single bit~$b$.
2267
2268 \subsubsection{SK-security}
2269 We've now described the game; it is time to explain the adversary's goal in
2270 it.  The adversary \emph{wins} the game if either
2271 \begin{enumerate}
2272 \item two unexposed, matching sessions complete, but output different
2273   keys,\footnote{%
2274     The original Canetti-Krawczyk definition differs slightly here.  It
2275     requires that `if two \emph{uncorrupted} parties complete matching
2276     sessions then they both output the same key' [original emphasis].  This
2277     can't be taken at face value, since none of the protocols they claim to
2278     be secure actually meet this requirement: they meet only the weaker
2279     requirement that parties completing matching sessions output different
2280     keys with negligible probability.  We assume here that this is what they
2281     meant.}
2282   or
2283 \item the adversary correctly guesses the hidden bit~$b^*$.
2284 \end{enumerate}
2285 More formally, we make the following definition.
2286 \fi
2287 \begin{definition}[SK-security]
2288   \label{def:sk}
2289   Let $\Pi^{H_0(\cdot), H_1(\cdot), \ldots}$ be a key-exchange protocol
2290   which makes use of random oracles $H_0(\cdot)$, $H_1(\cdot)$, \dots, and
2291   let $A$ be an adversary playing the game described \ifshort in
2292   \cite{Canetti:2001:AKE}\else previously\fi, where $n$
2293   parties run the protocol~$\Pi$.  Let $V$ be the event that any pair of
2294   matching, unexposed sessions completed, but output different session keys.
2295   Let $W$ be the event that the adversary's output bit matches the game's
2296   hidden bit~$b^*$.  We define the adversary's \emph{advantage against the
2297     SK-security of the protocol~$\Pi$} to be
2298   \[ \Adv{sk}{\Pi}(A, n) = \max(\Pr[V], 2\Pr[W] - 1). \]
2299   Furthermore, we define the \emph{SK insecurity function of the
2300   protocol~$\Pi$} to be
2301   \[ \InSec{sk}(\Pi; t, n, q_S, q_M, q_{H_0}, q_{H_1}, \dots) =
2302        \max_A \Adv{sk}{\Pi}(A, n)
2303   \]
2304   where the maximum is taken over all adversaries~$A$ with total running
2305   time~$t$ (not including time taken by the parties), create at most $q_S$
2306   sessions, deliver at most $q_M$~messages, and (if applicable) make at most
2307   $q_{H_i}$ random-oracle queries to each random oracle $H_i(\cdot)$.
2308 \end{definition}
2309
2310
2311 \subsection{Security}
2312
2313 In order to analyse our protocol $\Wkx^{G, \E}$ properly, we must describe
2314 exactly how it fits into our formal model.
2315
2316 \subsubsection{Sessions and session-ids}
2317 Our formal model introduced the concept of sessions, which the informal
2318 description of section~\ref{sec:kx-overview} neglected to do.  (One could
2319 argue that we described a single session only.)  As we shall show in
2320 section~\ref{sec:kx-insecure}, our protocol is \emph{insecure} unless we
2321 carefully modify it to distinguish between multiple sessions.
2322
2323 In the model, distinct key-exchange sessions are given distinct partners and
2324 session-ids.  In order to prevent sessions interfering with each other, we
2325 shall make explicit use of the session-ids.
2326
2327 Suppose the session-ids are $\ell_S$-bit strings.  We expand the domain of
2328 the random oracle $H_I$ so that it's now
2329 \[ H_I\colon G \times \Bin^{\ell_S} \times G \times G \to \Bin_{\ell_I}. \]
2330
2331 \subsubsection{Messages}
2332 We split the messages our protocols into two parts: a \emph{type}~$\tau$ and
2333 a \emph{body}~$\mu$.  We assume some convenient, unambiguous encoding of
2334 pairs $(\tau, \mu)$ as bit-strings.  For readability, we present message
2335 types as text strings, e.g., `\cookie{challenge}', though in practice one
2336 could use numerical codes instead.
2337
2338 The message body itself may be a tuple of values, which, again, we assume are
2339 encoded as bit-strings in some convenient and unambiguous fashion.  We shall
2340 abuse the notation for the sake of readability by dropping a layer of nesting
2341 in this case: for example, we write $(\cookie{hello}, x, y, z)$ rather than
2342 $\bigl(\cookie{hello}, (x, y, z)\bigr)$.
2343
2344 \subsubsection{The protocol}
2345 Our protocol is represented by three functions, shown in
2346 figure~\ref{fig:wkx-formal}.
2347 \begin{itemize}
2348 \item $\id{init}(n)$ is the initialization function, as described in
2349   section~\ref{sec:um}.  It outputs a pair $(\mathbf{p}, \mathbf{i})$, where
2350   $\mathbf{i}[i]$ is the private key of party~$P_i$ and $\mathbf{p}[i]$ is
2351   the corresponding public key.  Only $P_i$ is given $\mathbf{i}[i]$, whereas
2352   all parties and the adversary are given $\mathbf{p}$.
2353 \item $\id{new-session}^{H_I(\cdot, \cdot, \cdot, \cdot), H_K(\cdot)}
2354   (\mathbf{p}, x, i, j, s)$ is the new-session function.  This is executed by
2355   party~$P_i$ when the adversary decides to create a new session~$S = (P_i,
2356   P_j, s)$.  It is also given the relevant outputs of $\id{init}$, and
2357   allowed access to the random oracles $H_I$ and $H_K$.
2358 \item $\id{message}^{H_I(\cdot, \cdot, \cdot, \cdot), H_K(\cdot)} (\tau,
2359   \mu)$ is the incoming-message function.  This is executed by a session when
2360   the adversary decides to deliver a message $(\tau, \mu)$ to it.  It makes
2361   use of the subsidiary functions $\id{msg-challenge}$ and
2362   $\id{msg-response}$ to handle the messages.
2363 \end{itemize}
2364 We observe that the protocol never aborts.  We could make it do so if it
2365 receives an invalid message, but we prefer to ignore invalid messages for the
2366 sake of robustness.\footnote{%
2367   Note that this protocol would therefore require modification before it was
2368   acceptable in the simulation-based model of \cite{cryptoeprint:1999:012}.
2369   There it is required that a key-exchange protocol terminate after a
2370   polynomially-bounded number of messages are delivered to it.}
2371
2372 \begin{figure}
2373   \begin{program}
2374     Function $\id{init}(n)$: \+ \\
2375       \FOR $i \in \Nupto{n}$ \DO \\ \ind
2376         $x \getsr \gf{q}$; \\
2377         $\mathbf{i}[i] \gets x$; \\
2378         $\mathbf{p}[i] \gets x P$; \- \\
2379       \RETURN $(\mathbf{p}, \mathbf{i})$;
2380     \- \\[\medskipamount]
2381     Function $\id{new-session}^{H_I(\cdot, \cdot, \cdot, \cdot), H_K(\cdot)}
2382       (\mathbf{p}, x, i, j, s)$: \+ \\
2383       $X \gets \mathbf{p}[i]$;
2384       $X' \gets \mathbf{p}[j]$;
2385       $C \gets \emptyset$; \\
2386       $r \getsr \gf{q}$;
2387       $R \gets r P$;
2388       $Y \gets r X'$; \\
2389       $h \gets H_I(X, s, R, Y)$;
2390       $c \gets r \xor h$; \\
2391       \SEND $(\cookie{challenge}, R, c)$;
2392     \- \\[\medskipamount]
2393     Function $\id{message}^{H_I(\cdot, \cdot, \cdot, \cdot), H_K(\cdot)}
2394       (\tau, \mu)$: \+ \\
2395       \IF $\tau = \cookie{challenge}$ \THEN $\id{msg-challenge}(\mu)$; \\
2396       \ELSE \IF $\tau = \cookie{response}$ \THEN $\id{msg-response}(\mu)$;
2397     \next
2398     Function $\id{msg-challenge}(\mu)$: \+ \\
2399       $(R', c') \gets \mu$; \\
2400       $Y' \gets x R'$; \\
2401       $h' \gets H_I(X', s, R', Y')$; \\
2402       $r' \gets c' \xor h'$; \\
2403       \IF $R' \ne r' P$ \THEN \RETURN; \\
2404       $C \gets C \cup \{R\}$; \\
2405       $Z \gets r R'$; \\
2406       $(K_0, K_1) \gets H_K(Z)$; \\
2407       $\chi \gets E_{K_0}(Y')$; \\
2408       \SEND $(\cookie{response}, R, \chi)$;
2409     \- \\[\medskipamount]
2410     Function $\id{msg-response}(\mu)$: \+ \\
2411       $(R', \chi') \gets \mu$; \\
2412       \IF $R' \notin C$ \THEN \RETURN; \\
2413       $Z \gets r R'$; \\
2414       $(K_0, K_1) \gets H_K(Z)$; \\
2415       $Y' \gets D_{K_0}(\chi')$; \\
2416       \IF $Y' \ne Y$ \THEN \RETURN; \\
2417       \OUTPUT $K_1$;
2418       \STOP;
2419   \end{program}
2420
2421   \caption{Formalization of $\Wkx$}
2422   \label{fig:wkx-formal}
2423 \end{figure}
2424
2425 \subsubsection{Session states}
2426 We must specify what the adversary obtains when it chooses to reveal a
2427 session's state.  Given the program in figure~\ref{fig:wkx-formal}, we can
2428 see that the session state consists of the variables $(x, X, X', r, R, Y,
2429 C)$.
2430
2431 However, $x$ is the owning party's long-term secret, and it seems
2432 unreasonable to disclose this to an adversary who stops short of total
2433 corruption.
2434
2435 The public keys $X$ and $X'$ are part of the adversary's input anyway, so
2436 revealing them doesn't help.  Similarly, the set $C$ of valid challenges
2437 could have been computed easily by the adversary, since a group element $R'
2438 \in C$ if and only if the session $S$ responded to some message
2439 $(\cookie{challenge}, R', c')$.
2440
2441 The value $R = r P$ is easily computed given $r$, and besides is sent in the
2442 clear in the session's first message.  The expected response $Y = r X'$ is
2443 also easily computed from $r$.  The converse is also true, since $r$ can be
2444 recovered from $R$ and $c$ in the session's challenge message and the value
2445 $Y$.  Besides, $r$ is necessary for computing $Z$ in response to incoming
2446 challenges.
2447
2448 We conclude that the only `interesting' session state is $r$.
2449
2450 \subsubsection{Security}
2451 Having formally presented the protocol, we can now state our main theorem
2452 about its security.  The proof is given in \ifshort the full version of the
2453 paper\else appendix~\ref{sec:sk-proof}\fi.
2454 \begin{theorem}[SK-security of $\Wkx$]
2455   \label{thm:sk}
2456   Let $G$ be a cyclic group.  Let $\E = (\kappa, E, D)$ be a symmetric
2457   encryption scheme.  Then
2458   \begin{spliteqn*}
2459     \InSec{sk}(\Wkx^{G, \E}; t, n, q_S, q_M, q_I, q_K) \le
2460       2 q_S \bigl( \InSec{ind-cca}(\E; t', q_M, q_M) + {} \\
2461       \InSec{mcdh}(G; t', q_K) +
2462       n \,\InSec{mcdh}(G; t', q_M + q_I) \bigr) +
2463       \frac{n (n - 1)}{q} +
2464       \frac{2 q_M}{2^{\ell_I}}.
2465   \end{spliteqn*}
2466   where $t' = t + O(n) + O(q_S) + O(q_M q_I) + O(q_K)$.
2467 \end{theorem}
2468
2469
2470 \ifshort\else
2471 \subsection{Insecure protocol variants}
2472 \label{sec:kx-insecure}
2473
2474 It's important to feed the session-id and verifier's public key to the random
2475 oracle $H_I$ when constructing the check-value~$c$.  Without these, the
2476 protocol is vulnerable to attack.  In this section, we consider some variants
2477 of our protocol which hash less information, and show attacks against them.
2478
2479 To simplify the presentation, we shall consider Alice and Bob, and a third
2480 character Carol.  We shall be attacking a pair of matching sessions $A$
2481 and~$B$, run by Alice and Bob respectively.  Let Alice and Bob's private keys
2482 be $x_A$ and~$x_B$, and let their public keys be $X_A = x_A P$ and $X_B = x_B
2483 P$ respectively.
2484
2485 \subsubsection{Protocol diagram notation}
2486 In order to keep the presentation as clear as possible, we use a simple
2487 diagrammatic notation for describing protocol runs.  A line of the form
2488 \protocolrun{\textit{action} \ar[r] & \PRsession{S} & \textit{result}}
2489 states that the adversary performs the given \textit{action} on session~$S$,
2490 with the stated \textit{result}.  The \textit{action} may be
2491 \begin{itemize}
2492 \item \textsf{Create session $(P_i, P_j, s)$}: the session is created,
2493   running in party~$P_i$, with partner~$P_j$ and session-id~$s$.
2494 \item \textsf{Receive $\mu$}: the session is activated with an incoming message~$\mu$.
2495 \item \textsf{Session-state reveal}: The adversary requests the session's
2496   internal state.
2497 \end{itemize}
2498 The \textit{result} may be
2499 \begin{itemize}
2500 \item \textsf{Send $\mu'$}: the session requests the delivery of the
2501   message~$\mu'$.
2502 \item \textsf{Complete: $K$}: the session completes, outputting the key~$K$.
2503 \item \textsf{State: $\sigma$}: the session's state is revealed to
2504   be~$\sigma$.
2505 \item \textsf{(Ignore)}: the result of the action is unimportant.
2506 \end{itemize}
2507
2508 \subsubsection{Omitting the session-id}
2509 Consider a protocol variant where session $S$ sets $h_S = H_I(X_N, R_S,
2510 Y_S)$, where $N$ is the session's partner.  That is, we've omitted the
2511 session-id from the hash.  An adversary can cross over two sessions between
2512 Alice and Bob.  Here's how.
2513
2514 The attack assumes that Alice and Bob set up two pairs of matching sessions
2515 with each other, thus.
2516 \protocolrun{
2517   \PRcreate{Alice}{Bob}{s} & \PRsession{A} &
2518     \PRsend{challenge}{R_A, c_A} \\
2519   \PRcreate{Bob}{Alice}{s} & \PRsession{B} &
2520     \PRsend{challenge}{R_B, c_B} \\
2521   \PRcreate{Alice}{Bob}{s'} & \PRsession{A'} &
2522     \PRsend{challenge}{R_{A'}, c_{A'}} \\
2523   \PRcreate{Bob}{Alice}{s'} & \PRsession{B'} &
2524     \PRsend{challenge}{R_{B'}, c_{B'}}
2525 }
2526 Observe that the session pairs use distinct session-ids $s \ne s'$, so this
2527 is allowed.  Now the adversary crosses over the challenges, using the second
2528 pair of sessions to provide responses to the challenges issued by the first
2529 pair.  By revealing the state in the second pair of sessions, the adversary
2530 can work out the (probably different) session keys accepted by the first
2531 pair.
2532 \protocolrun{
2533   \PRreceive{challenge}{R_B, c_B} & \PRsession{A'} &
2534     \PRsend{response}{R_{A'}, E_{K_{A'B,0}}(x_A R_B)} \\
2535   \PRreceive{challenge}{R_A, c_A} & \PRsession{B'} &
2536     \PRsend{response}{R_{B'}, E_{K_{B'A,0}}(x_B R_A)} \\
2537   \PRreceive{challenge}{R_{A'}, c_{A'}} & \PRsession{A} & \PRignore \\
2538   \PRreceive{challenge}{R_{B'}, c_{B'}} & \PRsession{B} & \PRignore \\
2539   \PRreveal & \PRsession{A'} & r_{A'} \\
2540   \PRreveal & \PRsession{B'} & r_{B'} \\
2541   \PRreceive{response}{R_{B'}, E_{K_{B'A,0}}(x_B R_A)} & \PRsession{A} &
2542     \PRcomplete{K_{AB',1}} \\
2543   \PRreceive{response}{R_{A'}, E_{K_{A'B,0}}(x_A R_B)} & \PRsession{B} &
2544     \PRcomplete{K_{BA',1}} \\
2545 }
2546 The adversary can now compute $K_{AB'} = H_K(r_{B'} R_A)$ and $K_{B'A} =
2547 H_K(r_{A'} R_B)$.  Safely in possession of both keys, the adversary can now
2548 read and impersonate freely.
2549
2550 \subsubsection{Omitting the partner's public key}
2551 Now consider a protocol variant where session $S$ sets $h_S = H_I(s, R_S,
2552 Y_S)$, where $s$ is the session-id.  An adversary can use a sessions with
2553 Carol to attack a session between Alice and Bob.  Here's how the sessions are
2554 set up.
2555 \protocolrun{
2556   \PRcreate{Alice}{Bob}{s} & \PRsession{A} &
2557     \PRsend{challenge}{R_A, c_A} \\
2558   \PRcreate{Bob}{Alice}{s} & \PRsession{B} &
2559     \PRsend{challenge}{R_B, c_B} \\
2560   \PRcreate{Alice}{Carol}{s} & \PRsession{A'} &
2561     \PRsend{challenge}{R_{A'}, c_{A'}} \\
2562   \PRcreate{Bob}{Carol}{s} & \PRsession{B'} &
2563     \PRsend{challenge}{R_{B'}, c_{B'}}
2564 }
2565 Although each of Alice and Bob have two sessions with session-id~$s$, this is
2566 allowed, since they are with different partners.  The rest of the attack in
2567 fact proceeds identically to the previous case.
2568 \fi
2569
2570 \subsection{Deniability}
2571 \label{sec:denial}
2572
2573 We have claimed that the Wrestlers key-exchange protocol is \emph{deniable}.
2574 In this section, we define what we mean, explain the limits of the
2575 deniablility of the protocol as currently presented, fix the protocol with an
2576 additional pass (which can be collapsed to a single message flow by breaking
2577 the protocol's symmetry), and prove the deniability of the resulting
2578 protocol.
2579
2580 Our notion of deniability is taken from Di~Raimondo, Gennaro and Krawczyk
2581 \cite{cryptoeprint:2006:280}, except that, as usual, we opt for a concrete
2582 security approach.
2583
2584 \subsubsection{Discussion}
2585 Our definition for deniability is that, for any adversary interacting with
2586 participants in the protocol, a simulator exists which can compute the same
2587 things as the adversary.  In particular, since an adversary could output a
2588 transcript of the interactions between itself and the parties, it would
2589 follow that a simulator could do this too.  If the simulator is effective,
2590 its output is indistinguishable from that of the real adversary, and hence no
2591 `judge' (distinguisher) should be persuaded by evidence presented by someone
2592 who claims to have witnessed or participated in an interaction.
2593
2594 We work again the model described in~\ref{sec:um}.  That is, our adversary
2595 has complete control over the ordering and delivery of all messages.  The
2596 adversary is also able, at any time, to reveal the state of any session.
2597 However, deniability is obviously impossible against an adversary who can
2598 \emph{corrupt} other parties, since simulating such an adversary's actions
2599 would necessarily require the simulator to compute private keys corresponding
2600 to the known public keys, and this is (we believe) difficult, because an
2601 efficient algorithm for doing this could easily attack our protocol, which we
2602 already proved secure.  Therefore, we forbid the adversary from corrupting
2603 parties.
2604
2605 In order to allow the adversary to participate in the protocol, rather than
2606 merely observing it, we need to give it one or more private keys.  We could
2607 modify the initialization function \id{init} from figure~\ref{fig:wkx-formal}
2608 to give the adversary a private key, but there's an easier way: we can just
2609 give the adversary a number of private keys in its auxiliary input.
2610
2611 \subsubsection{Definitions}
2612 Let $\Pi$ be a key-exchange protocol, in the model described in
2613 section~\ref{sec:um}.  We use the simulation framework of
2614 section~\ref{sec:sim}.  We define the initialization function $I_\Pi$ to be
2615 the initialization function of $\Pi$, as before, and the corresponding
2616 world~$W_\Pi(\iota, \sigma, \tau, \mu)$ is a fairly straightforward mapping
2617 of the adversary's possible actions to the simulation model:
2618 \begin{itemize}
2619 \item The invocation $\cookie{new-session}$ with $\mu = (i, j, s)$ creates a
2620   new session on party~$P_i$, with partner~$P_j$ and session-id~$s$.  The
2621   reply $\rho = (\delta, m)$ is a \emph{decision} $\delta \in
2622   \{\cookie{continue}, \cookie{abort}, \cookie{complete}\}$ and an output
2623   message $m \in \Bin^* \cup \{\bot\}$.  If $m \ne \bot$ then $m$ is a
2624   message to be sent to the matching session (if any).
2625 \item The invocation $\cookie{deliver}$ with $\mu = (i, j, s, m)$ delivers
2626   message $m$ to the session $S = (P_i, P_j, s)$.  The response $\rho$ is as
2627   for $\cookie{new-session}$ invocations.
2628 \item The invocation $\cookie{reveal-session-state}$ with $\mu = (i, j, s)$
2629   reveals to the adversary the state of the running session $S = (P_i, P_j,
2630   s)$.  The response $\rho$ is the session's state if $S$ is indeed a running
2631   session, or $\bot$ otherwise.
2632 \item The invocation $\cookie{reveal-session-key}$ with $\mu = (i, j, s)$
2633   reveals to the adversary the session-key of the completed session~$S =
2634   (P_i, P_j, s)$.  The response $\rho$ is the session key~$K$ if the session
2635   is indeed complete, or $\bot$ otherwise.
2636 \end{itemize}
2637 There are no invocations corresponding to the adversary actions of corrupting
2638 parties (since deniability against an corrupting adversary is impossible, as
2639 discussed earlier), or session expiry or challenging (since they are useless
2640 in this context).
2641
2642 We measure the deniability of a protocol~$\Pi$, using a given simulator~$S$,
2643 by the insecurity function $\InSec{sim}(W_\Pi, I_\Pi, S; t_D, t_A,
2644 \mathcal{Q}_D, \mathcal{Q}_A, \mathcal{R}, \mathcal{U})$ of
2645 definition~\ref{def:sim}.  The interaction bounds $\mathcal{R} = (q_S, q_M)$
2646 we place on the adversary are on the number ($q_S$) of \cookie{new-session}
2647 and ($q_M$) \cookie{deliver} invocations it makes.
2648
2649 We shall (informally) say that a protocol~$\Pi$ is deniable if there is a
2650 simulator~$S_\Pi$ for which the insecurity function is small for appropriate
2651 resource bounds on the adversary and distinguisher.
2652
2653 \subsubsection{The current protocol}
2654 As it stands, $\Wkx$ isn't deniable, according to our definition, for
2655 arbitrary auxiliary inputs.  Let's see why.
2656
2657 Suppose that Bob is an informant for the secret police, and wants to convince
2658 a judge that Alice is involved in subversive activities in cyberspace.
2659 Unfortunately, Bob's job is difficult, because of the strong zero-knowledge
2660 nature of the Wrestlers identification protocol.  However, Bob can work with
2661 the judge to bring him the evidence necessary to convict Alice.  Here's how.
2662
2663 Alice's public key is $A$, and Bob's public key is $B$.  The judge chooses
2664 some session-id $s$, and $r \inr \gf{q}$.  He computes $R = r P$ and $c =
2665 r \xor H_I(B, s, R, r A)$, and gives Bob the triple $(s, R, c)$, keeping $r$
2666 secret.  Bob can now persuade Alice to enter into a key-exchange with him,
2667 with session-id $s$.  He uses $(R, c)$ as his challenge message.  When Alice
2668 sends back her response $(R', \chi)$ (because Bob's challenge is correctly
2669 formed), Bob aborts and shows $(R', \chi)$ to the judge.  The judge knows $r$
2670 and can therefore decrypt $\chi$ and check the response.  If it's wrong, then
2671 Bob was cheating and gets demoted -- he can't get the right answer by himself
2672 because that would require him to impersonate Alice.  If it's right, Alice is
2673 really a subversive element and `disappears' in the night.
2674
2675 We shall show in theorem~\ref{thm:denial} below that this is basically the
2676 only attack against the deniability of the protocol.  However, we can do
2677 better.
2678
2679 \subsubsection{Fixing deniability}
2680 We can fix the protocol to remove even the attack discussed above.  The
2681 change is simple: we feed \emph{both} parties' challenges to the hash
2682 function~$H_I$ rather than just the sender's.  We use a five-argument hash
2683 function (random oracle) $H_I\colon G^2 \times \Bin^{\ell_S} \times G^2 \to
2684 \Bin^{\ell_I}$.  We introduce a new message pass at the beginning of the
2685 protocol: each session simply sends its challenge point $R = r P$ in the
2686 clear as a `pre-challenge'.  The actual challenge is $R$ and $c = r \xor
2687 H_I(X, R', s, R, c)$, where $R'$ is the challenge of the matching session.
2688
2689 By breaking symmetry, we can reduce the communication complexity of this
2690 variant to four messages.  As before, we analyse the symmetrical version.
2691 The extra flow might seem a high price to pay, but we shall see that it has
2692 additional benefits beyond deniability.
2693
2694 A summary of the new protocol is shown in figure~\ref{fig:wdkx}, and the
2695 formal description is shown in figure~\ref{fig:wdkx-formal}.
2696
2697 \begin{figure}
2698   \begin{description}
2699   \item[Setup] Group $G = \langle P \rangle$; $\#G = q$ is prime.
2700     $H_I(\cdot, \cdot, \cdot, \cdot, \cdot)$ and $H_K(cdot)$ are secure
2701     hashes.  $\E = (\kappa, E, D)$ is an IND-CCA2 symmetric encryption
2702     scheme.
2703   \item[Parties] $U_i$ for $0 \le i < n$.
2704   \item[Private keys] $x_i \inr \gf{q}$.
2705   \item[Public keys] $X_i = x_i P$.
2706   \end{description}
2707
2708   \begin{protocol}
2709     $r_i \getsr I$; $R_i \gets r_i P$; &
2710     $r_j \getsr I$; $R_j \gets r_j P$; \\
2711     \send{->}{R_i}
2712     \send{<-}{R_j}
2713     $c_i \gets r_i \xor H_I(R_j, X_i, s, R_i, r_i X_j)$; &
2714     $c_j \gets r_j \xor H_I(R_i, X_j, s, R_j, r_j X_i)$; \\
2715     \send{->}{(R_i, c_i)}
2716     \send{<-}{(R_j, c_j)}
2717     Check $R_j = \bigl(c_j \xor H_I(x_i R_j)\bigr) P$; &
2718     Check $R_i = \bigl(c_i \xor H_I(x_j R_i)\bigr) P$; \\
2719     $Z \gets r_i R_j$; $(K_0, K_1) \gets H_K(Z)$; &
2720     $Z \gets r_j R_i$; $(K_0, K_1) \gets H_K(Z)$; \\
2721     $\chi_i \gets E_{K_0}(x_i R_j)$; &
2722     $\chi_j \gets E_{K_0}(x_j R_i)$; \\
2723     \send{->}{(R_i, \chi_i)}
2724     \send{<-}{(R_j, \chi_j)}
2725     Check $D_{K_0}(\chi_j) = r_i X_j$; &
2726     Check $D_{K_0}(\chi_i) = r_j X_i$; \\
2727     Shared key is $K_1$. & Shared key is $K_1$.
2728   \end{protocol}
2729
2730   \caption{Summary of the Deniable Wrestlers Key Exchange protocol, $\Wdkx$}
2731   \label{fig:wdkx}
2732 \end{figure}
2733
2734 \begin{figure}
2735   \begin{program}
2736     Function $\id{init}(n)$: \+ \\
2737       \FOR $i \in \Nupto{n}$ \DO \\ \ind
2738         $x \getsr \gf{q}$; \\
2739         $\mathbf{i}[i] \gets x$; \\
2740         $\mathbf{p}[i] \gets x P$; \- \\
2741       \RETURN $(\mathbf{p}, \mathbf{i})$;
2742     \- \\[\medskipamount]
2743     Function $\id{new-session}^{H_I(\cdot, \cdot, \cdot, \cdot, \cdot), H_K(\cdot)}
2744       (\mathbf{p}, x, i, j, s)$: \+ \\
2745       $X \gets \mathbf{p}[i]$;
2746       $X' \gets \mathbf{p}[j]$;
2747       $C \gets \emptyset$; \\
2748       $r \getsr \gf{q}$;
2749       $R \gets r P$;
2750       $Y \gets r X'$; \\
2751       \SEND $(\cookie{pre-challange}, R)$;
2752     \- \\[\medskipamount]
2753     Function $\id{message}^{H_I(\cdot, \cdot, \cdot, \cdot, \cdot), H_K(\cdot)}
2754       (\tau, \mu)$: \+ \\
2755       \IF $\tau = \cookie{pre-challenge}$ \THEN
2756         $\id{msg-pre-challenge}(\mu)$; \\
2757       \ELSE \IF $\tau = \cookie{challenge}$ \THEN
2758         $\id{msg-challenge}(\mu)$; \\
2759       \ELSE \IF $\tau = \cookie{response}$ \THEN $\id{msg-response}(\mu)$;
2760     \next
2761     Function $\id{msg-pre-challenge}(\mu)$: \+ \\
2762       $R' \gets \mu$; \\
2763       $h \gets H_I(R', X, s, R, c)$; \\
2764       $c \gets r \xor h$; \\
2765       \SEND $(\id{msg-challenge}, R, c)$;
2766     \- \\[\medskipamount]
2767     Function $\id{msg-challenge}(\mu)$: \+ \\
2768       $(R', c') \gets \mu$; \\
2769       $Y' \gets x R'$; \\
2770       $h' \gets H_I(R, X', s, R', Y')$; \\
2771       $r' \gets c' \xor h'$; \\
2772       \IF $R' \ne r' P$ \THEN \RETURN; \\
2773       $C \gets C \cup \{R\}$; \\
2774       $Z \gets r R'$; \\
2775       $(K_0, K_1) \gets H_K(Z)$; \\
2776       $\chi \gets E_{K_0}(Y')$; \\
2777       \SEND $(\cookie{response}, R, \chi)$;
2778     \- \\[\medskipamount]
2779     Function $\id{msg-response}(\mu)$: \+ \\
2780       $(R', \chi') \gets \mu$; \\
2781       \IF $R' \notin C$ \THEN \RETURN; \\
2782       $Z \gets r R'$; \\
2783       $(K_0, K_1) \gets H_K(Z)$; \\
2784       $Y' \gets D_{K_0}(\chi')$; \\
2785       \IF $Y' \ne Y$ \THEN \RETURN; \\
2786       \OUTPUT $K_1$;
2787       \STOP;
2788   \end{program}
2789
2790   \caption{Deniable key-exchange: formalization of $\Wdkx$}
2791   \label{fig:wdkx-formal}
2792 \end{figure}
2793
2794 The security of this variant is given by the following theorem, whose proof
2795 is \ifshort given in the full version of this paper\else in
2796 appendix~\ref{sec:sk2-proof}\fi.
2797 \begin{theorem}[SK-security of $\Wdkx$]
2798   \label{thm:sk2}
2799   Let $G$ be a cyclic group.  Let $\E = (\kappa, E, D)$ be a symmetric
2800   encryption scheme.  Then
2801   \[ \InSec{sk}(\Wdkx^{G, \E}; t, n, q_S, q_M, q_I, q_K) =
2802        \InSec{sk}(\Wkx^{G, \E}; t, n, q_S, q_M, q_I, q_K)
2803   \]
2804 \end{theorem}
2805
2806 \subsubsection{Deniability of the Wrestlers protocols}
2807 In order to quantify the level of deniability our protocols provide, we shall
2808 impose a limit on the auxiliary input to the adversary.  In particular, we
2809 shall use $\mathcal{U}$ of definition~\ref{def:sim} to count the number of
2810 \emph{challenges} in the auxiliary input.  That is, $\mathcal{U} = n_C$ is
2811 the number of tuples $(i, j, s, R', R, c)$ for which there is an $r$ such
2812 that $R = r P$ and $c = r \xor H_I(R', X_j, s, R, r X_i)$ (or without the
2813 $R'$ for $\Wkx$).
2814
2815 With this restriction in place, we can state the following theorem about the
2816 deniability of our protocols.
2817 \begin{theorem}[Deniability of $\Wkx$ and $\Wdkx$]
2818   \label{thm:denial}
2819   There exist simulators $S_\Wkx$ and $\Wdkx$ such that
2820   \[ \InSec{sim}(W_{\Wkx^{G, \E}}, I_{\Wkx^{G, \E}}, S_{\Wkx^{G, \E}};
2821                  t_D, t_A, \mathcal{Q}_D, \mathcal{Q}_A, (q_S, q_M), 0) \le
2822        \frac{q_M}{2^{\ell_I}}
2823   \]
2824   and
2825   \iffancystyle\[\else\begin{spliteqn*}\fi
2826     \InSec{sim}(W_{\Wdkx^{G, \E}}, I_{\Wdkx^{G, \E}}, S_{\Wdkx^{G, \E}};
2827                 t_D, t_A, \mathcal{Q}_D, \mathcal{Q}_A, (q_S, q_M), n_C) \le
2828     \iffancystyle\else\\\fi
2829        \frac{n_C q_S}{\#G} +
2830        \frac{q_M}{2^{\ell_I}}.
2831   \iffancystyle\]\else\end{spliteqn*}\fi
2832   The running time of the simulators is $O(t_A) + O(\mathcal{Q}_A q_M)$.
2833 \end{theorem}
2834 \begin{longproof}{The proof of this theorem can be found in the full version
2835     of this paper.}
2836   The simulators $S_\Wkx$ and $S_\Wdkx$ are very similar.  We describe both
2837   here.  Both are fake-world simulators, working as follows.
2838   \begin{enumerate}
2839   \item Initially, it constructs simulated parties $P_i$, for $0 \le i < n$,
2840     giving each the public key $X_i$ from the common input.
2841   \item Suppose the adversary requests creation of a new session $S = (P_i,
2842     P_j, s)$.  Then the simulator creates a new session, including a random
2843     value $r_S \inr \gf{q}$, and computes $R_S = r_S P$, and $Y_S = r_S
2844     X_j$.  For $\Wdkx$, it sends the message $(\cookie{pre-challenge}, R_S)$;
2845     for $\Wkx$, it additionally computes $h = H_I(X_i, s, R_S, Y_S)$ and
2846     sends $(\cookie{challenge}, R_S, r_S \xor h)$.
2847   \item Suppose, for $\Wdkx$, the adversary sends a message
2848     $(\cookie{pre-challenge}, R')$ to a session~$S = (P_i, P_j, s)$.  The
2849     simulator computes $h = H_I(R', X_i, s, R_S, Y_S)$, and sends
2850     $(\cookie{challenge}, R_S, r_S \xor h)$.
2851   \item Suppose the adversary sends a message $(\cookie{challenge}, R', c')$
2852     to session $S = (P_i, P_j, s)$.  The simulator doesn't know $x_i$.
2853     \begin{enumerate}
2854     \item If $R' = R_T$ for some other simulated session $T$, then the
2855       simulator knows $r_T$ such that $R_T = r_T P$.  Let $Y' = r_T X_i$.
2856       The simulator computes $h = H_I(X_j, s, R', Y')$ (resp.\ $h = H_I(R_S,
2857       X_j, s, R', Y')$) for $\Wkx$ (resp.\ $\Wdkx$) and checks that $r_T = c'
2858       \xor h$.  If not, the simulator discards the message.  Otherwise, it
2859       computes $(K_0, K_1) = H_K(r_S R')$, and sends the message
2860       $(\cookie{response}, R, E_{K_0}(Y'))$.
2861     \item \label{en:simextract} Otherwise the simulator runs the extractor
2862       $T_\Wident$ on the adversary's history of queries $H_I(X_j, s, R',
2863       \cdot)$ (resp.\ $H_I(R_S, X_j, s, R', \cdot)$) for $\Wkx$ (resp.\
2864       $\Wdkx$).  The extractor returns $(r', Y')$.  If $Y' = \bot$ then the
2865       simulator ignores the message.  Otherwise, the simulator computes
2866       $(K_0, K_1) = H_K(r R')$ and sends back $(\cookie{response}, R,
2867       E_{K_0}(Y'))$.
2868     \end{enumerate}
2869   \item Suppose the adversary sends a message $(\cookie{response}, R', \chi)$
2870     to session $S = (P_i, P_j, s)$.  The simulator computes $(K_0, K_1) =
2871     H_K(r_S R')$, and decrypts $Y' = D_{K_0}(\chi)$.  If $Y' \ne Y_S$ then
2872     the simulator discards the message.  Otherwise, it makes the simulated
2873     session complete, and outputs key $K_1$.
2874   \item Finally, if the adversary reveals a session's state, the simulator
2875     reveals $r_S$ as required; if the adversary reveals a session-key, the
2876     simulator reveals the $K_1$ it output.
2877   \end{enumerate}
2878   The only point where the simulation fails to be perfect is in
2879   \ref{en:simextract}.  Let $R'$ and $c'$ be the values from an incoming
2880   challenge message to session $S = (P_i, P_j, s)$.  Let $r'$ be such that
2881   $R' = r' P$ and let $Y' = r' X_i$.  If a random-oracle query $H_I(X_j, s,
2882   R', Y')$ (or $H_I(R_S, X_j, s, R', Y')$ for $\Wdkx$) has been issued, then
2883   there are a number of possibilities.  Let $h'$ be the result of this query.
2884   \begin{itemize}
2885   \item The adversary made this query.  Then the extractor will find it and
2886     return $Y'$ if $c' = h' \xor r'$, or $\bot$ otherwise.
2887   \item Some simulated session $U = (P_{i'}, P_{j'}, s')$ made this query.
2888     But simulated sessions only make $H_I$-queries when constructing
2889     challenges, so $R' = R_U$ for some session~$U$.  But the simulator does
2890     something different in that case.
2891   \item In $\Wdkx$, the quadruple $(s, R_S, R', c')$ came from the
2892     adversary's auxiliary input.  In this case the simulator must fail.  But
2893     $R_S = r_S P$, and $r_S$ was chosen uniformly at random.  If there are at
2894     most $n_C$ challenge sets in the auxiliary input then this happens with
2895     probability at most $n_C/\#G$ for any given session.
2896   \end{itemize}
2897   We conclude that the simulator fails with probability
2898   \[ \frac{q_M}{2^{\ell_I}} + \frac{q_S n_C}{\#G}. \]
2899   (Note that we only consider $n_C = 0$ for $\Wkx$.)  No adversary can
2900   distinguish the simulator from a real interaction unless the simulator
2901   fails, and the simulator is a fake-world simulator.  We therefore apply
2902   proposition~\ref{prop:fakesim}; the theorem follows.
2903 \end{longproof}
2904
2905 \ifshort\else
2906 \subsection{Practical issues}
2907 \label{sec:practice}
2908
2909 \subsubsection{Denial of service from spoofers}
2910 The adversary we considered in~\ref{sec:um} is very powerful.  Proving
2911 security against such a powerful adversary is good and useful.  However,
2912 there are other useful security properties we might like against weaker
2913 adversaries.
2914
2915 Eavesdropping on the Internet is actually nontrivial.  One needs control of
2916 one of the intermediate routers between two communicating parties.  (There
2917 are tricks one can play involving subversion of DNS servers, but this is also
2918 nontrivial.)  However, injecting packets with bogus source addresses is very
2919 easy.
2920
2921 Layering the protocol over TCP \cite{rfc793} ameliorates this problem because
2922 an adversary needs to guess or eavesdrop in order to obtain the correct
2923 sequence numbers for a spoofed packet; but the Wrestlers protocol is
2924 sufficiently simple that we'd like to be able to run it over UDP
2925 \cite{rfc768}, for which spoofing is trivial.
2926
2927 Therefore, it's possible for anyone on the 'net to send Alice a spurious
2928 challenge message $(R, c)$.  She will then compute $Y = a R$, recover $r' = c
2929 \xor H_I(\ldots, R, Y)$ check that $R = r' P$ and so on.  That's at least two
2930 scalar multiplications to respond to a spoofed packet, and even with very
2931 efficient group operations, coping with this kind of simple denial-of-service
2932 attack might be difficult.
2933
2934 A straightforward solution is to use the Deniable variant of the protocol,
2935 and require a challenge to quote its matching session's challenge $R'$ in its
2936 challenge.  That is, upon receiving a $(\cookie{pre-challenge}, R')$, the
2937 session sends $(\cookie{challenge}, R', R, c)$.  Alice then rejects any
2938 \emph{incoming} challenge message which doesn't quote her current challenge
2939 value.  Now only eavesdroppers can force her to perform expensive
2940 computations.
2941
2942 Indeed, one need not quote the entire challenge $R'$: it suffices to send
2943 some short hard-to-guess hash of it, maybe just the bottom 128 bits or so.
2944
2945 This can't reduce security.  Consider any adversary attacking this protocol
2946 variant.  We can construct an adversary which attacks the original protocol
2947 just as efficiently.  The new adversary attaches fake $R'$ values to
2948 challenges output by other parties, and strips them off on delivery,
2949 discarding messages with incorrect $R'$ values.
2950
2951 \subsubsection{Key confirmation}
2952 Consider an application which uses the Wrestlers protocol to re-exchange keys
2953 periodically.  The application can be willing to \emph{receive} incoming
2954 messages using the new key as soon as the key exchange completes
2955 successfully; however, it should refrain from \emph{sending} messages under
2956 the new key until it knows that its partner has also completed.  The partner
2957 may not have received the final response message, and therefore be unwilling
2958 to accept a new key; it will therefore (presumably) reject incoming messages
2959 under this new key.
2960
2961 While key confirmation is unnecessary for \emph{security}, it has
2962 \emph{practical} value, since it solves the above problem.  If the
2963 application sends a \cookie{switch} message when it `completes', it can
2964 signal its partner that it is indeed ready to accept messages under the new
2965 key.  Our implementation sends $(\cookie{switch-rq}, E_{K_0}(H_S(0, R, R')))$
2966 as its switch message; the exact contents aren't important.  Our
2967 retransmission policy (below) makes use of an additional message
2968 \cookie{switch-ok}, which can be defined similarly.
2969
2970 It's not hard to show that this doesn't adversely affect the security of the
2971 protocol, since the encrypted message is computed only from public values.
2972 In the security proof, we modify the generation of \cookie{response}
2973 messages, so that the plaintexts are a constant string rather than the true
2974 responses, guaranteeing that the messages give no information about the
2975 actual response.  To show this is unlikely to matter, we present an adversary
2976 attacking the encryption scheme by encrypting either genuine responses or
2977 fake constant strings.  Since the adversary can't distinguish which is being
2978 encrypted (by the definition of IND-CCA security,
2979 definition~\ref{def:ind-cca}), the change goes unnoticed.  In order to allow
2980 incorporate our switch messages, we need only modify this adversary, to
2981 implement the modified protocol.  This is certainly possible, since the
2982 messages contain (hashes of) public values.  We omit the details.
2983
2984 However, while the extra message doesn't affect the security of our protocol,
2985 it would be annoying if an adversary could forge the switch request message,
2986 since this would be a denial of service.  In the strong adversarial model,
2987 this doesn't matter, since the adversary can deny service anyway, but it's a
2988 concern against less powerful adversaries.  Most IND-CCA symmetric encryption
2989 schemes also provide integrity of plaintexts \cite{Bellare:2000:AER} (e.g.,
2990 the encrypt-then-MAC generic composition approach \cite{Bellare:2000:AER,%
2991 Krawczyk:2001:OEA}, and the authenticated-encryption modes of
2992 \cite{Rogaway:2003:OBC,Bellare:2004:EAX,McGrew:2004:SPG}), so this isn't a
2993 great imposition.
2994
2995 \subsubsection{Optimization and piggybacking}
2996 We can optimize the number of messages sent by combining them.  Here's one
2997 possible collection of combined messages:
2998 \begin{description}
2999 \item [\cookie{pre-challenge}] $R$
3000 \item [\cookie{challenge}] $R'$, $R$, $c = H_I(R', X, s, R, c) \xor r$
3001 \item [\cookie{response}] $R'$, $R$, $c$, $E_{K_0}(x R')$
3002 \item [\cookie{switch}] $R'$, $E_{K_0}(x R', H_S(0, R, R'))$
3003 \item [\cookie{switch-ok}] $R'$, $E_{K_0}(H_S(1, R, R'))$
3004 \end{description}
3005 The combination is safe:
3006 \begin{itemize}
3007 \item the \cookie{switch} and \cookie{switch-ok} messages are safe by the
3008   argument above; and
3009 \item the other recombinations can be performed and undone in a `black box'
3010   way, by an appropriately defined SK-security adversary.
3011 \end{itemize}
3012
3013 \subsubsection{Unreliable transports}
3014 The Internet UDP \cite{rfc768} is a simple, unreliable protocol for
3015 transmitting datagrams.  However, it's very efficient, and rather attractive
3016 as a transport for datagram-based applications such as virtual private
3017 networks (VPNs).  Since UDP is a best-effort rather than a reliable
3018 transport, it can occasionally drop packets.  Therefore it is necessary for a
3019 UDP application to be able to retransmit messages which appear to have been
3020 lost.
3021
3022 We recommend the following simple retransmission policy for running the
3023 Wrestlers protocol over UDP.
3024 \begin{itemize}
3025 \item Initially, send out the \cookie{pre-challenge} message every minute.
3026 \item On receipt of a \cookie{pre-challenge} message, send the corresponding
3027   full \cookie{challenge}, but don't retain any state.
3028 \item On receipt of a (valid) \cookie{challenge}, record the challenge value
3029   $R'$ in a table, together with $K = (K_0, K_1)$ and the response $Y' = x
3030   R'$.  If the table is full, overwrite an existing entry at random.  Send
3031   the corresponding \cookie{response} message, and retransmit it every ten
3032   seconds or so.
3033 \item On receipt of a (valid) \cookie{response}, discard any other
3034   challenges, and stop sending \cookie{pre-challenge} and \cookie{response}
3035   retransmits.  At this point, the basic protocol described above would
3036   \emph{accept}, so the key $K_1$ is known to be good.  Send the
3037   \cookie{switch} message, including its response to the (now known-good)
3038   sender's challenge.
3039 \item On receipt of a (valid) \cookie{switch}, send back a \cookie{switch-ok}
3040   message and stop retransmissions.  It is now safe to start sending messages
3041   under $K_1$.
3042 \item On receipt of a (valid) \cookie{switch-ok}, stop retransmissions.  It
3043   is now safe to start sending messages under $K_1$.
3044 \end{itemize}
3045
3046 \subsubsection{Key reuse}
3047 Suppose our symmetric encryption scheme $\E$ is not only IND-CCA secure
3048 (definition~\ref{def:ind-cca}) but also provides integrity of plaintexts
3049 \cite{Bellare:2000:AER} (or, alternatively, is an AEAD scheme
3050 \cite{Rogaway:2002:AEA}.  Then we can use it to construct a secure channel,
3051 by including message type and sequence number fields in the plaintexts, along
3052 with the message body.  If we do this, we can actually get away with just the
3053 one key $K = H_K(Z)$ rather than both $K_0$ and $K_1$.
3054
3055 To do this, it is essential that the plaintext messages (or additional data)
3056 clearly distinguish between the messages sent as part of the key-exchange
3057 protocol and messages sent over the `secure channel'.  Otherwise, there is a
3058 protocol-interference attack: an adversary can replay key-exchange
3059 ciphertexts to insert the corresponding plaintexts into the channel.
3060
3061 We offer a sketch proof of this claim in appendix~\ref{sec:sc-proof}.
3062 \fi
3063
3064 %%%--------------------------------------------------------------------------
3065
3066 \section{Conclusions}
3067 \label{sec:conc}
3068
3069 We have presented new protocols for identification and authenticated
3070 key-exchange, and proven their security.  We have shown them to be efficient
3071 and simple.  We have also shown that our key-exchange protocol is deniable.
3072 Finally, we have shown how to modify the key-exchange protocol for practical
3073 use, and proven that this modification is still secure.
3074
3075 %%%--------------------------------------------------------------------------
3076
3077 \section{Acknowledgements}
3078
3079 The Wrestlers Protocol is named after the Wrestlers pub in Cambridge where
3080 Clive Jones and I worked out the initial design.
3081
3082 %%%--------------------------------------------------------------------------
3083
3084 \iffalse
3085 \bibliography{%
3086   mdw-crypto,%
3087   eprint,%
3088   focs1990,stoc1990,tissec,jacm,%
3089   lncs1997a,lncs1997b,lncs1998a,lncs2001a,%
3090   cryptography1990,cryptography2000,cryptography2010,cryptography,%
3091   rfc,std}
3092 \else
3093 \bibliography{wrestlers}
3094 \fi
3095
3096 %%%--------------------------------------------------------------------------
3097
3098 \ifshort\def\next{\end{document}}\expandafter\next\fi
3099 \appendix
3100 \section{Proofs}
3101
3102 \subsection{Proof of theorem~\ref{thm:sk}}
3103 \label{sec:sk-proof}
3104
3105 Before we embark on the proof proper, let us settle on some notation.  Let
3106 $P_i$ be a party.  Then we write $x_i$ for $P_i$'s private key and $X_i = x_i
3107 P$ is $P_i$'s public key.  Let $S = (P_i, P_j, s)$ be a session.  We write
3108 $r_S$ for the random value chosen at the start of the session, and $R_S$,
3109 $c_S$ etc.\ are the corresponding derived values in that session.
3110
3111 The proof uses a sequence of games.  For each game~$\G{i}$, let $V_i$ be the
3112 event that some pair of unexposed, matching sessions both complete but output
3113 different keys, and let $W_i$ be the event that the adversary's final output
3114 equals the game's hidden bit~$b^*$.  To save on repetition, let us write
3115 \[ \diff{i}{j} = \max(|\Pr[V_i] - \Pr[V_j]|, |\Pr[W_i] - \Pr[W_j]|). \]
3116 Obviously,
3117 \[ \diff{i}{j} \le \sum_{i\le k<j} \diff{k}{k + 1}. \]
3118
3119 Here's a quick overview of the games we use.
3120 \begin{itemize}
3121 \item $\G0$ is the original SK-security game.
3122 \item In $\G1$, we abort the game unless all parties' public keys are
3123   distinct.  Since keys are generated at random, parties are unlikely to be
3124   given the same key by accident.
3125 \item In $\G2$, we change the way sessions respond to challenge messages, by
3126   using the extractor to fake up answers to most challenges.  Since the
3127   extractor is good, the adversary is unlikely to notice.
3128 \item In $\G3$, we abort the game if the adversary ever queries $H_K(\cdot)$
3129   on the Diffie-Hellman secret $r_S r_T P$ shared between two unexposed
3130   matching sessions.  We show that this is unlikely to happen if the
3131   Diffie-Hellman problem is hard.
3132 \item In $\G4$, we abort the game if any unexposed session \emph{accepts} a
3133   response message which wasn't sent by a matching session.
3134 \end{itemize}
3135 Finally, we show that the adversary has no advantage in $\G4$.  The theorem
3136 follows.
3137
3138 For ease of comprehension, we postpone the detailed proofs of some of the
3139 steps until after we conclude the main proof.
3140
3141 Let $A$ be a given adversary which runs in time~$t$, creates at most~$q_S$
3142 sessions, delivers at most~$q_M$ messages, and makes at most~$q_I$ queries to
3143 its $H_I(\cdot, \cdot, \cdot, \cdot)$ oracle and at most~$q_K$ queries to its
3144 $H_K(\cdot)$ oracle.  Let $\G0$ be the original SK-security game of
3145 definition~\ref{def:sk}, played with adversary~$A$.
3146
3147 Game~$\G1$ is the same as game~$\G0$ except, if the initialization function
3148 reports two parties as having the same public key (i.e., we have $X_i \ne
3149 X_j$ where $0 \le i < j < n$), we stop the game immediately and without
3150 crediting the adversary with a win.  This only happens when the corresponding
3151 private keys are equal, i.e., $x_i = x_j$, and since the initialization
3152 function chooses private keys uniformly at random, this happens with
3153 probability at most $\binom{n}{2}/\#G$.  Since if this doesn't happen, the
3154 game is identical to $\G0$, we can apply lemma~\ref{lem:shoup}, and see that
3155 \begin{equation}
3156   \label{eq:sk-g0-g1}
3157   \diff{0}{1} \le \frac{1}{\#G} \binom{n}{2} = \frac{n (n - 1)}{2 \#G}.
3158 \end{equation}
3159 In game~$\G1$ and onwards, we can assume that public keys for distinct
3160 parties are themselves distinct.  Note that the game now takes at most
3161 $O(q_I)$ times longer to process each message delivered by the adversary.
3162 This is where the $O(q_I q_M)$ term comes from in the theorem statement.
3163
3164 Game~$\G2$ is the same as game~$\G1$, except that we change the way that we
3165 make parties respond to \cookie{challenge} messages $(\cookie{challenge}, R,
3166 c)$.  Specifically, suppose that $S = (P_i, P_j, s)$ is a session.
3167 \begin{itemize}
3168 \item Suppose $T = (P_j, P_i, s)$ is the matching session of $S$.  The game
3169   proceeds as before if $(R, c) = (R_T, c_T)$ is the challenge issued by $T$.
3170 \item Otherwise, we run the extractor $T_\Wident$ on the adversary's history
3171   so far of oracle queries $H_I(X_i, s, R, \cdot)$ to determine a pair $(r,
3172   Y)$.  If $r = \bot$ then we discard the message.  Otherwise, we add $R$ to
3173   the list~$C$, and return a fake response to the adversary by computing $K =
3174   H_K(r R_S)$ and handing the adversary $(\cookie{response}, R_S, E_K(Y))$.
3175 \end{itemize}
3176 The following lemma shows how this affects the adversary's probabilities of
3177 winning.
3178 \begin{lemma}
3179   \label{lem:sk-g1-g2}
3180   \begin{equation}
3181     \label{eq:sk-g1-g2}
3182     \diff{1}{2} \le \frac{q_M}{2^{\ell_I}}.
3183   \end{equation}
3184 \end{lemma}
3185
3186 Let us say that a session $S = (P_i, P_j, s)$ is \emph{ripe} if
3187 \begin{itemize}
3188 \item there is a matching session $T = (P_j, P_i, s)$, and
3189 \item $S$ is unexposed.
3190 \end{itemize}
3191 Suppose that $S$ is a ripe session, and that it has a matching session~$T$:
3192 let $Z_S = Z_T = r_S r_T P$.
3193
3194 Game~$\G3$ is the same as $\G2$, except that the game is immediately aborted
3195 if ever the adversary queries its random oracle $H_K(\cdot)$ at a value $Z_S$
3196 for any ripe session~$S$.  The following lemma shows how this affects the
3197 adversary's probabilities of winning.
3198 \begin{lemma}
3199   \label{lem:sk-g2-g3}
3200   For some $t'$ within the bounds given in the theorem statement we have
3201   \begin{equation}
3202     \label{eq:sk-g2-g3}
3203     \diff{2}{3} \le q_S \InSec{mcdh}(G; t', q_K).
3204   \end{equation}
3205 \end{lemma}
3206
3207 Game~$\G4$ is the same as $\G3$ except that the game is immediately aborted
3208 if ever the adversary sends a response message to a ripe session~$S$ which
3209 wasn't output by its matching session as a response to $S$'s challenge, with
3210 the result that $S$ completes.
3211
3212 Let's make this more precise.  Let $U$ and $V$ be a pair of matching
3213 sessions.  Let $C_U = (\cookie{challenge}, R_U, c_U$ be the challenge message
3214 sent by $U$.  Let $M_T$ be the set of messages which $T$ has sent upon
3215 delivery of $C_U$.  Then, in $\G4$, we abort the game if, for any pair $S$
3216 and~$T$ of matching, unexposed sessions, $S$ has completed as a result of
3217 being sent a message $\mu \notin M_T$.  We have the following lemma.
3218 \begin{lemma}
3219   \label{lem:sk-g3-g4}
3220   For a $t'$ within the stated bounds, we have
3221   \begin{equation}
3222     \label{eq:sk-g3-g4}
3223     \diff{3}{4} \le q_S \bigl( \InSec{ind-cca}(\E; t', q_M, q_M) +
3224                          n \cdot \InSec{mcdh}(G; t', q_M + q_I) \bigr)
3225   \end{equation}
3226 \end{lemma}
3227
3228 Finally, let us consider the state we're in with $\G4$.
3229 \begin{itemize}
3230 \item No ripe session completes except as a result the adversary faithfully
3231   delivering messages between it and its matching session.
3232 \item The adversary never queries $Z_S$ for any ripe session~$S$.  If we set
3233   $K_S = (K_{S, 0}, K_{S, 1}) = H_K(Z_S)$, then $K_{S, 1}$ is the key output
3234   by $S$ when it completes.
3235 \item If $S$ and $T$ are matching ripe sessions, then $K_S = K_T$, since $Z_S
3236   = r_S R_T = r_T R_S = Z_T$.
3237 \item For any ripe session~$S$, $K_{S, 1}$ is uniformly distributed in
3238   $\Bin^\kappa$ and independent of the adversary's view.
3239 \item If $S = (P_i, P_j, s)$ and $T = (P_j, P_i, s)$ are matching ripe
3240   sessions, then $Z_S$ depends only $r_S$ and $r_T$.  Hence, once $S$ and~$T$
3241   complete, and erase their states, $Z_S$ is independent of everything except
3242   the messages sent between the two sessions.  In particular, $Z_S$ is
3243   independent of the long-term secrets $x_i$ and~$x_j$, so if either player
3244   is later corrupted, the key $K_{S, 1}$ remains independent of the
3245   adversary's view.
3246 \item Hence, the keys output by unexposed sessions are indistinguishable from
3247   freshly-generated random strings, and remain so indefinitely.
3248 \end{itemize}
3249 We conclude that, for any adversary $A$,
3250 \begin{equation}
3251   \label{eq:sk-g4}
3252   \Pr[V_4] = 0 \qquad \text{and} \qquad \Pr[W_4] = \frac{1}{2}.
3253 \end{equation}
3254 Putting equations~\ref{eq:sk-g0-g1}--\ref{eq:sk-g4} together, we find
3255 \begingroup \splitright=4em minus 4em
3256 \begin{spliteqn}
3257   \Adv{sk}{\Wident^{G, \E}}(A) \le
3258      2 q_S \bigl(\InSec{ind-cca}(\E; t', q_M, q_M) + {} \\
3259      \InSec{mcdh}(G; t', q_K) +
3260      n \,\InSec{mcdh}(G; t', q_M + q_I) \bigr) + {}
3261      \frac{n (n - 1)}{\#G} +
3262      \frac{2 q_M}{2^{\ell_I}}.
3263 \end{spliteqn} \endgroup
3264 The theorem follows, since $A$ was chosen arbitrarily.
3265
3266
3267 \begin{proof}[Proof of lemma~\ref{lem:sk-g1-g2}]
3268   The two games $\G1$ and~$\G2$ differ only in whether they accept or reject
3269   particular challenge messages $(\cookie{challenge}, R, c)$.
3270
3271   We claim firstly that no message is \emph{accepted} by $\G2$ which would
3272   have been rejected by $\G1$.  To prove the claim, it is sufficient to note
3273   that the extractor's output, if not $\bot$, is always correct, and hence if
3274   $\G2$ accepts a message then $\G1$ would have done so too.
3275
3276   Since $\G2$ also behaves identically when the adversary submits to~$S$ the
3277   challenge from the matching session~$T$, we have nothing to prove in this
3278   case.  Let $F$ be the event that the adversary submits a message
3279   $(\cookie{challenge}, R, c)$ to a session~$S$ which $S$ would have accepted
3280   in $\G1$ but would be rejected by the new rule in~$\G2$.  By
3281   lemma~\ref{lem:shoup} we have $\diff{1}{2} \le \Pr[F]$.  To prove the
3282   current lemma, therefore, we must show that $\Pr[F] \le q_M/2^{\ell_I}$.
3283
3284   Rather than consider individual challenge messages, we consider
3285   \emph{classes} of messages.  We shall refer to a quadruple~$\Cid = (i, j,
3286   s, R)$ as a \emph{class-id}, and define some useful functions:
3287   \begin{itemize}
3288   \item the class's \emph{session} $\Csession(\Cid) = (P_i, P_j, s)$;
3289   \item the class's \emph{index} $\Cindex(\Cid)$ is $r \in I$ where $R = r
3290     P$, which is well-defined by lemma~\ref{lem:unique-dl};
3291   \item the class's \emph{query} $\Cquery(\Cid) = (X_j, s, R, x_i R)$;
3292   \item the class's \emph{hash} $\Chash(\Cid) = H_I(\Cquery(\Cid)) = H_I(X_j,
3293     s, R, x_i R)$;
3294   \item the class's \emph{check-value} $\Ccheck(\Cid) = \Chash(\Cid) \xor
3295     \Cindex(\Cid)$;
3296   \item the class's \emph{check-set} $\Ccheckset(\Cid)$ is the set of
3297     check-values $c$ such that a message $(\cookie{challenge}, R, c)$ was
3298     sent to session $S = (P_i, P_j, s)$; and
3299   \item the class's \emph{count} $\Ccount(\Cid) = |\Ccheckset(\Cid)|$.
3300   \end{itemize}
3301
3302   Consider any class-id~$\Cid = (i, j, s, R)$.  A natural question which
3303   arises is: which participants have issued $\Cid$'s query, i.e., queried
3304   $H_I$ at $\Cquery(\Cid)$?
3305
3306   We can characterise the $H_I(\cdot, \cdot, \cdot, \cdot)$ queries of a
3307   session $U = (P_{i'}, P_{j'}, s')$ as follows:
3308   \begin{itemize}
3309   \item computing the check-value for the challenge $R_U$ by querying
3310     $H_I(X_{i'}, s', R_U, r_U X_{j'})$, and
3311   \item checking an incoming challenge~$R'$ by querying $H_I(X_{j'}, s', R',
3312     x_{i'} R')$.
3313   \end{itemize}
3314   The class~$\Cid$'s query $\Cquery(\Cid)$ is $U$'s check-value query if
3315   \[ (j, i, s, R) = (i', j', s', R_U) \]
3316   i.e., $U$ is the matching session of $\Csession(\Cid)$, and moreover $R =
3317   R_U$ is the challenge value issued by $U$.  For any $c \in
3318   \Ccheckset(\Cid)$, if $c = \Ccheck(\Cid)$ then $(\cookie{challenge}, R, c)$
3319   is precisely the challenge message issued by~$U$ to $\Csession(\Cid)$; the
3320   rules for handling this message didn't change.  However, if $c \ne
3321   \Ccheck(\Cid)$ then the message would have been rejected in $\G1$, and we
3322   have already shown that $\G2$ continues to reject all messages rejected by
3323   $\G1$.
3324
3325   Let us say that a class-id~$\Cid = (i, j, s, R)$ is \emph{bad} if
3326   \begin{enumerate}
3327   \item the value $R$ is not the challenge issued by $\Csession(\Cid)$'s
3328     matching session, and
3329   \item the adversary has not issued $\Cid$'s query $\Cquery(\Cid)$,
3330     \emph{but}
3331   \item $\Ccheck(\Cid) \in \Ccheckset(\Cid)$, so one of the check-values
3332     submitted to $S$ was actually correct.
3333   \end{enumerate}
3334   We claim that our extractor will work perfectly unless some class-id is
3335   bad.  Certainly, if $R$ was issued by the matching session, there is
3336   nothing to prove; if the adversary has issued the relevant query then the
3337   extractor will recover $\Cindex(\Cid)$ just fine; and if $\Ccheck(\Cid)
3338   \notin \Ccheckset(\Cid)$ then all messages in the class would have been
3339   rejected by $\G1$ anyway.
3340
3341   Let $B(\Cid)$ be the event that the class~$\Cid$ is bad.  We claim that
3342   \[ \Pr[B(\Cid)] \le \frac{\Ccount(\Cid)}{2^{\ell_I}}. \]
3343   The present lemma follows, since
3344   \[ \diff{1}{2}
3345      \le \Pr[F]
3346      \le \sum_\Cid \Pr[B(\Cid)]
3347      \le \sum_\Cid \frac{\Ccount(\Cid)}{2^{\ell_I}}
3348      =   \frac{1}{2^{\ell_I}} \sum_\Cid \Ccount(\Cid)
3349      \le \frac{q_M}{2^{\ell_I}}
3350   \]
3351   as required.
3352
3353   Now observe that, in $\G2$, sessions don't actually check incoming
3354   challenges in this way any more -- instead we run the extractor.  So, to
3355   prove the claim, we consider a class~$\Cid$ where properties~1 and~2 above
3356   hold.  The correct hash $\Chash(\Cid)$ is then independent of the rest of
3357   the game, so the probability that $\Ccheck(\Cid) \in \Ccheckset(\Cid)$ is
3358   precisely $\Ccount(\Cid)/2^{\ell_I}$ as required.
3359
3360   This completes the proof the lemma.
3361 \end{proof}
3362
3363 \begin{proof}[Proof of lemma~\ref{lem:sk-g2-g3}]
3364   Let $F$ be the event that the adversary makes a query $H_K(Z_S)$ for some
3365   ripe session~$S$.  Since $\G3$ proceeds exactly as $\G2$ did unless $F_2$
3366   occurs, we apply lemma~\ref{lem:shoup}, which tells us that $\diff{2}{3}
3367   \le \Pr[F_2]$.  We must therefore bound this probability.
3368
3369   To do this, we consider a new game~$\G3'$, which is the same as $\G3$,
3370   except that, at the start of the game, we choose a random number $k \inr
3371   \Nupto{q_S}$.  For $0 \le i < q_S$, let $S_i$ be the $i$th session created
3372   by the adversary.  We define $F'$ to be the event that the adversary
3373   queries $H_K(Z_{S_k})$ when $S_k$ is ripe.
3374
3375   The lemma now follows from these two claims.
3376
3377   \begin{claim}
3378     $\Pr[F] \le q_S \Pr[F']$.
3379   \end{claim}
3380   To see this, for any session~$S$, let $F_S$ be the event that the adversary
3381   queries~$H_K(Z_S)$ when $S$ is ripe.  Then
3382   \[ \Pr[F] \le \sum_{0\le i<q_S} \Pr[F_{S_i}]. \]
3383   Hence,
3384   \[ \Pr[F'] = \Pr[F_{S_k}] = \sum_{0\le i<q_S} \Pr[F_{S_i}] \Pr[k = i]
3385              = \frac{1}{q_S} \sum_{0\le i<q_S} \Pr[F_{S_i}]
3386              \ge \frac{\Pr[F]}{q_S}
3387   \]
3388   proving the claim.
3389
3390   \begin{claim}
3391     For some $t' = t + O(n) + O(q_S q_M) + O(q_I) + O(q_K)$, we have
3392     $\Pr[F'] \le \InSec{mcdh}(G; t', q_K).$
3393   \end{claim}
3394   To prove this claim, we construct an adversary~$B$ which solves the MCDH
3395   problem in~$G$.  The adversary works as follows.
3396   \begin{enumerate}
3397   \item It is given a pair $(R^*, S^*) = (r^* P, s^* P)$ of group elements;
3398     its objective is to make a verification-oracle query $V(Z^*)$ where $Z^*
3399     = r^* s^* P$.
3400   \item It sets up a simulation of the game~$\G3'$, by running the
3401     $\id{init}$ function, and simulating all of the parties.  In particular,
3402     it chooses a random~$k \in \Nupto{q_S}$.
3403   \item It sets up accurate simulations of the random oracles $H_K(\cdot)$
3404     and $H_I(\cdot, \cdot, \cdot, \cdot)$, which choose random outputs for
3405     new, fresh inputs.  However, whenever $A$ queries $H_K(\cdot)$ on a group
3406     element $Z$, $B$ also queries $V(Z)$.
3407   \item It runs $A$ in its simulated game.  It responds to all of $A$'s
3408     instructions faithfully, until the $k$th session-creation.
3409   \item When creating the $k$th session $S = S_k = (P_i, P_j, s)$, $B$ has
3410     party~$P_i$ choose $R^*$ as its challenge, rather than choosing $r_S$ and
3411     setting $R_S = r_S P$.  Because it simulates all the parties, $B$ can
3412     compute $Y_S = x_j R$, which is still correct.
3413   \item If $A$ requests the creation of a matching session $T = (P_j, P_i,
3414     s)$ then $B$ has party~$P_j$ choose $S^*$ as its challenge.  Again, $B$
3415     computes $Y_T = x_i S^*$.
3416   \item If $A$ ever corrupts the parties $P_i$ or $P_j$, or reveals the
3417     session state of $S$ or $T$ then $B$ stops the simulation abruptly and
3418     halts.
3419   \end{enumerate}
3420   Adversary $B$'s running time is within the bounds required of $t'$, and $B$
3421   makes at most $q_K$ queries to $V(\cdot)$; we therefore have
3422   \[ \Pr[F'] \le \Succ{mcdh}{G}(B) \le \InSec{mcdh}(G; t', q_K) \]
3423   as required.
3424 \end{proof}
3425
3426 \begin{proof}[Proof of lemma~\ref{lem:sk-g3-g4}]
3427   Let $F_4$ be the event under which we abort the game~$\G4$.  Clearly, if
3428   $F$ doesn't occur, games $\G3$ and $\G4$ proceed identically, so we can
3429   apply lemma~\ref{lem:shoup} to see that $\diff{3}{4} \le \Pr[F_4]$.
3430   Bounding $\Pr[F_4]$, however, is somewhat complicated.  We use a further
3431   sequence of games.
3432
3433   Firstly, let $\G5$ be like $\G4$ with the exception that we choose, at
3434   random, an integer~$k \inr \Nupto{q_S}$.  As we did in the proof for
3435   lemma~\ref{lem:sk-g3-g4}, let $S_i$ be the $i$th session created by the
3436   adversary.  For each session~$S_i$, let $T_i$ be its matching session, if
3437   there is one.  We define $F_5$ to be the event that
3438   \begin{itemize}
3439   \item $S_k$ completes immediately following delivery of a message $\mu
3440     \notin M_{T_k}$, and
3441   \item $S_k$ was ripe at this point.
3442   \end{itemize}
3443   For games~$\G{i}$, for $i > 5$, we define the event $F_i$ to be the event
3444   corresponding to $F_5$ in $\G{i}$.  Note that if $S_k$ \emph{is} sent a
3445   message in $M_{T_k}$ then $S_k$ immediately completes.
3446
3447   \begin{claim}
3448     $\Pr[F_4] \le \Pr[F_5]/q_S$.
3449   \end{claim}
3450   This claim is proven exactly as we did for claim~1 of
3451   lemma~\ref{lem:sk-g2-g3}.
3452
3453   Let~$\G6$ be the same as $\G5$ except that we change the encrypted
3454   responses of session~$S_k$ and its matching session~$T_k$.  Let $K^* =
3455   (K_0^*, K_1^*) = H_K(Z_S)$.  Then, rather than sending $(\cookie{response},
3456   R_S, E_{K_0^*}(Y_T))$, session~$S$ sends $(\cookie{response}, R_S,
3457   E_{K_0^*}(1^{\ell_G}))$.
3458   \begin{claim}
3459     $|\Pr[F_6] - \Pr[F_5]| \le \InSec{ind-cca}(\E; t', q_M, q_M).$
3460   \end{claim}
3461   To prove this claim, we construct an adversary~$B$ which attacks the
3462   IND-CCA security of our encryption scheme $\E$.  The adversary~$B$ works as
3463   follows.
3464   \begin{enumerate}
3465   \item It is given no input, but a pair of oracles $E(\cdot, \cdot)$ and
3466     $D(\cdot)$; the former encrypts either the left or right input, according
3467     to a hidden bit, and the latter decrypts ciphertexts other than those
3468     returned by $E(\cdot, \cdot)$.  Its goal is to guess the hidden bit.
3469   \item It sets up a simulation of the game~$\G5$, by running the $\id{init}$
3470     function, and simulating all of the parties.  In particular, it chooses a
3471     random $k \in \Nupto{q_S}$.
3472   \item It sets up accurate simulations of the random oracles $H_K(\cdot)$
3473     and $H_I(\cdot, \cdot, \cdot, \cdot)$.
3474   \item It runs $A$ in its simulated game.  It responds to all of $A$'s
3475     instructions faithfully, except for the matching sessions $S_k$ and
3476     $T_k$.  Let $S = S_k = (P_i, P_j, s)$, and $T = T_k = (P_j, P_i, s)$.
3477   \item Suppose $T$ is sent the message $C_S = (\cookie{challenge}, R_S,
3478     c_S)$.  Rather than computing $K^* = H_K(r_T R_S)$ and performing the
3479     encryption properly, $B$ queries its left-or-right encryption oracle
3480     $E(\cdot, \cdot)$ on $E(1^{\ell_G}, x_j R_S)$, and sends the resulting
3481     ciphertext~$\chi$ back to~$S$ as part of a message $(\cookie{response},
3482     R_T, \chi)$.  The set $M_T$ is precisely the set of messages constructed
3483     in this fashion.  (Recall that challenge messages other than $C_S$ aren't
3484     actually delivered to $T$, since we simulate the responses using the
3485     extractor, as of $\G2$.)
3486   \item Suppose $S$ is sent a message $M = (\cookie{response}, R_T, \chi) \in
3487     M_T$.  We immediately stop the simulation, and $B$ returns $0$.
3488   \item Suppose, instead, that $S$ is sent some message $M' =
3489     (\cookie{response}, R, \chi) \notin M_T$.  There are two cases to
3490     consider.  If $R = R_T$ then we must have $\chi$ distinct from the
3491     ciphertexts returned by the $E(\cdot, \cdot)$ oracle, so we can invoke
3492     the decryption oracle $D(\cdot)$ on $\chi$ to obtain a response $Y$.
3493     Alternatively, if $R \ne R_T$, we can compute the key $K = (K_0, K_1) =
3494     H_K(r_S R)$, and recover $Y = D_{K_0}(\chi)$.  In either case, if $Y =
3495     r_S X_j)$ then $S$ would complete at this point: $B$ stops the simulation
3496     and returns $1$.
3497   \item If $A$ exposes $S$ (by corrupting $P_i$ or~$P_j$, or revealing $S$ or
3498     $T$) then we stop the simulation and $B$ returns $0$.
3499   \item Finally, if the game stops, either because $A$ halts, or because of
3500     one of the special rules introduced in earlier games, $B$ returns $0$.
3501   \end{enumerate}
3502   It is clear that $B$'s oracle queries are acceptable, since $|x_j R_S| =
3503   \ell_G$ by definition, and $B$ never queries $D(\cdot)$ on a ciphertext
3504   returned by its encryption oracle.  By the rules of~$\G3$, we know that the
3505   game stops immediately if $A$ ever queries $Z_S$, so the key $K^*$ is
3506   independent of everything in $A$'s view except the ciphertexts $\chi$
3507   output by $S$ and $T$.  Therefore, if the hidden bit of the IND-CCA game is
3508   $1$, $B$ accurately simulates $\G5$, whereas if the bit is $0$ then $B$
3509   accurately simulates $\G6$.  We issue no more that $q_M$ encryption or
3510   decryption queries.  Finally, $B$'s running time is within the bounds
3511   allowed for $t'$.  Therefore,
3512   \[ \Adv{ind-cca}{\E}(B) = \Pr[F_5] - \Pr[F_6]
3513      \le \InSec{ind-cca}(\E; t', q_M, q_M). \]
3514   We construct the adversary~$\bar{B}$ which is the same as $B$ above, except
3515   that $\bar{B}$ returns $0$ whenever $B$ returns~$1$, and \emph{vice versa}.
3516   Clearly
3517   \[ \Adv{ind-cca}{\E}(\bar{B})
3518      = (1 - \Pr[F_5]) - (1 - \Pr[F_6])
3519      = \Pr[F_6] - \Pr[F_5]
3520      \le \InSec{ind-cca}(\E; t', q_M, q_M).
3521   \]
3522   This proves the claim.
3523
3524   Let $\G7$ be the same as $\G6$, except that at the start of the game we
3525   choose a random $m \in \Nupto{n}$, and when the adversary creates the
3526   session $S = S_k = (P_i, P_j, s)$, we abort the game unless $j = m$.
3527   Clearly we have $\Pr[F_6] = n \Pr[F_7]$.
3528
3529   Finally, we can explicitly bound $F_6$.  In $\G6$, the adversary's view is
3530   independent of the correct response $Y_S = r_S X_S = x_j R_S$ to $S$'s
3531   challenge.  Therefore, if $A$ manages to send any message $\mu \notin M_T$
3532   which causes $S$ to complete, then it has impersonated~$P_j$.
3533   \begin{claim}
3534     $\Pr[F_7] \le \InSec{mcdh}(G; t', q_M + q_I)$.
3535   \end{claim}
3536   The present lemma follows from this and the previous claims.
3537
3538   To prove the claim formally, we construct an adversary~$B'$, which behaves
3539   as follows.
3540   \begin{enumerate}
3541   \item It is given as input a public key $X^*$ and a single challenge $(R^*,
3542     c^*)$, a random oracle $H^*_I(\cdot, \cdot)$, and an oracle $V(\cdot,
3543     \cdot)$, which verifies responses $(R, Y)$.  Its goal is to invoke
3544     $V(\cdot, \cdot)$ with a correct response to the challenge.
3545   \item It chooses a random $k \in \Nupto{q_S}$ and $m \in \Nupto{n}$. It
3546     sets up a simulation of the game~$\G7$, by running the $\id{init}$
3547     function, and simulating all of the parties, except that it gives party
3548     $P_m$ the public key $X^*$.  This makes no difference, since $P_m$
3549     doesn't actually need to give any `honest' responses because of the
3550     change we made in $\G6$.
3551   \item It sets up accurate simulations of the random oracles $H_K(\cdot)$
3552     and $H_I(\cdot, \cdot, \cdot, \cdot)$, with one exception -- see below.
3553   \item It runs $A$ in its simulated game.  It responds to all of $A$'s
3554     instructions faithfully, except for the session $S_k$.  Let $S = S_k =
3555     (P_i, P_j, s)$, and let $T = T_k = (P_j, P_i, s)$ be its matching
3556     session.
3557   \item When session~$S$ is created, $B'$ checks that $j = m$, and if not
3558     stops the simulation and halts.  Otherwise, $B'$ invokes its oracle~$C()$
3559     to obtain a pair $(R, c)$.  Session~$S$ sends $C_S = (\cookie{challenge},
3560     R, c)$ as its challenge to~$T$.
3561   \item When $A$ makes a query $H_I(X^*, s, R, Y)$, $B$ answers it by
3562     querying its \emph{own} random oracle $H^*_I(R, Y)$.
3563   \item When $S$ receives a message $(\cookie{response}, R, \chi)$, we
3564     compute $(K_0, K_1) = r_S R$, and $Y = D_{K_0}(\chi)$.  If $Y \ne \bot$
3565     then $B'$ calls $V(R, Y)$.
3566   \item If $A$ reveals $S$ or corrupts $P_i$ or $P_j$ then $B'$ stops the
3567     simulation immediately and halts.
3568   \end{enumerate}
3569   The running time of $B'$ is within the bounds required of $t'$; it makes at
3570   most $q_I$ random-oracle and at most $q_M$ verification queries.  Clearly
3571   $B'$ succeeds whenever $F_7$ occurs.  The claim follows from
3572   theorem~\ref{thm:wident-sound}.
3573 \end{proof}
3574
3575
3576 \subsection{Proof of theorem~\ref{thm:sk2}}
3577 \label{sec:sk2-proof}
3578
3579 The proof is almost identical to the proof of theorem~\ref{thm:sk}, in
3580 appendix~\ref{sec:sk-proof}.  Unfortunately a black-box reduction doesn't
3581 seem possible.
3582
3583 We use the games and notation of section~\ref{sec:sk-proof}.
3584
3585 The change to the check-value calculation doesn't affect key-generation at
3586 all, so the transition to $\G1$ goes through as before.
3587
3588 The transition from $\G1$ to $\G2$ -- answering challenges using the
3589 extractor -- needs a little care.  Let $S = (P_i, P_j, s)$ be a session, and
3590 consider an incoming message $(\cookie{challenge}, R, c)$.
3591 \begin{itemize}
3592 \item If $T = (P_j, P_i, s)$ is the matching session to $S$, and $R = R_T$ is
3593   the public challenge value of $T$, and $c = r_T \xor H_I(R_S, X_j, s, R_T,
3594   r_T X_i)$ is the check-value output by $T$ when it received
3595   $(\cookie{pre-challenge}, R_S)$ as input, then $S$ replies as it did in
3596   $\G1$.
3597 \item If the challenge message is any other message, then we use the
3598   extractor.
3599 \end{itemize}
3600 As in lemma~\ref{lem:sk-g1-g2}, we examine which sessions could have queried
3601 $H_I(R_S, X_j, s, R, x_i R)$, and for the same reasons conclude that only the
3602 matching session would have done this, and only in response to the
3603 pre-challenge $R_S$.  It follows that $\diff{1}{2} \le q_M/2^{\ell_I}$ as
3604 before.
3605
3606 The remaining game steps go through unchanged.  In particular, we conclude
3607 that a ripe session will only complete if the adversary has transmitted
3608 messages from its matching session correctly, and the session key is
3609 independent of the adversary's view.  The theorem follows.
3610
3611
3612 \subsection{Sketch proof of single-key protocol for secure channels}
3613 \label{sec:sc-proof}
3614
3615 We want to show that the Wrestlers Key-Exchange protocol, followed by use of
3616 the encryption scheme $\E$, with the \emph{same} key $K = K_0$, still
3617 provides secure channels.
3618
3619 \subsubsection{Secure channels definition}
3620 We (very briefly!) recall the \cite{Canetti:2001:AKE} definition of a secure
3621 channels protocol.  We again play a game with the adversary.  At the
3622 beginning, we choose a bit $b^* \inr \{0, 1\}$ at random.  We allow the
3623 adversary the ability to establish \emph{secure channels} sessions within the
3624 parties.  Furthermore, for any running session $S = (P_i, P_j, s)$, we allow
3625 the adversary to request $S$ to send a message~$\mu$ through its secure
3626 channel.  Finally, the adversary is allowed to choose one ripe
3627 \emph{challenge} session, and ask for it to send of one of a \emph{pair} of
3628 messages $(\mu_0, \mu_1)$, subject to the restriction that $|\mu_0| =
3629 |\mu_1|$; the session sends message $\mu_{b^*}$.  The adversary may not
3630 expose the challenge session.
3631
3632 The adversary wins if (a)~it can guess the bit $b^*$, or (b)~it can cause a
3633 ripe session $S$ (i.e., an unexposed, running session), with a matching
3634 session~$T$ to output a message other than one that it requested that $T$
3635 send.
3636
3637 \subsubsection{Protocol definition}
3638 The protocol begins with Wrestlers key-exchange.  The encryption in the
3639 key-exchange protocol is performed as $E_K(\cookie{kx}, \cdot)$; encryption
3640 for secure channels is performed as $E_K(\cookie{sc}, i, o, \cdot)$, where
3641 $i$ is a sequence number to prevent replays and $o \in \{S, T\}$ identifies
3642 the sender.
3643
3644 \subsubsection{Proof sketch}
3645 We use the games and notation of appendix~\ref{sec:sk-proof}.
3646
3647 The proof goes through as far as the step between $\G5$ and $\G6$ in the
3648 proof of lemma~\ref{lem:sk-g3-g4}.  Here we make the obvious adjustments to
3649 our adversary against the IND-CCA security of $\E$.  (Our adversary will need
3650 to use the left-or-right oracle for messages sent using the secure channel
3651 built on $K^*$.  That's OK.)
3652
3653 In $\G4$, we know that ripe sessions agree the correct key, and the adversary
3654 never queries the random oracle, so the key is independent of the adversary's
3655 view.
3656
3657 We define a new game $\G8$, which is like $\G4$, except that we stop the game
3658 if the adversary ever forges a message sent over the secure channel.  That
3659 is, if a ripe session $S$ ever announces receipt of a message not sent (at
3660 the adversary's request) by its matching session $T$.  Let $F_8$ be the event
3661 that a forgery occurs.  We apply lemma~\ref{lem:shoup}, which tells us that
3662 $\diff{4}{8} \le \Pr[F_8]$.  To bound $F_8$, we isolate a session at random
3663 (as in lemmata \ref{lem:sk-g2-g3} and~\ref{lem:sk-g3-g4}), which tells us
3664 that
3665 \begin{equation}
3666   \label{eq:sc-g4-g8}
3667   \diff{4}{8} \le q_S \cdot \InSec{int-ptxt}(\E; t', q_M, q_M)
3668 \end{equation}
3669 Finally, we can bound the adversary's advantage at guessing the hidden bit
3670 $b^*$.  We isolate (we hope) the challenge session $S$ by choosing a target
3671 session at random, as before.  Let $K^* = H_K(Z_S)$ be the key agreed by the
3672 session (if it becomes ripe).  We define an adversary $B$ against the IND-CCA
3673 security of $\E$.  The adversary $B$ simulates the game.  If the adversary
3674 exposes the target session, or doesn't choose it as the challenge session,
3675 $B$ fails (and exits 0); otherwise it uses the left-or-right encryption
3676 oracle to encrypt both of the adversary's message choices, and outputs the
3677 adversary's choice.  Let $b$ be the adversary's output, and let $\epsilon$ be
3678 the advantage of our IND-CCA distinguisher.  Then
3679 \begin{eqnarray*}[rl]
3680   \Pr[b = b^*]
3681   & = \Pr[b = b^* \wedge b^* = 1] + \Pr[b = b^* \wedge b^* = 0] \\
3682   & = \frac{1}{2}\bigl( \Pr[b = b^* \mid b^* = 1] +
3683       \Pr[b = b^* \mid b^* = 0] \bigr) \\
3684   & = \frac{1}{2}\bigl( \Pr[b = b^* \mid b^* = 1] +
3685                         (1 - \Pr[b \ne b^* \mid b^* = 0]) \bigr) \\
3686   & = \frac{1}{2}\bigl( \Pr[b = 1 \mid b^* = 1] -
3687                         \Pr[b = 1 \mid b^* = 0] + 1 \bigr) \\
3688   & = \frac{1}{2}\bigl(1 + q_S\,\Adv{ind-cca}{\E}(B) \bigr) \\
3689   & \le \frac{1}{2} \bigl( 1 + q_S\,\InSec{ind-cca}(\E; t', q_M, q_M) \bigr).
3690                         \eqnumber
3691 \end{eqnarray*}
3692
3693 \end{document}
3694
3695 %%% Local Variables:
3696 %%% mode: latex
3697 %%% TeX-master: t
3698 %%% End: