News for hackers. Stuff that matters.
Re:Blog post id enumeration can lead to unwanted information... by marcosdumay on Monday February 29, 2016 @11:03AM (#11196199)
> But maybe they are too expensive.

Why would that be? You can fork your PRNG as many times as you have threads in initialization, so there's no need for IO. And secure ones do spend many times more CPU than the cheapest PRNG available, both would be a rounding error on the performance on nearly all real world work-loads.

I'd support removing non-secure random functions from every standard library out there.

Re:Blog post id enumeration can lead to unwanted information... by JoeAltmaier on Monday February 29, 2016 @11:12AM (#11196263)
We used UUIDs for every media stream in our media engine. Had to create about 15 per second during prime-time conference hours. It was 40% of our CPU load! So they aren't free.
Re:Blog post id enumeration can lead to unwanted information... by dchest on Monday February 29, 2016 @11:48AM (#11196487)
15 per second for 40% CPU? ಠ_ಠ This is very strange. On my laptop:

   ~ $ python -m timeit -s 'import uuid' 'uuid.uuid4()'
   100000 loops, best of 3: 14.2 usec per loop
Which gives more than 70000 random UUIDs per second.
Re:Blog post id enumeration can lead to unwanted information... by JoeAltmaier on Monday February 29, 2016 @11:52AM (#11196511)
Yeah we were using some cryptographically secure ones for some reason. Creating them in Java!
Re:Blog post id enumeration can lead to unwanted information... by dchest on Monday February 29, 2016 @11:54AM (#11196522)
Python's uuid4 is cryptographically secure, as far as I know. One UUID needs ~16 random bytes, my laptop's /dev/urandom gives about 14 MB/s (user-space PRNG can be much faster if needed).

Ah, Java...

Re:Blog post id enumeration can lead to unwanted information... by JoeAltmaier on Monday February 29, 2016 @12:24PM (#11196737)
To be cryptographically secure, it must be unguessable. That's a higher bar than random, because many random number generators are guessable (i.e. completely predictable).
Re:Blog post id enumeration can lead to unwanted information... by marcosdumay on Monday February 29, 2016 @06:10PM (#11199475)
Linux /dev/urandom is cryptographically secure.

The library you are using for creating those UUIDs must have some bug. My guess is they share the same generator for all threads on each machine.

Re:Blog post id enumeration can lead to unwanted information... by JoeAltmaier on Tuesday March 01, 2016 @01:30AM (#11201106)
From Wikipedia : "some people claim /dev/urandom as not recommended[who?] for the generation of long-term cryptographic keys"
Re:Blog post id enumeration can lead to unwanted information... by marcosdumay on Tuesday March 01, 2016 @07:38AM (#11202198)
It's manpage also says the same.

It is a cryptographically secure PRNG, but during a small time in system start up, it may not be correctly seeded.

If you need long term keys, it may be better to get some 256 bits from /dev/random before using /dev/urandom.

Re:Blog post id enumeration can lead to unwanted information... by dchest on Tuesday March 01, 2016 @08:14AM (#11202332)