The exercise is: What could be changed on the second message " Kya(Kxb(Ra,Ks)) " to guarantee B's authenthicity and also privacy?
My teacher's solution was "add a destination" , so it would be something like this Kya(Kxb(Ra,Ks,A)).
If we have a man in the middle, Trudy pretending to be B, couldn't she just check the contents of the message and send them to A? (I'm not sure if it works that way), but this is my understanding, something like this:
1- A -> A, Kxa(Ra, Ts) ->T -> A, Kxt(Ra, Ts) ->B
2- A <- Kya(Kxb(Ra, Ks, A)) <- T <- Kyt(Kxb(Ra, Ks, A)) <- B
I'm not quite sure how does the "Destination" field solve anything.
Ais the identity of A, which can be used to select the right public key of A;
Kxa()is a signing operation (with message recovery) that signs the random
Raand a tag
Tswhich is used as proof;
Kya()is an encryption operation with the public key A, so that the session key
Ksis kept confidential;
Kxb()is a signing operation (with message recovery) that signs the random
Ratogether with session key