liveBook · Manning

Digital signature

As explained in Hacking Cryptography

A cryptographic value associated with data that enables verification of its integrity and origin by parties possessing the required verification information.

A digital signature is a cryptographic proof that a message came from the holder of a private key and was not altered. Anyone with the corresponding public key can verify it, but verification does not give them the ability to create new valid signatures. This asymmetric design avoids the shared-secret problem of MACs, where every verifier could also forge messages. section 9.0 section 9.1

Signing and verification with RSA

For a schoolbook RSA keypair, the private key contains d and the public key contains (e, n), with ed ≡ 1 mod φ(n). Signing computes s = m^d mod n; verification computes s′ = s^e mod n and accepts when s′ equals m. This simple construction is unsafe by itself: an attacker can choose a random s, calculate m = s^e mod n, and obtain a valid signature-message pair. Real schemes therefore enforce formatting and padding rules, and some add randomness. section 9.4 section 9.7

Digital signatures support several security and trust workflows:

  • Authenticate messages without sharing the signing private key with verifiers. section 9.2
  • Establish nonrepudiation when a valid signature verifies under a public key and the private key has remained secure. section 9.2
  • Authorize software before execution by checking signatures against trusted manufacturer keys and a hardware-protected root of trust. section 9.2.2
  • Authorize ownership transfers and transaction details in blockchains and chip-based payment systems. section 9.2.3

Implementation discipline matters. A signature scheme is broken if attackers recover its private key or forge signatures. ECDSA requires a unique nonce for each signing operation; reusing one nonce can reveal the nonce and then the private key. Forgery attacks also differ: universal forgery covers arbitrary messages, selective forgery covers constrained messages, and existential forgery produces at least one valid pair. section 9.7

Figure 9.2 Digital signatures provide an asymmetric alternative to proving message authenticity.
figure

Use the asymmetric signing diagram to trace private-key signature generation and public-key verification. section 9.1

How Hacking Cryptography covers it

How deep it goes
Derives schoolbook RSA signing and verification, demonstrates existential forgery, and flags padding and nonce-reuse failures.
Examples
Uses schoolbook RSA, signed software, Bitcoin ownership transfers, and chip-based payment transactions as concrete examples.
What it assumes
Assumes familiarity with cryptographic integrity, authenticity, hashing, MACs, and modular arithmetic while contrasting symmetric and asymmetric keys.
What you can do after
Evaluate/understand asymmetric signing, recognize basic forgery risks, and identify catastrophic ECDSA nonce reuse.
How it connects
Connects digital signatures to message authentication codes, public-key cryptography, nonrepudiation, digital certificates, blockchains, and code integrity.

Also explained in

Compare how 8 books explain digital signature →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Hacking Cryptography. The section links point to the parts of the book it draws on.