> If you've tested the implementation of rand that you're using and

determined that it isn't good enough for what you're doing then you need

to look at other generators. In particular, you ought to look at the

Mersenne Twister: it's big (the most common form of the generator stores

624 32-bit values), but it's fast and it has a long period.

The OP said his application is cryptography. I don't know if that

means a toy project or a "real" software project. I hope the OP is

working on a toy project. Otherwise, they need to learn MUCH more

about random number generators and particularly those that are crypto

secure and this topic seems off topic here.

OP, neither rand nor Mersenne are suitable for cryptography. You need

to be using something such as Blum Blum Shub for example.

L. Blum, M. Blum, and M. Shub.

A Simple Unpredictable Pseudo-Random Number Generator.

SIAM Journal on Computing, volume 15, pages 364-383, May 1986

But more importantly, if this isn't a toy, please take the time to

learn the field as well as you can. I'm sure anyone that uses your

software will appreciate having a decent crypto system.

If it is a toy, well have fun with whichever generator you choose :)