Why is SRP considered to be resistant to MITM attack? Documentation says
A man-in-the-middle attack, which requires an attacker to fool both sides of a legitimate conversation, cannot be carried out by an attacker who does not know Carol's password. An attacker who does not know x cannot fool Steve into thinking he is talking to Carol, so at least one half of the deception fails. If the attacker doesn't know v either, he is in worse shape, because he also can't fool Carol into believing that she is communicating with Steve.
But let's assume Carol, Steve and MITM have salt, generator and safe prime. And imagine the Carol trying to log in, but MITM stands between Carol and Steve.
1) Carol sends
A, but MITM takes it and sends to Steve.
2) Steve responds to MITM with
B. MITM sends it back to Carol.
3) Both Carol and Steve create a common key(
4) Carol sends Steve
h is a one way hash function and
s1 is some salt that was given to Carol by Steve. MITM takes it and sends it to Steve.
5) Steve checks it and say "Hello Carol, nice to meet you".
So MITM can log to the server by sending requests back and forth.