Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions

Question

8. Provide recommendations for how to manage knowledge.

Answered: 1 week ago