2 ms·
If your /dev/urandom returns the same sequence of 32 bytes twice in a row, you have something truly pathological going on.
by marshray 13y ago
If your /dev/urandom returns the same sequence of 32 bytes twice in a row, you have something truly pathological going on.
- StavrosK 13y agoIn the above example, you're XORing urandom with itself.
- marshray 13y agoRun this a bunch of times: dd if=/dev/urandom bs=32 count=1 | xxd Substitute 'base64' if you don't have 'xxd'. If you get the same output twice, see a doctor.
- DanBC 13y agoWhy XOR urandom with itself? You don't gain anything, and if your random numbers are correlated with something you're making it worse. I guess it makes testing easier. Correlations will be easier to see.
- marshray 13y agoPeople were saying 'urandom XOR urandom' was a pathological failure mode. My point is that it's not going to return the same results twice.
- DanBC 13y ago...but you understand that it doesn't matter that it's not returning the same results twice, and that it's still a fail, right?
- tptacek 13y agoMarsh probably does understand the implications here. What kind of "fail" were you thinking of? That it was pointless? I agree. That it's going to blow up? I less agree.
- marshray 13y agoThanks 'tptacek. The point is `dd if=/dev/urandom bs=32 count=1` XOR `dd if=/dev/urandom bs=32 count=1` is not going to cancel out to be zero as some here are implying. No one is claiming that it's a net gain either though.
- DanBC 13y agoAs I understand it: You're taking a non-blocking source of randomness, and depleting its entropy pool quicker, which forces it to drop back into 'not very good random mode' quicker.
- tptacek 13y agoArgh. No, that's not what happens. Think about this for a second. It's not like the "entropic" bytes have a color, and the pool gets low on the bytes with that color.
- marshray 13y agoIt would be like that if you were looking at it decades ago when key sizes were small and cryptographers didn't have much faith in the one-way-ness of hash functions, or from the perspective of that branch of information theory which seems to permit the existence of arbitrarily powerful computers. A lot of guidance coughman pagescough is still written that way. In the real world, our computers are limited by physics. It seems that in crypto, the least controversial assumption we can make is that given enough secret bits (i.e., entropy) we can be safe from brute force attacks.