Hashing Vs Encryption
Hashing is generally a one way function with the purpose of validating the integrity of the content whereas encryption is a mechanism to sending a coded (obfuscated) message through an insecure channel that can be decrypted only by the intended recipient.
Encryption is only used when there is a necessity for the intended recipient to get the original message; if there is no necessity to know the original (Raw) message then hashing is enough.
There are broadly two categories of Encryption: Symmetric Key Encryption and Asymmetric Key Encryption. As the name suggest, symmetric key encryption technique uses the same key for both encryption and decryption, whereas asymmetric key encryption techniques uses a different pair of keys.
Symmetric Key CryptographyNow the question arises, how to share the key securely (given, that the channel is insecure) among the communicating participants?