HNHacker News
TopNewBestAskShowJobs

glitchcomet

13 karma · joined February 20, 2022

glitchcomet.com
submissionscomments
glitchcomet··on How hard can generating 1024-bit primes be?
It is custom html/css built with my own simple static site generator. The entropy styling is css animations delayed for each letter such that it matches up. Glad that you liked it!
glitchcomet··on How hard can generating 1024-bit primes be?
That's an interesting idea. I don't know enough to say if using a large offset would be enough to mitigate the downsides of +=2, i would have to read more about it. In actual use you can go directly to using random candidates for each test as a few extra seconds to generate 2 primes would be worth the benefits. In hindsight my simplistic rng() can also probably be better optimized (batch load random bits and cache) to make it faster as the slowdown primarily comes from repeated filesystem access.
glitchcomet··on How hard can generating 1024-bit primes be?
Yeah i read about this in my research. It is a tradeoff between execution speed vs randomness of primes, i choose to go with speed assuming that 16 threads all starting from a random number and competing to find the prime would add enough randomness. If someone preferred more randomness in place of speed it's an easy change to replace the +=2 with a rng() call.
glitchcomet··on How hard can generating 1024-bit primes be?
You can find the bases for N < 3x10^21 on wikipedia [0] which make Miller-Rabin deterministic. 1024 bit numbers have ~300 digits and as far as i know, no known bases exist for that range.

[0]: https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality...

glitchcomet··on How hard can generating 1024-bit primes be?
Thanks a lot!
glitchcomet··on How hard can generating 1024-bit primes be?
As the other comments have mentioned, by setting the first bit to one it looses a bit of entropy but ensures that the prime is large enough. Another thing to add is that in RSA two primes are multiplied together. If one of them is 1024 bits the other can be ~200 bits (if i remember correctly) and still reach the required number of entropy bits for the key. So, having both primes be 1024-bit adds a bit of wiggle room too.