07.07.2023 Views

Implementing-cryptography-using-python

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 8 ■ Cryptographic Applications and PKI 245

Your results should look like those shown in Figure 8.8.

Figure 8.8: Diffie-Hellman exchange example

Summary

In this chapter, you were able to expand on your knowledge of working with a

public-key infrastructure using Python. The biggest secrets in our government

and business entities are largely protected by two simple mathematical equations:

■■

C = M e (mod N)

■■

C 1/e mod (p – 1) (q – 1) mod N = M

These equations provide the basis of creating very large keys that are easy

to generate but difficult to crack, essentially creating mathematical locks or

trapdoors.

After gaining an understanding of how PKI works, we then explored how to

implement ElGamal, which is a cryptosystem based on the difficulty of finding

a discrete logarithm in a cyclic group.

The use of large keys in cryptography could have limitations as the world

moves to smaller mobile devices. You also learned about the elliptic curve cryptography

encryption system, which provides an alternative and more efficient

type of public-key cryptography. The use of ECC is critical to how we implement

key exchanges using the Diffie-Hellman algorithms.

In the next chapter, you will create a chat application that will incorporate

many of the recipes and styles you have learned in this book.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!