CHAPTER 5Public Key Cryptography

Bitcoin is a cryptocurrency. This highlights the importance of cryptography in Bitcoin’s design. Without cryptography Bitcoin could not have existed. This chapter serves the purpose of both introducing cryptography and highlighting the main public key cryptography algorithms used in Bitcoin. Additional cryptographic protocols will be introduced throughout the book when describing applications that make use of them. A single chapter does not do justice to the subject, and the treatment here is necessarily shallow and incomplete. Cryptography is a very deep subject, and the interested reader is encouraged to consult a cryptography textbook, such as Paar and Pelzl (2010), Katz and Lindell (2007), or Ferguson et al. (2010).

Cryptography is the science of communicating securely in the presence of adversaries, who can listen in and even control the communication channel. Classical (symmetric) cryptography is concerned with encryption. That is, converting a message to a ciphertext. A ciphertext is apparent nonsense to the adversary listening on the communication channel, but the recipient knows how to translate it to the original message.

Cryptographers recommend that the encryption algorithm is made public and that only the encryption key is kept secret. This is known as Kerckhoffs’s Principle. The rationale behind this principle is that it is easy to make an encryption algorithm that cannot be broken by its creator1. But it is very hard to make ...

Get Understanding Bitcoin: Cryptography, Engineering and Economics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.