Bobby J.

asked • 04/16/22

How do i solve this with python with the input json given?

The JSON inputs will be positive integers.


For RSA, we need to select two huge random numbers in real-world scenarios. We can do this by picking a random number and then testing it for primality. This exercise will supply you with an array of positive and representable integers in 32 bits. For each integer, you will output a boolean value of true if it is prime, and false if it is not.

You're welcome to use a fancy probabilistic algorithm, such as the Miller-Rabin test (which is very commonly used in crypto libraries). Still, you should be able to use trial division... even though it might take a while to grade (2^32 is a lot of trials... at least skip even numbers after 2).


Input:

  1. numbers: An array of integers to test for primality.


"problem 1" :
{
"numbers" : [3, 4, 5, 6]
},


1 Expert Answer

By:

Patrick M. answered • 04/22/22

Tutor
4.9 (72)

Software Engineer Level II with 5 years Python experience

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.