Answered step by step
Verified Expert Solution
Question
1 Approved Answer
* We estimate that multiplying ` p 0 ` by ` M ` will multiply the amount of time the naive discrete logarithm takes by
We estimate that multiplying p by M will multiply the amount of time the naive discrete logarithm takes by M Using this estimate, how many days would you expect the naive discrete logarithm to take for pYour answer should depend on pp and on the number of seconds given by your timing computation above. Do not try to run the naive discrete logarithm function on p directly. Be sure your answer is in days, not in seconds.
One of the two groups Alice should post the above values p and g on the "Lab Key Exchanges" thread on Canvas Discussion.
Alice and Bob should choose random secret exponents a and brespectively To find a and b use the getRandomNBitInteger function we imported above, calling getRandomNBitIntegerN where N is or less than the number of bits of p
Alice and Bob should then compute A and Busing a and b respectively in the notation of the textbook, Section using the pow function the threeargument version Alice and Bob should post these public values A and B on Ed Discussion as replies to the message posting p and g
Be sure that a and b never get posted nor exchanged between Alice and Bob but you probably want to display your secret exponent in this notebook so you still have access to it if the hardware resets.
Alice and Bob should both independently compute their shared secret key k
Alice and Bob should both independently convert k to a list of digits from to inclusive using the imported tobaseb function. Name the resulting list vigkey This list vigkey will be the shared private key for a Vigenere cipher.
vigkey tobasebk
Bob should choose a secret message M that he wishes to send to Alice. It does not have to be a long message, not nearly as long as the messages in Lab We don't want the Vigenre ciphertext to be vulnerable to decryption using frequency analysis.
With the vigenere function, Bob should encrypt his secret message M using the list vigkey computed above, as in the following code. Bob should post this encrypted message Y as a reply on the same thread.
Y vigenereM vigkey
Y addspacesY
printY
Alice should take this public message Y and decrypt it Notice that the list vigkey was used for encryption, so a slightly different list should be used for decryption. What shift amounts do the decryption, in terms of the encryption shift amounts?
Here we are defining the decryption key decryptkey using a list creation method in Python called "list comprehension"; be sure to ask if the syntax is confusing.
decryptkey for x in vigkey
M vigenereY decryptkey
M
Do not post the decrypted plaintext in the thread. Alice and Bob should not exchange any information in private. The public information which is the same as the information shared between Alice and Bob should be pgAB and Y
If Alice has successfully decrypted the message meaning she gets something that is English then you are done with this lab.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started