Sunday, 28 March 2021

DIY Encryption (Part 1)

I decided to create a simple worked example of encryption. The first step was to find some large prime numbers so I looked up how to do this on the Internet. Apparently you can use the sieve of Eratosthenes so I wrote the C program below, which uses this method to list all the prime numbers between 2 and 8,000,000:

I redirected the output to a file and the program finished in under 1 second. Here are some of the results from the start, middle and end of the output. I checked them here:



No comments:

Post a Comment