Question: 4. (20 pts) Finally, implement a function that can factor large positive integers. You will use this to crack your private key from part 3.

 4. (20 pts) Finally, implement a function that can factor large

4. (20 pts) Finally, implement a function that can factor large positive integers. You will use this to crack your private key from part 3. Use trial division or any other algorithm you are interested in The function should take two arguments: factor(n,primes), where n is the integer that you'd like to factor, and primes is a list of primes that you generated using your sieve from part 1. This function should return a list of prime factors for n. If n is prime, the list should only contain one element: n itself. Test it on your n from part 3 to verify that it works (you should recover p and q). 4. (20 pts) Finally, implement a function that can factor large positive integers. You will use this to crack your private key from part 3. Use trial division or any other algorithm you are interested in The function should take two arguments: factor(n,primes), where n is the integer that you'd like to factor, and primes is a list of primes that you generated using your sieve from part 1. This function should return a list of prime factors for n. If n is prime, the list should only contain one element: n itself. Test it on your n from part 3 to verify that it works (you should recover p and q)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!