Video summary
Hashing and Digital Signatures - CompTIA Security+ SY0-701 - 1.4
Main summary
Key takeaways
Main ideas, concepts, and lessons
-
Cryptographic hashing
- A cryptographic hash turns data into a short, fixed-length string of characters.
- Common terms for the output:
- Message digest
- Fingerprint
- A hash is a digital representation of the data (like a physical fingerprint represents a person).
- Key property: a hash is not encryption
- If you only have the hash, you cannot recreate the original data (one-way transformation).
-
Integrity verification
- Hashes can be used to confirm that a downloaded document matches the original posted on a website.
- This provides integrity (the content wasn’t altered).
-
Digital signatures built on hashing
- Hashes are also used when creating digital signatures.
- Digital signatures provide:
- Authentication (helps prove who sent the message)
- Integrity (detects if the message changed)
- Non-repudiation (the signer cannot later deny sending it)
-
SHA-256 basics (example)
- The video uses SHA-256:
- Outputs 256 bits
- Represented as 64 hexadecimal characters
- Demonstrates the “avalanche effect”:
- Change one character in the input text (e.g.,
.→!) - Produces a completely different hash output.
- Change one character in the input text (e.g.,
- The video uses SHA-256:
-
Collisions and why MD5 is discouraged
- Ideally, distinct inputs should produce distinct hashes.
- If two different inputs produce the same hash, that’s a collision.
- Collisions should be extremely rare for good modern hashing algorithms.
- MD5 is given as an example of an algorithm with known collision weaknesses:
- Collision problems were found in 1996
- Therefore, MD5 is not recommended.
-
Practical uses of hashing
- File verification
- Websites publish a hash for downloadable files (e.g., Linux distributions).
- You hash the downloaded file locally and compare to the published value.
- If hashes match, the file integrity is confirmed.
- Password storage
- Passwords should not be stored in plain text and not merely encrypted (encryption could be reversed).
- Instead, store a hash of the password.
- The stored value is described as hash + salt (the “extra information”).
- During login, the entered password is hashed (with the appropriate salt) and compared to the stored value.
- File verification
-
Salting to defeat rainbow tables
- Rainbow tables are precomputed lists of inputs and their hashes, designed to quickly reverse unsalted hashes.
- Adding a random salt per user prevents rainbow tables from being effective:
- Even if two users have the same password, their salted hashes differ.
- Result:
- Attackers face slower brute-force attempts.
- Brute-forcing may take days/weeks/longer rather than seconds.
-
Analogy using “dragon” passwords
- Without salting: the same password yields the same hash.
- With salting: the same password yields different hashes because different users get different random salts.
- If an attacker accesses the database, it appears as if there are multiple different passwords.
Digital signature methodology (detailed step-by-step)
Signing a message (sender side)
-
Participants in example
- Alice wants to send a message to Bob
-
Message
- Plaintext: “you’re hired Bob”
-
Step sequence
- Alice’s email client takes the plain text of the message.
- The client computes a hash of that plain text (hashing algorithm).
- The email client creates the digital signature by encrypting the hash using Alice’s private key.
- Only Alice should have the matching private key.
- The email is sent in plain text (the example is not encrypting the message content).
- The digital signature is attached or included with the email message.
Verifying a message (receiver side)
-
Bob receives the message containing:
- Plaintext: “you’re hired Bob”
- Digital signature
-
Step sequence
- Bob’s email client recognizes there is a digital signature and runs verification.
- The client decrypts the digital signature using Alice’s public key.
- Because keys are mathematically related, decrypting with the public key yields the original signed hash.
- Bob’s client independently computes a new hash of the received plain text.
- Compare hashes:
- If the hashes match:
- The message is unchanged (integrity).
- It was signed by Alice (authentication / non-repudiation).
- If the hashes do not match:
- The message was changed or verification fails, so the information cannot be trusted.
- If the hashes match:
Speakers / sources featured
- Professor Messer (referenced in the examples and implied as the instructor)
- No other named speakers or external sources are explicitly featured in the subtitles.