# What's the utility of the last two messages of Needham Schroeder Symmetric key protocol

The protocol works like this

But I can't understand what's the utility of message 4 and 5, what do they protect from?
They do not protect from replay attack if Ks gets compromised because B won't be aware anyway of its freshness.
Wikipedia says that Bob sends Alice a nonce to show that he has the key, and Alice sends back a modification of it to show that she has the key too.
Isn't it obvious that she has the key if she sent it to Bob previously?
Or is it just a sort of acknowledge (which kind of surprise me because it would be the first time I see it in these protocols)

• As far as I can tell, the graphic is wrong in message 2: $E(K_B,(K_s,ID_A))$ should also be inside the block encrypted with $K_A$. – tylo Dec 31 '19 at 11:53
• @tylo how is that even relevant – VariabileAleatoria Dec 31 '19 at 13:50
• You're looking at a wrong definition of the protocol. Why would that not be relevant? For cryptography it is extremely important to have precise definitions and that they are correct. Otherwise everything you build is entirely irrelevant, because any security property is void, if the requirements are not fulfilled. – tylo Jan 1 '20 at 15:05