Read Aloud the Text Content
This audio was created by Woord's Text to Speech service by content creators from all around the world.
Text Content or SSML code:
Lecture Three: Hashing and Integrity 1. What is Hashing? • Definition: Hashing is a process that takes data and converts it into a fixed-size string of characters, which looks random. This is done by using a hash function. For example, if you take a document and input it into a hash function, it will produce a unique hash value (like "5d41402abc4b2a76b9719d911017c592"). Even a tiny change to the document will result in a completely different hash. 2. Why is Hashing Important? • Data Integrity: Hashing ensures data hasn’t been altered. When data is sent, the recipient can generate a hash from the received data and compare it to the original hash. If they match, the data is the same. For instance, when downloading software, websites often provide a hash. After the download, you can hash the file to confirm it hasn’t been tampered with during transmission. 3. Properties of a Good Hash Function: • Deterministic: The same input always produces the same hash output. For example, if you hash the word "apple" today, tomorrow, or next year, the result will always be the same. • Fast to Compute: It should take very little time to calculate the hash value, even for large files. • Preimage Resistance: It should be hard to reverse the hash to find the original input. For example, given a hash value, it should be nearly impossible to figure out what data was used to generate that hash. • Collision Resistance: Two different inputs should not produce the same hash value. This prevents attackers from creating two different documents with the same hash. 4. Thinking About Properties to Build a Secure Channel: • Confidentiality: The data should remain secret between the sender and receiver. • Integrity: The data should not be modified during transmission. • Authentication: Both the sender and receiver must verify each other’s identity. For example, using digital signatures ensures the data came from the correct sender. • Non-repudiation: The sender cannot deny having sent the message. For example, a digital signature makes sure the sender can’t claim they didn’t send the message later. 5. Message Authentication Code (MAC): • Definition: A MAC is used to verify both the authenticity and integrity of a message. It combines a hash function with a secret key. Example, when transferring money online, the bank uses a MAC to ensure the transaction details haven’t been altered and are authentic, meaning the message really came from you. 6. Common Hash Functions: • MD5 (Message Digest 5): A widely used hash function in the past, but now considered insecure because it’s easy to find two different inputs that generate the same hash (a collision). • SHA-1 (Secure Hash Algorithm 1): Another older hash function, which is also now vulnerable to collisions and no longer recommended for secure applications. • SHA-2: A more secure version, including SHA-256, widely used today for security (e.g., encrypting Bitcoin transactions). • SHA-3: The newest standard in the SHA family, designed to be even more secure than SHA-2. • HMAC (Hash-based Message Authentication Code): A secure way of using a hash function along with a secret key to ensure both the authenticity and integrity of a message. For example, HMAC is used in HTTPS to verify the integrity of transmitted data. 7. Why We Can't Use MD5 and SHA-1 in Cryptography: • Collisions: MD5 and SHA-1 are prone to collisions, meaning two different inputs can result in the same hash. This makes them unreliable for security purposes because attackers can create two different files with the same hash and trick the system. Example: If a hacker manages to create two different documents that hash to the same value, they could substitute a malicious file for a legitimate one, making the system think the malicious file is safe.