Skip to content
← All questions

Why is a hash function used in the process of creating a digital signature?

A hash function is used to generate a fixed-size digest of the certificate data. Signing this digest instead of the entire message is more efficient. Furthermore, it ensures data integrity; any change to the original data would result in a completely different hash, causing the verification to fail.

Conditions

  • The data to be signed is potentially large or variable in size.
  • Efficiency and integrity checking are required.

Reasoning, step by step

  1. The hash function compresses the variable-length certificate data into a fixed-length hash code.
  2. The CA encrypts this smaller hash code with its private key, which is computationally cheaper than encrypting the whole certificate.
  3. During verification, the recipient hashes the received data again. If the data was altered, the new hash will not match the decrypted hash from the signature.

Example

The video shows the unsigned certificate data passing through box 'H' to produce a hash code before entering the encryption box 'E'. The card explanation notes that signing the digest is more efficient and ensures data integrity because any change to the data results in a different hash.

Common misconceptions

  • Thinking the hash function encrypts the data; it only creates a fingerprint/digest.
  • Believing that hashing is primarily for secrecy; in this context, it is for efficiency and integrity.

Watch the explanation

Connected concepts

Explore next

Related questions

Meet the concept

↗
Find a method

↗
Meet the concept

↗
Find a method

↗
Meet the concept

↗

Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.