I’m looking for a way to generate large random numbers on the order of 2^64 in C… (100000000 – 999999999), to use in a public key encryption algorithm (as p and q).
I do not want to generate a number smaller than 2^64 (that is, smaller than 100000000).
Is there anything that could help me to do this?
random() returns a long which on a 64bit system should be 64 bits. If you are on a 32bit system you could do the following:
Alternatively on a NIX system you could read /dev/random into your buffer:
A