Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started