Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

encryption
hashing
network security

Encryption vs. hashing

Educative Answers Team

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Encryption and hashing have separate use cases, but they are both used to increase your privacy. In this shot, we will look at how they differ in function and operation.

svg viewer

Encryption

Encryption is a two-way process. Encrypted files are meant to be decrypted by those who have access to the data. However, anyone with the key can unencrypt data and allow for granular access control.

Hashing

Hashing is a one-way process – you cannot retrieve the original text from the hashed product even if the hash function is known. This means there is no risk if a hacker gets a hold of your password’s hash.

Modern applications​ use a technique called password hashing, so they never have to store your password. This will protect your password from hackers if the database of the service you use is compromised.

Data can be encrypted based on various properties of the original input like numerical, digital, or semantic characteristics.

Hashing is generally done based on the numerical properties of the input.

Encryption can be used for authentication purposes by providing confidence that no one else was able to read the file.

A hash changes if the input changes; therefore, hashing is used for authentication purposes by ensuring no changes have been made to a file. It is usually easier to compare hashes when checking for changes than to check for them in the actual files.

RELATED TAGS

encryption
hashing
network security
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring