# random number generator and seed

I'm working with openssl cryptographic libraries, I'm new to all these cryptographic stuffs and slowly I'm learning all these. I have a doubt regarding random number generator, I'm using RAND_pseudo_bytes() for generating a pseudo random number. I'm providing a seed to it with my required entropy. But my doubt is if we provide same seed twice, will the random number generator generate the same random number ?

-
Yes. Hence the name pseudo-random generator. You should read your entropy (ie. your seed) from /dev/urandom if working on *nix. See this answer for more. –  rath Aug 26 '13 at 9:51
rath, can you expand your comment a little bit and post it as an answer? –  pg1989 Aug 27 '13 at 19:24

I recommend against using RAND_pseudo_bytes(). OpenSSL's CPRNG does not provide better pseudo-random numbers than /dev/urandom but it is much harder to use right. It has a couple of known flaws, for example it doesn't handle fork() very well. The standard PRNG is not very well designed, too. The FIPS mode PRNG is a bit better, though.
/dev/urandom (Linux, BSD, Solaris) are about as fast as RAND_pseudo_bytes(). You don't have to take care of seeding, fork hooks, thread locks and other stuff that makes the PRNG hard to use. You can just read as many bytes from /dev/urandom as you need. Windows has CryptGenRandom().
No matter what some people or documents say: ignore /dev/random. /dev/urandom is fine for everything you are going to do.
I think saying "No matter what some people or documents say: ignore /dev/random." is a pretty bald statement, especially considering you do not provide argumentation. –  orlp Sep 26 '13 at 23:35