CHAPTER 8Cryptographic Applications and PKI

Encryption experts are pressed to find ever more effective encryption methods, measured by their security and performance, because the threats presented by hackers are increasingly greater. This is partly because the hackers have become more sophisticated in their attacks, but also because the fallout from an attack gets more severe as our use of data grows. In the previous chapter, we learned how to build a system to encrypt data and send it over an unsecured network. On the other side, a recipient can decrypt the data and verify that the message was not altered and that it was delivered in a secure manner. We will now expand our Python code by introducing public-key infrastructure or, as it is more commonly known, PKI. But what is PKI?

You have a highly classified letter that you need to send to a person on the other side of the world. You believe that the note can be intercepted, so you put the letter in a box, and you padlock it shut. Locking the letter in the box is essentially the same as encrypting the letter; it is another way to protect it. You can now send the letter on its way, but you still have the key. You also need to find a way to get the key to the other side of the world without it being compromised. This is known as the key distribution problem, and it is the oldest problem in cryptography.

As you know, the key is the secret recipe for scrambling and unscrambling a secret message. By the 1960s, key distribution ...

Get Implementing Cryptography Using Python 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.