- "/workspace/project4$ python3 decrypt.py XXXXXXXXXX0001100000000100110101000010101000110010101000110011 XXXXXXXXXX Cs110$ python3 encrypt.py XXXXXXXXXX | python3 decrypt.py XXXXXXXXXXPython is...


Problem 4. (Decryption Program) Write a program called decrypt.py that accepts the private-key n (int) and d (int) as<br>command-line arguments and a message to decrypt (produced by encrypt.py) from standard input, decrypts each character<br>(represented as a fixed-width binary sequence) in the message, and writes the decrypted character to standard output.<br>>-
Cs110 $ python3 encrypt.py 3599 1759 | python3 decrypt.py 3599 2839 Python is the mother of all languages. Python is the mother of all languages. Directions: • Accept private-key n (int) and d (int) as command-line 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 E [0,l – 1) 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 built-in function chr (). "/>
Extracted text: Problem 4. (Decryption Program) Write a program called decrypt.py that accepts the private-key n (int) and d (int) as command-line arguments and a message to decrypt (produced by encrypt.py) from standard input, decrypts each character (represented as a fixed-width binary sequence) in the message, and writes the decrypted character to standard output. >- "/workspace/project4 $ python3 decrypt.py 3599 2839 000110000000010011010100001010100011001010100011001110000110010111100100 Cs110 $ python3 encrypt.py 3599 1759 | python3 decrypt.py 3599 2839 Python is the mother of all languages. Python is the mother of all languages. Directions: • Accept private-key n (int) and d (int) as command-line 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 E [0,l – 1) 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 built-in function chr ().
Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here