Alice receives Bob's message and message digest A. She can read the message since it was not encrypted, but she wants to check its integrity first.

To do this, she inserts the text message into the same one-way hash algorithm, which creates message digest B. If both message digests match, then the data has not been altered en route.

Remember that it is possible for a hacker to convincingly alter the text message, but not the message digest.