
Hashing and encryption both change data, but they solve different problems. The key difference is whether the original data can be recovered.
A hash function turns input into a fixed-length result called a hash. A good cryptographic hash is designed so you cannot work backwards to get the original input.
Example: a website should not need to read your password after you create it. It can store a protected password hash. At login, it hashes the password you typed and checks whether the result matches.
Password storage needs special protection. Apps should use a password-hashing tool such as Argon2id or bcrypt, with a unique salt and safe settings. A fast general-purpose hash alone is not enough.
Encryption changes readable data into protected data. Someone with the correct key can decrypt it and read the original. For example, an app may encrypt a private file while it is stored.
Think of hashing as making a fingerprint you compare later. Encryption is like locking a letter in a box that can be opened with a key.