07.07.2023 Views

Implementing-cryptography-using-python

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER

9

Mastering Cryptography

Using Python

The time has come to put all you have learned into action; you should now understand

the concepts you need to secure communications between two parties.

The chapter will focus on building an application that can send messages in

plaintext, or encrypted using asymmetric public key infrastructure (PKI) and

using the symmetric key method with an Elliptic Curve Diffie-Hellman key

exchange. Implementing these techniques between two applications over an

insecure UDP connection will help you think through how to send messages

securely and ensure that they have not been tampered with. We will use Wireshark,

a popular network analyzer, to verify that the messages are encrypted

and cannot be distinguished from random noise. We will highlight using AES

(Advanced Encryption Standard) in Counter (CTR) and Galouis/Counter (GCM)

modes. We covered CTR in Chapter 5, and while the implementation of GCM is

quite similar, it requires some special consideration as we design our encryption

protocol. Our first task will be to build a small working application for plaintext

communications, then adding the other cryptographic components to the mix.

Throughout this chapter, you gain cryptographic experience as you:

■■

Construct an application that communicates in plaintext

■■

Install Wireshark and examine the communication traffic

■■

Implement a PKI into the application

■■

Implement RSA Digital Certificates

Implementing Cryptography Using Python®, First Edition. Shannon W. Bray.

© 2020 John Wiley & Sons, Inc. Published 2020 by John Wiley & Sons, Inc.

247

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

Saved successfully!

Ooh no, something went wrong!