I can't seem to find a sufficiently detailed resource that describes the IKE phase 1 PSK identity authentication process. They seem to focus on differences between aggressive and main mode while oversimplifying them.
I'm trying to understand the identity vetting of IKE phase 1 using a pre-shared key.
I read one source describing that the pre-shared key is hashed and those hashes are shared to prove that each party knows the hash (and therefore vet the identity of each party), however wouldn't capturing of those hashes present an opportunity for a replay attack? Or for example couldn't one side wait for the hash and send it back to "prove" it knows the PSK? Which leads to my next question, apparently main-mode encrypts the hash, so what is used to encrypt that hash, the same PSK?
I would love to read up on this more in order to attempt to answer my own questions, but again I can't seem to find anything thorough.
Thanks in advance.