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 8 ■ Cryptographic Applications and PKI 243

B: The second user (Bob), receives the key from Alice and uses it to generate

a secret key; this gives both users the same secret key to encrypt.

Examine Figure 8.7x to see how the points intersect with the ECC.

Figure 8.7: Point intersection of ECC curve

To get a better understanding, review the following five steps:

1. Alice and Bob get public numbers P = 23, G = 9.

2. Each user selects a private key:

■■

Alice selected a private key a = 4

■■

Bob selected a private key b = 3

3. Each user computes public values:

■■

Alice: x = (9^4 mod 23) = (6561 mod 23) = 6

■■

Bob: y = (9^3 mod 23) = (729 mod 23) = 16

4. Alice and Bob exchange public numbers:

■■

Alice receives public key y = 16

■■

Bob receives public key x = 6

5. Alice and Bob compute symmetric keys:

■■

Alice: ka = y^a mod p = 65536 mod 23 = 9

■■

Bob: kb = x^b mod p = 216 mod 23 = 9

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

Saved successfully!

Ooh no, something went wrong!