- Download the files: ciphertext.txt, key.txt. Since the prime number and the keys used are 20-digit integers, to avoid
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
- Download the files: ciphertext.txt, key.txt. Since the prime number and the keys used are 20-digit integers, to avoid
- Download the files: ciphertext.txt, key.txt. Since the prime number and the keys used are 20-digit integers, to avoid typing error, I include those integers in the text file key.txt. You can copy and paste the numbers into your program. In key.txt, p is the prime number used in this exercise, wangpub is my public key, and studentprv is the student's private key. I also include the student's public key studentpub, in case you want to check your program. The ciphertext.txt is a text file encrypted by the student's public key. - Make a Python module named Ex3Module_Lastname.py consisting of all functions used for the ElGamal Public-key Cryptosystem over the prime field Fp. - Make a plain text file named plain.txt containing only US keyboard characters (Python's text editor can verify it). - Make a Python file named Ex3_Lastname.py. In it, import all the functions from Ex3Module_Lastname.py, use the function decode() and the student's private key to decrypt the file ciphertxt.txt and save the result in the file plaintext_Lastname.txt - Also in Ex3_Lastname.py, use the function encode() and my public key to encrypt your plain.txt and save the result in the file ciphertext_Lastname . txt.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!