Network Security

a digital signature

Imagine signing a contract with a special pen that only you own, and the signature it makes can be checked by anyone with a public template — they can confirm it's genuinely yours, but they can't forge it themselves. And the signature is tied to the exact words of the contract: change one clause and the signature no longer validates. A digital signature is the cryptographic version of this — proof that a specific message came from a specific person and wasn't altered, verifiable by anyone, forgeable by no one but the signer.

It's built from public-key cryptography run in 'reverse.' To sign: you compute a cryptographic hash of the message, then encrypt that hash with your private key — the result is the signature, attached to the message. To verify: anyone takes the message, hashes it themselves, and uses your public key to check the signature against that hash. If they match, two things are proven at once: the message is unaltered (integrity) and it came from the holder of the matching private key (authentication). Because only you hold the private key, you can't later deny signing it — that property is non-repudiation.

Why it matters: a digital signature is what a MAC can't be — verifiable by anyone, with no shared secret, and binding the signer publicly. It's the engine behind certificates (a certificate authority signs a website's identity), software updates (your device checks the vendor's signature before installing), and signed documents and emails. The honest caveat is the same as for all public-key crypto: a signature only proves the message came from whoever holds that private key — it tells you nothing about whether that party is trustworthy, and it's only as good as your confidence that the public key really belongs to who you think (which is what certificates address).

A software vendor signs an update: signature = encrypt(hash(update), vendor_private_key). Your device hashes the downloaded file, decrypts the signature with the vendor's public key, and compares. A match means the file is genuinely the vendor's and untouched; a mismatch means it was corrupted or forged — and installation is refused.

Sign with the private key, anyone verifies with the public key.

A signature proves origin and integrity, not honesty. A virus can be perfectly, validly signed by its author — the signature only confirms who made it, never that what they made is safe or true.

Also called
digital sig數位簽章電子簽章