Back to course

Hashing and Digital Signatures

Cyber Security Mastery: From Zero to Hero

Hashing: Ensuring Integrity

A hash function is a one-way mathematical process that takes input data (of any size) and converts it into a fixed-size string of characters called a hash value or digest.

Key Properties of Hashes

  1. One-Way: You cannot reverse the hash to get the original data.
  2. Fixed Length: The output is always the same size (e.g., SHA-256 is 256 bits).
  3. Collision Resistance: It is highly unlikely that two different inputs will produce the same output.
  • Common Use: Verifying file integrity (downloaded software) and storing passwords (never store passwords in plain text).
  • Algorithms: MD5 (deprecated), SHA-256, SHA-3.

Digital Signatures

Digital signatures use asymmetric encryption to verify the authenticity and integrity of a message or document.

  1. The sender hashes the message.
  2. The sender encrypts the hash using their Private Key (this is the digital signature).
  3. The recipient uses the sender's Public Key to decrypt the signature, revealing the original hash.
  4. The recipient calculates a hash of the received message itself.
  5. If the two hashes match, the integrity and authenticity are confirmed.