dimanche 1 mars 2020

Cryptographically secure RNG in C++ for RSA PKCS#1 (key generation)

I'm trying to re-implement the RSA key generation in C++ (as a hobby/learning playground) and by far my biggest problem seems to be generating a random number in range x,y which is also cryptographically secure (the primes p and q, for example).

I suppose using mt19937 or std::rand with a secure random seed (e.g. /dev/urandom or OpenSSL RAND_bytes etc) would not be considered 'cryptographically secure' in this case (RSA)?

ISAAC looked promising but I have zero clue on how to use it since I wasn't able to find any documentation at all.

Notably, this is also my first C++ project (I've done some C, Rust etc before... So C++ at least feels somewhat familiar and I'm not a complete newbie, mind you).




Aucun commentaire:

Enregistrer un commentaire