# Need help understanding this exercise's solution

We were given this exercise, which asks us to identify the types of keys used on this diagram:

The solution was

Kxa -> A's private key

Kya -> A's public key

KxB -> B's private key

My question is, how is it possible that B knows the contents the first message coming from A since it was encrypted with A's private key ? Also, B replies back to A encrypting the message with A's public key which is encrypting a message using B's private key.. I thought private keys were meant to be used to decrypt messages ecrypted by public keys.

I dont understand how come they know each other's private keys.

• The private key operation is probably used for signing, not encryption - and therefore the public key for verification (possibly with message recovery?). – Maarten - reinstate Monica Jun 2 '16 at 19:50

• A is 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 Ra and a tag Ts which is used as proof;
• Kya() is an encryption operation with the public key A, so that the session key Ks is kept confidential;
• Kxb() is a signing operation (with message recovery) that signs the random Ra together with session key Ks;
• Ks(M) is message encryption with the established session key Ks.