A lock factory needs secret keys for a new product. Both proposals produce 256 bits, and their strings look equally long. The team must choose one. If an outsider can recompute a key, encrypting its storage may not repair that predictable starting point.
This is a fictional teaching scenario. The 256-bit length holds one comparison variable fixed; it does not specify a cipher or guarantee product security. We will trace the inputs, then use four cards to understand what makes an answer hard to guess. No probability formulas are needed to start.
Where can equal-length keys differ?
Proposal A uses a public time and product serial number with a fixed, public rule. Anyone with those inputs can repeat the computation and obtain the same result. Printing a long hexadecimal string does not force an outsider to guess every digit. The outsider can simply rerun the generation steps.
Proposal B adds random input that the outsider does not know. That makes B worth investigating, but it does not establish security. The input could be biased, reused across devices or already exposed. We need to ask which outcomes remain possible after the outsider’s clues, and how likely each outcome is.1
A physical-key analogy can draw attention to complicated teeth. For a digital key, we also need to examine how it was made. A detailed public manufacturing recipe may let someone reproduce an elaborate-looking result. The locks are teaching props here; this lesson does not claim that real locks all share one design.
For now, both algorithms are known. Holding that assumption fixed lets us study uncertainty in the inputs. We will replace the long strings with four cards and ask what a reader can predict before the answer is revealed.
Guess a card before seeing the answer
Put four distinct cards, A through D, in an opaque bag. Assume an equal chance for every card and replacement after every draw. You must name one card before the reveal. Guessing A succeeds with probability one quarter, just like guessing any other card. No available clue favors one option.
The one-quarter probability is specified by this model. We have not drawn a few samples and inferred the quality of a real bag. A physical draw might depend on card shapes or handling. We set those details aside to isolate what it means not to know the outcome yet.
The robot draws C this time, while the teacher guessed A. That miss does not change the next draw’s assumptions. After replacement, each card again has probability one quarter. Knowing that the previous card was C does not make A due on the next round.
The factory needs a similar judgment about what an outsider can predict before key generation. Four cards are a tiny teaching problem, far too small to protect a secret. Their purpose is to make the candidates and probabilities visible before we name the uncertainty.
What uncertainty does entropy describe?
In this lesson, entropy describes uncertainty before an outcome is revealed. Before the draw, you know the four possible results and their probabilities. You still do not know which card was selected this time. Entropy expresses that uncertainty quantitatively. For secure randomness, the observer’s available information matters.1
After C is revealed, anyone who saw it can answer C directly. The card has not changed its material, and the bag needs no redesign. The observer’s information has changed. This example concerns a selected result; it does not say that the next independent draw has lost its uncertainty.
Now publish the list C, A, D, B and cycle through it in order. Its unfamiliar ordering does not prevent prediction. Anyone who knows that the current card is C can predict A next. An untidy appearance alone provides no evidence of secure randomness.
Disorder can be a useful word in other discussions of entropy, but here it can distract readers toward appearance. The factory needs outsiders to be unable to predict secrets efficiently. Later we will separate uncertainty from computational difficulty. First, equally likely cards will help explain the unit.
Why do two and four options differ by one bit?
With only A and B, each having probability one half, the uncertainty is 1 bit. Four equally likely cards give 2 bits. Doubling the options from two to four adds one bit. Each additional bit doubles the number of equally likely candidates.
You can understand the unit through questions answered truthfully. First ask whether the card is in the A/B group. Then ask which card is in that group. Two yes/no answers can identify one of four cards. That is identification using disclosed information; it does not mean two guesses guarantee success.
Bits also measure storage length, which can obscure the distinction. Encoding a card result in a 256-bit field does not create more possible card results. Extra space might contain fixed zeros or repeated encoding. The field is long, but this equal-probability model still has only 2 bits of uncertainty.
This simple conversion relies on equally likely options. If one card is much more likely, counting the cards is insufficient. The factory’s random input could also be biased. We will keep four options and change only their probabilities to see how guessing changes.
Why is a four-option draw easier when biased?
Keep the four cards, but specify a 90% probability for A. Divide the remaining 10% equally among B, C and D. Each has probability 10/3%, about 3.33%. These are declared teaching values, not measurements of a noise circuit or product. All four outcomes remain possible, but they are no longer equally likely.
Someone who knows the distribution can guess A first each time. The single-guess success probability is 90%, compared with 25% in the fair model. Cards need not take turns appearing, and A is not guaranteed. Probabilities describe the model; a few demonstration draws are not a fixed quota.
That changes the factory’s assessment. An input can have several possible outcomes while one occurs overwhelmingly often. An outsider can try that outcome first. This strategy does not require a complete break of the generation algorithm. Bias alone gives the guess a substantial advantage.
We must examine both the candidate set and the probabilities. Four options do not automatically provide the previous 2 bits of uncertainty. Next we will change a different condition: equal counts of zeros and ones, with an obvious rule connecting the bits.
010101 is balanced, yet its next bit is predictable
Give 01010101 to a check that only counts zeros and ones. It finds four of each, a perfectly balanced result. Yet a reader can predict the next bit. With a known start at zero and a known alternating rule, the next bit is zero. The count never examined the relationship between successive bits.
If the alternating rule is known but the starting phase is not, two candidates remain: 0101… and 1010…. With equally likely phases, the full sequence has only the 1 bit of uncertainty from that initial choice. Once the first bit is seen, the rest follows. The unknown-phase case should not be labeled completely known beforehand.
A real source can have less obvious correlations. One bit might make a particular following bit more likely. The pattern need not be as visible as alternation. Adding a separate uncertainty estimate for each bit can then overstate uncertainty in the full sequence. NIST entropy-source assessment distinguishes independent from non-independent data.1
This example shows why balanced counts alone cannot establish security. It does not make every statistical test useless or measure a real source from one string. The factory still needs evidence about the source and the observer’s information. Cards will next show how a disclosed clue narrows the candidates.
The observer's clues change the assessment
Return to four equally likely cards. Before any clue, the best single guess succeeds with probability one quarter. The robot now discloses that this selected card is A or B. C and D are ruled out, and A and B remain equally likely in this model. A single guess now succeeds with probability one half.
The selected answer is the same, but the clue reduces uncertainty. If the robot reveals B directly, you can answer B with certainty for this draw. Someone who saw neither clue still faces the original four choices. A security assessment must identify which observer it concerns.
A factory serial number or time can also help an outsider narrow possible inputs. The effect of a real time window depends on the generation rule and what is visible. The card diagram does not justify a rule that every disclosed field halves the candidates or removes exactly one bit.
A changing public identifier should not be credited as secret entropy merely because it varies. An outsider who already knows it has no uncertainty about that value. We can make the comparison concrete by asking how likely the outsider’s strongest single guess is to succeed.
Min-entropy starts with the best single guess
A security assessment cannot assume an outsider guesses arbitrarily. Someone who knows the most common outcome can choose it first. The best probability is 25% for four fair cards. In the biased model, choosing A gives 90%. The card count is unchanged, but the strongest guesses have very different chances.
NIST 90B uses min-entropy. It expresses uncertainty using the largest probability of any single outcome. A larger best-guess probability gives lower min-entropy. This perspective prevents many rare outcomes from obscuring an especially common one.1
Shannon entropy is another common measure, describing average information. The two definitions serve different purposes and their numerical values should not be exchanged. We keep the best single guess in the main lesson and leave formulas to the extension. Single-guess probability is also distinct from average attack attempts, which depend on guessing order and the full distribution.
At the factory, storage length describes field capacity. Min-entropy describes uncertainty under a specified distribution. Security strength also involves algorithms and feasible attack costs. Each needs its own evidence. We can now examine a deterministic mechanism that expands a short starting input into a long sequence.
Engineer extension: the formula and its assumptions
For this discrete model, H∞(X) = −log₂(maxₓ P(X=x)). Four equally likely cards give a maximum probability of 1/4 and hence 2 bits. A maximum probability of 0.9 gives about 0.152 bits. That number is neither average attack attempts nor security strength obtained from a measured bit string.1
With observer information, first specify the conditional distribution. Page 7 uses the fixed clue A or B, leaving two equally likely outcomes. General conditional min-entropy has distinct definitions and applications. This one-clue example is not a complete leakage analysis. A real source needs a source model, sampled data and appropriate estimation.
Interactive lab: change probabilities and clues
All probabilities are declared. This does not measure a source or generate secure keys.
- Best single-guess probability
- 25%
- Model min-entropy
- 2.000 bits
- Your single guess
- 25%
Fair with no clue: 25% and 2 bits. Raising A to 90% improves the best guess and lowers min-entropy. After B is disclosed, this selected answer is known.
Another experiment: does longer output add candidates?
Sixteen equally likely seeds, a fixed rule, and no new unknown input. This transparent toy is not a cryptographic DRBG.
- Observer candidate sequences
- 16
- Model min-entropy
- 4 bits
- Best single-guess probability
- 6.25%
Teaching output for seed 5
1100111111101001 See all sixteen candidates (teaching values)
Fixed rule: state = (5 × state + 3) mod 16, output four bits each step.
0011001011010100100010111010010111010100011101100010110101000111011101100001100011001111111010010001100010111010011000011000101110111010010111000000001100101101010111001111111010100101110011111111111010010000010001110110000110010000001100101110100100000011
A DRBG can be reproducible and still uncertain
A DRBG is a deterministic random bit generator. It establishes internal state, then uses an algorithm to produce output and update that state. The same starting point and subsequent inputs reproduce the same computation. Deterministic describes this rule; it does not say that an outsider necessarily knows the start.2
A secret starting point derived from unknown entropy input can leave uncertainty about the state and output. The DRBG algorithm itself creates no fresh entropy. Uncertain output and no new algorithm-created entropy can coexist, because the uncertainty was already present in the input.
The picture simplifies initialization to a secret seed. A real mechanism processes entropy input according to its requirements and may also use a nonce or personalization string. These supporting inputs need not all be secret. A public serial number cannot substitute for the required secret entropy. Full instantiation and reseeding belong to the next lesson.2
An outsider who knows the full state, algorithm and later inputs can compute the next output. Protecting the source while exposing state can still undermine unpredictability. The factory must examine both locations. We will now use a tiny seed model to see whether longer output automatically adds uncertainty.
Sixteen seeds cannot create unlimited uncertainty
Specify a tiny teaching model. A 4-bit seed has sixteen values, from 0000 through 1111, all equally likely. Choose one secretly and give it to a fixed algorithm. No new unknown input enters while the full output is produced. These assumptions let us count every possible start.
Each start determines one corresponding output sequence. However long the output becomes, it can represent at most sixteen distinct sequences. If two seeds produce the same sequence, there are fewer. Printing more bits does not add a seventeenth unknown starting point. This follows from the deterministic mapping.
Sixteen equally likely seeds have 4 bits of entropy. The full output in this model cannot exceed that entropy. We cannot add the marginal uncertainty of each output bit as if the bits were independent. One bit might have two possible values, while the whole sequence shares one starting point and related bits.
An outsider can compute all sixteen seeds and compare the results. This example intentionally makes search easy and must not protect real keys. It also does not establish that cryptographic DRBGs are useless. A practical system must additionally ask whether prediction is feasible within an attacker’s computational resources.
Engineer extension: marginal bits and the full output
For a specified fixed deterministic function Y=f(S), each seed maps to one output. With no new unknown input, H(Y)≤H(S) and H∞(Y)≤H∞(S). Collisions combine probabilities of outputs and can reduce uncertainty. This is an information-theoretic derivation for the teaching model, not a fixed security-strength claim for a real DRBG.
A single output bit may be uniform without making multiple bits independent. Repeat one unknown fair bit 100 times: each position has two possibilities, while the whole string has only all zeros or all ones. Adding those hundred marginal 1-bit uncertainties would incorrectly claim 100 bits of full-string entropy.
Uncertainty and feasible prediction are different questions
The previous page counted possible full outputs. This page asks whether an outsider can efficiently predict the next output. A suitable cryptographic mechanism can make analysis or search infeasible even when the algorithm is public. Computational unpredictability requires stated assumptions about the mechanism and the attacker’s capabilities.2
Sixteen seeds are too few; trying them all is easy. A real design needs sufficient secret entropy and state established and maintained according to the selected mechanism. A long fixed constant is not sufficient secret entropy. Nor does any program that scrambles numbers automatically become a secure DRBG.
A DRBG can efficiently provide a longer output through deterministic computation. Each output request need not be depicted as a fresh physical draw. That does not give each additional output bit one new bit of entropy. Instantiation or reseeding can introduce fresh entropy input, with timing governed by the construction and operating requirements.2
State protection remains part of the threat model. Exposed state changes the assessment even if previous output looks statistically convincing. Recovery and mandatory reseeding require a specific mechanism and policy. The next lesson will connect entropy sources to a complete generator. Here we can return to the factory’s choice with a better basis for judgment.
Return to the key choice, then change the purpose
A’s time and serial number are public, and its rule is known. In this scenario, an outsider can recompute it directly, so A is unsuitable as a secret-key proposal. We can reject it without first deciding which string looks more disorderly.
B’s random input is secret, but its source still needs evidence. The factory must establish sufficient secret entropy given the outsider’s information. It also needs a suitable generation mechanism, protected seeds and state, and operation that meets the requirements. A padlock icon on B cannot replace those checks.
Now change the purpose to public serial numbers on shipping boxes. Predictable values such as 0001, 0002 and 0003 may meet identification and tracking needs. Predictability alone need not disqualify a public identifier. Uniqueness must still be maintained separately; predictability does not guarantee absence of duplicates.
We can now ask more precise questions. Is the value a secret or a public identifier? Who knows which inputs? How strong is the best guess? Is generation state protected? The next lesson, Entropy Sources to TRNGs / RBGs, will explain how sources, DRBGs and fault policies form a usable random-bit service. This lesson performs no real-source entropy estimation or product certification.
Five checks to take back to the factory
- Interpret entropy with the probability model and known information, not the appearance of a string.
- The same number of options can still leave one outcome much easier to guess.
- A clue can reduce uncertainty about this selected result without changing the next draw’s distribution.
- A DRBG uses uncertainty in its secret seed; deterministic expansion does not add fresh entropy.
- Secret keys also need an appropriate generation mechanism and protected state. The next lesson examines a complete RBG.
Primary sources
- NIST SP 800-90B (2018) — §2.1 min-entropy; §2.2 source model; §3 and §5 independence and assessment. Card distributions are lesson assumptions, not NIST measurements.
- NIST SP 800-90A Rev.1 (2015) — Definitions, §7 and §8.6: deterministic mechanisms, state, entropy input, instantiation and reseeding. Complete constructions belong to Part B.
Learning guide and knowledge check
Prerequisites
- No cryptography background required; fractions help with the optional calculations.
What I learned
- Explain entropy as uncertainty before an answer is revealed.
- Distinguish balanced-looking output from unpredictable output.
- Use probabilities and clues to compare the best single guess.
- Explain why a DRBG can expand output without creating fresh entropy.
- Check secret input, the generation mechanism and state protection.
Key terms
- Entropy
- Uncertainty under a stated probability model and the observer's available information.
- Min-Entropy
- Minus the base-two logarithm of the largest outcome probability: the best single guess in the model.
- DRBG
- A deterministic random bit generator; expanding output does not create fresh entropy.
Further reading
Read answers and explanations
- Uncertainty before the result, given the stated probabilities and clues. The observer's information and the probability model matter. Appearance alone is not the definition.
- Choose A, with 90% success in this model. Min-entropy uses the largest probability, not an average over the four labels.
- The same inputs let an observer recompute the result. Known inputs and a known deterministic rule leave no unknown result in this model. A public identifier has different requirements from a secret key.
- No; there are at most sixteen full candidate outputs, with at most four bits of entropy. A secret seed can carry uncertainty. Deterministic expansion cannot add fresh entropy; computational unpredictability is a separate question.
- Check sufficient secret entropy, an appropriate mechanism and protected state. The three checks address different failure paths. None is established by a long or irregular-looking string.
Next, R01B: TRNG and secure randomness, from entropy sources to a complete service.