A long question here, but I really want to motivate why I'm confused.
Consider the following attack on the Schnorr Identification Scheme.
- Alice chooses a random $k$, computes $\gamma = \alpha^k \pmod p$, and sends a message to Bob, containing her certificate and $\gamma$, of her intent to authenticate.
- Oscar hijacks this message, preventing it from reaching Bob. He then sends a message to Bob, containing Alice's certificate and $\gamma$, of his intent to authenticate.
- Bob verifies Alice's certificate (and notes the public key $v$), randomly chooses a challenge $0 \leq r_B \leq 2^t$, and sends it to Oscar.
- Oscar recieves $r_B$ and sends it to Alice as $r_O$.
- Alice recieves $r_O$, computes $y_O = k + ar_O \pmod q$, and sends the response to Oscar.
- Oscar recieves $y_O$, and sends it along to Bob as $y_B$.
- Bob verifies that $\gamma \equiv \alpha^{y_B}v^{r_b} \pmod p$ and accepts.
And therefore Oscar has authenticated to as Alice to Bob. Note as well that as Oscar never has to alter any of the message in transmission, this attack is not dependent on the channel being insecure.
This form of attack, in which Oscar pretends to be Bob to Alice and Alice to Bob, is presented as the Chess Grandmaster Problem by Schneier (Applied Cryptography, pg. 109) as follows (I'm changing Karpov to Carlsen so that it reads easier).
Here's how Alice, who doesn't even know the rules to chess, can defeat a grandmaster. She challenges both Gary Kasparov and Magnus Carlsen to a game, at the same time and place, but in separate rooms. She plays white against Kasparaov and black against Carlsen. Neither Grandmaster knows about the other.
Carlsen, as white, makes his first move. Alice records the move and walks into the room with Kasparaov. Playing white, she makes the same move against Kasparov. Kasparov makes his first move as black. Alice records the move, walks into the room with Carlsen, and makes the same move. This continues, until she wins one game and loses the other, or both games end in a draw.
In reality, Kasparov is playing Carlsen and Alice is simply acting as the middleman, mimicking the moves of each grandmaster on the other's board. However, if neither Carlsen nor Kasparov knows about the other's presence, each will be impressed will Alice's play.
This kind of fraud can be used against zero-knowledge proofs of identity. While Alice is proving her identity to Mallory, Mallory can simultaneously prove to Bob that she is Alice.
Of course in this analogy Alice just tries to prove she is a good chess player, but as the last two sentences show, it can be used for more nefarious purposes. Schneier states that there are solutions, such as predetermining the timing of when messages are sent, not allowing Oscar the time to operate.
What initially caused me to be interested in the problem is that Stinson, in Cryptography: Theory in Practice, does not consider this intruder-in-the-middle to be a valid attack. He writes (Pgs. 361-362) :
However, we do not consider this to be a real attack, because the "union" of the two "sessions" is a single session in which Alice has successfully identified herself to Bob. The overall result is that Bob issued a challenge $r$ and Alice computed the correct response $y$ to the challenge. Oscar simply forwarded messages to their intended recipients without modifying the scheme. The session executed exactly as it would have if Oscar had not been present.
A clear formulation of the adversarial goal should allow us to demonstrate that this is not an attack. We adopt the following approach. We will define the adversary (Oscar) to be active in a particular session if one of the following conditions holds:
- Oscar creates a new message and places it in the channel
- Oscar changes a message in the channel, or
- Oscar diverts a message in the channel so it is sent to someone other than the intended receiver.
The goal of the adversary is to have the initiator of the scheme (e.g., Bob, who is assumed to be honest) "accept" in some session in which the adversary is active. According to this definition, Oscar is not active in the intruder-in-the-middle scenario above, and therefore the adversarial goal is not realized.
This definition of an attacker's "adversarial goal" seems misguided to me, and I'll motivate it with one of Stinson's exercises (9.7, though I won't produce it word for word here).
Consider the following identification scheme, which is based on the Rabin Cryptosystem:
- Alice sends her certificate, containing a public key $n$, where $n=pq$, to Bob. The primes $p$ and $q$ are private, and $p \equiv q \equiv 3 \pmod 4$.
- Bob chooses a random number $t$, and computes $x \equiv t^2 \pmod n$. He sends it to Alice.
- Alice computes $y \equiv \sqrt{x} \pmod n$, and sends $y$ back to Bob.
- Bob computes $y^2 \equiv z \pmod n$. If $z \equiv t \pmod n$, he accepts, else he rejects.
My initial construction for an attack was as follows:
- Alice sends a message to Bob, containing her certificate, of her intent to authenticate.
- Oscar hijacks this message, preventing it from reaching Bob. He then sends a message to Bob, containing Alice's certificate, of his intent to authenticate.
- Bob verifies Alice's certificate, randomly chooses number $t$, and computes $x_B \equiv t^2 \pmod n$. He then sends $x_B$ to Oscar.
- Oscar receives $x_B$ from Bob, and then sends it to Alice as $x_O$.
- Alice receives $x_O$ from Oscar, computes $y_O \equiv \sqrt{x} \pmod n$, and sends $y_O$ back to Oscar.
- Oscar receives $y_O$ and sends it along to Bob as $y_B$. Bob confirms that $y_B^2 \equiv x_B \pmod n$, and accepts.
Until I noticed that I could use this approach to create the attack on Schorr's scheme above, and then confused went back with my professor and he noticed that my attack isn't valid under Stinson's definition. Instead, we created the following:
- Alice sends a message to Bob, containing her certificate, of her intent to authenticate.
- Bob verifies Alice's certificate, randomly chooses number $t$, and computes $x \equiv t^2 \pmod n$. He then sends $x$ to Alice.
- Alice receives $x$ from Bob, computes $y \equiv \sqrt{x} \pmod n$, and sends $y$ back to Bob.
- Oscar hijacks the message, and sends $-y$ to Bob. Bob confirms that $-y^2 \equiv x \pmod n$, and accepts.
By Stinson's definition, this is a valid attack whereas mine isn't, despite the fact that the latter can be stopped by communication over a secure channel (Oscar can't compute $-y$), and therefore seems weaker.
So after all that, I end up with two questions. 1) What is the motivation for intruder-in-the-middle attacks not being considered a "real" attack? 2) How are they dealt with in practice, i.e. if I want to implement Schnorr's algorithm, what is the current practice for protecting against them?