What is the difference between Encryption and Hashing?

Encryption is a two-way function where data is passed in as plaintext and comes out as ciphertext, which is unreadable. Since encryption is two-way, the data can be decrypted so it is readable again. Hashing, on the other hand, is one-way, meaning the plaintext is scrambled into a unique digest that cannot be decrypted. Encryption is best used for data that must be reversed so it can be utilized. Hashing is best used for hiding data that does not need to be reversed, such as passwords.