Problem 3. (Encryption Program) Write a program called encrypt.py that accepts the public-key n (int) and e (int) as com

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Problem 3. (Encryption Program) Write a program called encrypt.py that accepts the public-key n (int) and e (int) as com

Post by answerhappygod »

Problem 3 Encryption Program Write A Program Called Encrypt Py That Accepts The Public Key N Int And E Int As Com 1
Problem 3 Encryption Program Write A Program Called Encrypt Py That Accepts The Public Key N Int And E Int As Com 1 (121.09 KiB) Viewed 30 times
Problem 3 Encryption Program Write A Program Called Encrypt Py That Accepts The Public Key N Int And E Int As Com 2
Problem 3 Encryption Program Write A Program Called Encrypt Py That Accepts The Public Key N Int And E Int As Com 2 (55.21 KiB) Viewed 30 times
please use the formate in the seccond photo and follow the instructions exactly with heavy use of comments so I may understand the step by step process. thank you.
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 is the ith element in it. >_/workspace/project4 $ python3 encrypt.py 3599 1759 CS110 <ctrl-d> 00011000000001 Project 4 (RSA Cryptosystem) 11010100001010100011001010100011001110000110010111100100 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 ce in message: Use the built-in function ord) to turn e into an integer z. Encrypt z. Write the encrypted value as a width-long binary string. . Write a newline character. 3/5
2 7 10 11 12 Simport rea import stdio import sys #Entry point. def main(): if_name_ main() _main__':
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply