logoalt Hacker News

gnfargbltoday at 11:11 AM3 repliesview on HN

Consider an 8-bit RNG.

By your argument, it would not be a problem if the RNG never generated 0. So, it must follow that it would also not be a problem if it never generated {1, 2, 3, ..., 253}.

That means that our RNG now only generates the values 254 and 255. Which of the values is generated is unpredictable on any given call. However, 7 of the 8 output bits are now always fixed and so completely predictable. Can you imagine how an attacker could exploit that?

Failing to generate only the number 0 is a weaker version of the same class of flaw.


Replies

brooksttoday at 11:29 AM

This is the “what’s the big deal if I lost $100k in a casino, it’s really the same thing as if I had lost $5” argument.

I don’t think you can rebut “you only lose one of many values” with “it’s the same as only having one left”.

show 1 reply
BigTTYGothGFtoday at 1:12 PM

> So, it must follow

It certainly does not.

A never-zero RNG is something one should know about, so that it can be mitigated if necessary, but it's not inherently a dealbreaker.

throwawayffffastoday at 11:39 AM

The value space goes from 2^16, 2^32, 2^64 to 2^16 - 1, 2^32 - 1, and 2^64 - 1 respectively.

The bug has zero practical impact.

show 1 reply