https://github.com/viega/applied_crypto_2022_spring/tree/master/ps3 Program needs to be in text file and running in Gradescope.

1 answer below »
https://github.com/viega/applied_crypto_2022_spring/tree/master/ps3
Program needs to be in text file and running in Gradescope.



Answered 8 days AfterApr 02, 2022

Answer To: https://github.com/viega/applied_crypto_2022_spring/tree/master/ps3 Program needs to be in text file...

Sandeep Kumar answered on Apr 06 2022
99 Votes
# -*- coding: utf-8 -*-
"""ps3.ipynb
Automatically generated by Colaboratory.
Original file is located at
https
://colab.research.google.com/drive/1kLVfcfD6Ee54uzUQR5LSOQLA77326Dvc
"""
import json
json_input = open('example-input.json')
dat_in = json.load(json_input)
dat_out = {}
dat_in
p1 = dat_in['problem 1']["nums"]
p2_p = dat_in['problem 2']['p']
p2_q = dat_in['problem 2']['q']
p3_p = dat_in['problem 3']['p']
p3_q = dat_in['problem 3']['q']
p4_e = dat_in['problem 4']['e']
p4_n = dat_in['problem 4']['n']
p4_x = dat_in['problem 4']['x']
p5_p = dat_in['problem 5']['p']
p5_q = dat_in['problem 5']['q']
p5_y = dat_in['problem 5']['y']
#Problem 1
def is_prime(x):
if x < 2:
return False
else:
for n in range(2,x-1):
if x % n == 0:
return False
return True
prime= []
for i in p1:
prime.append(is_prime(i))

prime
# Problem 2
if is_prime(p2_p)==True:
p = p2_p
else:
print('p is not prime')
if is_prime(p2_q)==True:
q = p2_q
else:
print('q is not prime')
def compute_lcm( p, q):

p11 = p - 1
q11 = q - 1
# choose the g number
if p11 > q11:
g =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here