I am revising for a computer security course and I am stuck on one of the past questions. Here is it:
Alice ($A$) wants to send a short message $M$ to Bob ($B$) using a shared secret $S_{ab}$ to authenticate that the message has come from her. She proposes to send a single message with two pieces: $$ A \to B: \quad M, h(M \mathbin\parallel S_{ab})$$ where $h$ is a hash function and $\parallel$ denotes concatenation.
- Explain carefully what Bob does to check that the message has come from Alice, and why (apart from properties of $h$) he may believe this.
- Suppose that $h$ does not satisfy the one-way property and it is possible to generate pre-images. Explain what an attacker can do and how.
- If generating pre-images is comparatively time-consuming, suggest a simple countermeasure to improve the protocol without changing $h$.
I think I know the first one. Bob needs to take a hash of the received message along with his shared key and compare that hash with the hash received from Alice, if they match then this should prove Alice sent it.
I am not sure about the second two questions though. For the second one, would the answer be that an attacker can simply obtain the original message given a hash? I'm not sure how that would be done though.