Member-only story
Hash Functions
- What is a Hash Function?
A hash function takes any input size and produces a fixed-size summary, making it nearly impossible to reverse from output to input. Even small changes in input cause significant changes in output. - Example:
Comparing two files, one with the letter T and one with U (differing by one bit), produces completely different hash values. - Importance of Hashing:
Hashing ensures data integrity and confidentiality, particularly for passwords. Instead of storing passwords, systems store hash values and compare them to verify correctness. - Hash Collision:
Collisions happen when different inputs produce the same hash output. Hash functions like MD5 and SHA1 are now insecure due to known collision vulnerabilities.
Questions and Answers
- What is the SHA256 hash of the passport.jpg file in ~/Hashing-Basics/Task-2?
- 77148c6f605a8df855f2b764bcc3be749d7db814f5f79134d2aa539a64b61f02
- What is the output size in bytes of the MD5 hash function?
- 16
- If you have an 8-bit hash output, how many possible hash values are there?
- 256
Insecure Password Storage for Authentication
- Hashing in Authentication:
Hashing is used in authentication to confirm password knowledge without revealing the actual password.