On Sun, Feb 07, 2010 at 12:26:43PM -0800, Philip Guenther wrote:
> On Sunday, February 7, 2010, Otto Moerbeek wrote:
> > That is still wrong for this purpose. Although random(3) is a better
> > random number generator than rand, is still a cryptographic weak
> > generator.
> >
> > Better use arc4random()
>
> Or rather, since he needs to reduce
> the range, use arc4random_uniform()
>
> (That C++ made me cry. Iterating across a map<> to convert an integer
> in the range 1..56 to a character?!? If only C++ had a datastructure
> which gave O(1) lookup for small indexes, like an array does in C.)
>
> Philip Guenther
I glanced at that code and there are some real gems there. Like a new
way of adding 8 to a number in the passwd() function.
-Otto