4

I'm trying to write a random number generator with the OpenSSL library. The provided RAND_bytes() function is self-seeding with the /dev/urandom. That's why I am only able to reseed with the RAND_seed() function. So if I am seeding the generator, it will always be a combination of the internal and my own seeding.

Is there a possibility to avoid the initial seeding, so I can manually seed the RNG without any internal seeding taking place?

I want to avoid internal seeding and seed the RNG manually, because I try to write a cryptographically weak random number generator, for testing purpose.

  • Is there another TLS implementation (different lib than OpenSSL) that comes with no internal seeded RNG? – Maximilian Apr 20 '15 at 8:16
1

Come to think of it, you could implement an engine with a weak RNG and insert it into OpenSSL using:

ENGINE_set_default(e, ENGINE_METHOD_RAND);

That should make sure that the random number generator is used. Of course it may be a good idea to ignore any seed information given to the random RNG by the OpenSSL.

This has the obvious disadvantage that it may be hard to find out when the random number generator is used for which function though. But I don't see how this couldn't work otherwise.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.