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
    Commented Apr 20, 2015 at 8:16

1 Answer 1


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


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .