chapter seven

7 Signatures and zero-knowledge proofs

 

This chapter covers:

  • Zero-knowledge proofs and how they can be used to simulate cryptographic signatures.
  • The existing standards for signatures and how they are implemented in real-world applications.
  • The subtle behaviors of signatures and how you can avoid their pitfalls.

You’re about to learn one of the most ubiquitous and powerful cryptographic primitives: digital signatures. To put it simply: digital signatures are similar to the real-life signatures that you’re used to, the ones that you scribe on checks and contracts. Except, of course, that they’re cryptographic and so they provide much more assurance than their pen-and-paper equivalents.

In the world of protocols, digital signatures unlock so many different possibilities that you’ll run into them again and again in the second part of this book. In this chapter I will introduce what this new primitive is, how it can be used in the real world, and what the modern digital signature standards are. Finally, I will talk about security considerations and the hazards of using digital signatures.

[Note]  Note

Signatures in cryptography are often referred to as digital signatures, or signature schemes. In this book, I interchangeably use these terms.

For this chapter you’ll need to have read:

  • Chapter 2 on hash functions.
  • Chapter 5 on key exchanges.
  • Chapter 6 on asymmetric encryption.

7.1 What is a signature?

7.1.1 How to sign and verify signatures in practice

7.1.2 A prime use case for signatures: authenticated key exchanges

7.1.3 A real-world usage: public key infrastructures

7.2 Zero-knowledge proofs: the origin of signatures

7.2.1 Schnorr identification protocol: an interactive zero-knowledge proof

7.2.2 Signatures are just non-interactive ZKPs

7.3 The signature algorithms you should use (or not)

7.3.1 RSA PKCS#1 v1.5: a bad standard

7.3.2 RSA-PSS: a better standard

7.3.3 The elliptic curve digital signature algorithm (ECDSA)

7.3.4 The Edwards-curve digital signature algorithm (EdDSA)

7.4 Subtle behaviors of signature schemes

7.5 Summary