During my lessons of information security the professor told as that Alice can authenticate to Bob in the following way using RSA:
- Bob generates and sends a Nonce to Alice
- Alice signs this Nonce with her private key and sends it back to Bob
- Bob decrypts the packet with Alice's public key and he verifies that the same Nonce that he send is the one that he received
However, with this method a MITM attack is still possible. Eve (the attacker) can simply forward the Nonce to Alice and then forward the signed Nonce to Bob. From the Bob perspective Eve is authenticated as Alice.
Bob ----Nonce---> Eve ---Nonce---> Alice
Bob <--S(Nonce)-- Eve <--S(Nonce)- Alice
There is a way to guarantee that the signed Nonce actually arrive from the correct sender?