Question: ( Decryption Program ) Write a program called decrypt.py that accepts the private - key n ( int ) and d ( int ) as
Decryption Program Write a program called decrypt.py that accepts the privatekey n int and d int as commandline arguments and a message to decrypt produced by encrypt.py from standard input, decrypts each character represented as a fixedwidth binary sequence in the message, and writes the decrypted character to standard output.
Accept privatekey n int and d int as commandline arguments Get the number of bits per character call it width Accept message binary string generated by encrypt.py from standard input Assuming l is the length of message, for i in l and in increments of width Set s to substring of message from i to i width exclusive Set y to decimal representation of the binary string s Decrypt y Write the character corresponding to the decrypted value, obtained using the builtin function chr
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
