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.

238 Chapter 8 ■ Cryptographic Applications and PKI

dmsg = ''.join(dr_msg)

print ()

print ("The encrypted message :", en_msg)

print ()

print("Decrypted Message :", dmsg);

print ()

if __name__ == '__main__':

main()

The preceding recipe should take the message “Please do not let the enemy

know our position.” and generate an ElGamal key that is used to encrypt and

decrypt the message. Examine Figure 8.5. The program displays the g a and g k

that is produced along with the g ak .

Figure 8.5: ElGamal key

Elliptic Curve Cryptography

Now that you have a better understanding of how the more traditional algorithms

work using Python, we will examine an alternative approach that is

considered a more efficient type of public-key cryptography: elliptic curve

cryptography, or as it is more simply known, ECC. The security of the cryptosystem

lies within the difficulty of solving discrete logarithms on the field

defined by specific equations computed over a curve; the group of cryptographic

algorithms were introduced in 1985 and were based on the esoteric branch

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

Saved successfully!

Ooh no, something went wrong!