← 🔐 Network Security
Subtopic 2 of 3

9.2Hash functions and digital signatures

The idea

A hash such as MD5 or SHA-1 turns a message into a short fixed-size digest. A digital signature is the digest encrypted with the sender's private key; anyone can verify it with the public key.

Think of it like this: A wax seal pressed with your personal stamp: anyone can check the seal against a public copy of your stamp, but only you could have made it.

Why it exists

GATE asks which key is used at which step and which algorithms are hashes.

How it works

  1. Sender computes H(m) and encrypts it with the sender's private key to get the signature.
  2. Sender transmits m with the signature (and may encrypt everything with the receiver's public key for secrecy).
  3. Receiver decrypts the signature with the sender's public key and compares with H(m).
  4. Hashes: MD5, SHA-1. Ciphers (not hashes): RSA, DES.

Worked example: B signs a message m for A.

B sends {m, KB−(H(m))}: the digest encrypted with B's own private key (GATE 2016).

Now play with it

  • →Read the table row "Signature and secrecy" and name the two keys used on each side.
  • →List which of MD5, SHA-1, RSA, DES are hash functions.
GoalWhat the sender doesWhat the receiver does
Secrecy onlyencrypt m with the receiver's public keydecrypt with the receiver's private key
Signature (integrity and origin)send m and the digest H(m) encrypted with the sender's private keydecrypt the signature with the sender's public key and compare with H(m)
Signature and secrecysign with own private key, then encrypt with the receiver's public keydecrypt with own private key, then verify with the sender's public key

Hash functions: MD5, SHA-1, SHA-256. Ciphers: DES, AES (symmetric), RSA (public key). RSA and DES do not produce message digests.

Check yourself

A digital signature is created using

Remember: Sign with your private key. Encrypt with the receiver's public key. MD5 and SHA-1 are hashes, RSA and DES are not.
Exam notes (the dense version)

A hash (message digest) such as MD5 or SHA-1 maps a message to a fixed-size digest; it is one-way and collision resistant. RSA and DES are not hash functions. A digital signature proves origin and integrity: the sender computes H(m) and encrypts it with the sender's private key; sends (m, signature); the receiver decrypts the signature with the sender's public key and compares with H(m). To also keep the message secret, additionally encrypt with the receiver's public key. A birthday attack finds two messages with the same digest; the signer can use it to repudiate a signature.

Previous year questions: Network Security (6)

PYQs are grouped by topic, so this is the full set for Network Security; try the ones that match this subtopic. Open all 6 on the topic page.