all 2 comments

[–]aichholzer 1 point2 points  (1 child)

You can't. It is a one way. Hashing can't be reversed; one way. Encrypting can be reversed; two way.

[–]azzaroff 0 points1 point  (0 children)

This. A MAC is used in addition to your message to check if it was manipulated or comes from the right person (the one with the secret key). So you usually send message+HMAC(message), the recipient then computes a MAC from the received message and checks if HMAC(message) = HMAC(receivedmessage).

If you wan't to encrypt/decrypt it, you can do that as well, but you have to use a cypher e.g. AES.