Encryption VS Hashing Explained
Encryption VS Hashing Explained
ENCRYPTION VS HASHING
EXPLAINED
BY HARSH KADU
Encryption
Key Points:
• Requires Key(s):
o Symmetric Encryption: Uses a single key for both encryption and decryption.
It is fast but requires a secure method of key exchange (e.g., AES).
o Asymmetric Encryption: Uses a pair of keys—a public key for encryption and
a private key for decryption. This is more secure for key exchange but slower
than symmetric encryption (e.g., RSA, ECC).
• Examples:
BY HARSH KADU
o TLS/SSL for securing web traffic.
Encryption in Practice:
• Data in Transit: When data is transmitted over the internet, encryption (e.g., HTTPS)
ensures that sensitive data like passwords, credit card numbers, and personal
information cannot be intercepted by unauthorized parties.
• Data at Rest: When sensitive data is stored on devices (e.g., encrypted hard drives),
it prevents unauthorized access to the data even if the physical device is
compromised.
Hashing
Hashing is a one-way cryptographic function that transforms data (of any size) into a fixed-
length string (hash value) that uniquely represents the original data. Hashing is irreversible,
meaning that once data is hashed, it cannot be converted back to its original form. It is
primarily used to ensure data integrity by detecting changes or tampering.
Key Points:
• Irreversible: Hashing does not allow the original data to be recovered from the hash
value. This makes it unsuitable for storing data that needs to be decrypted later (like
passwords).
• Used for Data Integrity: Hashing helps in verifying whether data has been altered or
tampered with, making it useful in detecting unauthorized changes.
• Common Applications:
BY HARSH KADU
entered password and compares it with the stored hash. Common hashing
algorithms include SHA-256, bcrypt, and PBKDF2.
o File Integrity Checks: Hashes are used to check the integrity of files. If a file's
hash value changes, it indicates that the file has been altered (e.g., malware
infection or data corruption).
o SHA-256: Part of the SHA-2 family, widely used for data integrity and
blockchain.
Hashing in Practice:
• Password Hashing: When users set a password, the system hashes the password and
stores the hash. During login, the entered password is hashed again and compared
with the stored hash. This ensures the system never stores the plaintext password.
• Data Integrity: If you download a file from the internet, the website often provides a
hash value (checksum) for the file. After downloading, you can hash the file and
compare the result to the provided hash to verify the file's integrity and ensure it
hasn't been tampered with during download.
BY HARSH KADU
Key Differences Between Encryption and Hashing:
Process
Two-way (reversible) One-way (irreversible)
Type
By understanding these concepts in-depth, you can apply the correct cryptographic method
depending on whether your goal is to protect data confidentiality (encryption) or ensure
data integrity (hashing).
BY HARSH KADU
Stay tuned for my next…
BY HARSH KADU