- "/workspace/project4$ python3 encrypt.py XXXXXXXXXXCs110 0001100000000100110101000010101000110010101000110011 XXXXXXXXXXDirections:• Accept public-key n (int) and e (int) as command-line...


Problem 3. (Encryption Program) Write a program called encrypt.py that accepts the public-key n (int) and e (int) as<br>command-line arguments and a message to encrypt from standard input, encrypts each character in the message, and writes<br>its fixed-width binary representation to standard output.<br>'A tuple is like a list, but is immutable. You create a tuple by enclosing comma-separated values within matched parentheses, eg, a = (1, 2, 3).<br>If a is a tuple, a[i] is the ith element in it.<br>5 / 7<br>Project 4 (RSA Cryptosystem)<br>>-
000110000000010011010100001010100011001010100011001110000110010111100100 Directions: • Accept public-key n (int) and e (int) as command-line arguments. • Get the number of bits per character (call it width) needed for encryption, ie, number of bits needed to encode n. • Accept message to encrypt from standard input. • For each character c in message: - Use the built-in function ord() to turn c into an integer x. - Encrypt x. - Write the encrypted value as a width-long binary string. • Write a newline character. "/>
Extracted text: Problem 3. (Encryption Program) Write a program called encrypt.py that accepts the public-key n (int) and e (int) as command-line arguments and a message to encrypt from standard input, encrypts each character in the message, and writes its fixed-width binary representation to standard output. 'A tuple is like a list, but is immutable. You create a tuple by enclosing comma-separated values within matched parentheses, eg, a = (1, 2, 3). If a is a tuple, a[i] is the ith element in it. 5 / 7 Project 4 (RSA Cryptosystem) >- "/workspace/project4 $ python3 encrypt.py 3599 1759 Cs110 000110000000010011010100001010100011001010100011001110000110010111100100 Directions: • Accept public-key n (int) and e (int) as command-line arguments. • Get the number of bits per character (call it width) needed for encryption, ie, number of bits needed to encode n. • Accept message to encrypt from standard input. • For each character c in message: - Use the built-in function ord() to turn c into an integer x. - Encrypt x. - Write the encrypted value as a width-long binary string. • Write a newline character.
Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here