Lesson 2: Hashing in Everyday Use
Objective
Explore the practical applications of hashing in everyday digital life, focusing on password security, understanding hash collisions, and the role of hashing in blockchain technology.
Storing Passwords Securely
How It Works: When you create a password on a website, the site doesn't actually save your exact password. Instead, it uses hashing to turn your password into a unique string of characters, a hash. For example, "Blue123" might become something like "81d3fa9a...".
Importance for Security: If someone unauthorized accesses the website's password data, they will only see these hashes, not the real passwords. This makes it harder for them to steal your password.
The Concept of Salting: Salting is a technique where a random piece of data, called a 'salt', is added to the password before it's hashed. So, "Blue123" might first become "Blue123xyz" before being hashed. This step ensures even common passwords end up with unique hashes, enhancing security.
Understanding Hash Collisions
What is a Collision: A hash collision happens when two different pieces of data (like two different passwords) end up with the same hash. It's like two different recipes giving you the same dish.
Why Collisions Matter: Collisions are important because they can potentially be exploited to breach data security. However, modern hash functions are designed to make collisions extremely rare, maintaining the integrity of the hashing process.
Hashing in the Blockchain
Blockchain Basics: A blockchain is like a digital ledger made up of blocks. Each block contains data and the hash of the previous block.
Hashing's Role: The hash acts like a seal. If the data in a block changes, the hash changes too. This change would be noticeable in the next block, as it stores the hash of the previous block. This chaining of blocks through hashes is what makes blockchains secure and tamper evident.
Real-World Example: In cryptocurrencies like Bitcoin, this use of hashing helps ensure that once a transaction is recorded in a blockchain, it cannot be altered without altering all subsequent blocks, which is practically impossible.