Promptles
Security

Encryption vs Hashing

intermediate

Definition

Two ways of protecting data, often confused. Encryption scrambles information with a key: anyone with the key can unscramble it later. Hashing is a one-way blender: it turns the data into a fixed scramble that can never be turned back. Payment details are encrypted (the company needs to read them). Passwords are hashed (nobody, not even the company, should be able to read them).

In the wild

When you create an account, the website doesn't actually save your password anywhere. It runs your password through a hash and stores only the unreadable scramble. Next time you log in, it hashes whatever you typed and checks if the new scramble matches the saved one. The original password is never stored. So even if hackers steal the database, they don't get your password.

More from Security