Applications of one-way hashing
Suppose that A and B share a secret S.
When A wants to communicate M to B:
- for integrity and authenticity
- A can send hash(M,S) together with M,
- B can check hash(M,S).
- for secrecy
- A generates and sends a random nonce N, and hash(N,S) XOR M, instead of M,
- only A and B can recover M.