liveBook · Manning

Period

As explained in Hacking Cryptography

The period is the number of generated steps in a repeating sequence before its values begin to recur.

A period is the number of generated steps a pseudorandom number generator (PRNG) takes before its output begins repeating. It reflects the cycle length of the generator’s mutating internal state. section 2.2.2

An LCG’s period

The implemented linear congruential generator uses a modulus of 2^31 − 1, multiplier 48271, and increment 0. Its period is 2^31 − 1: it starts repeating after 2,147,483,647 generated values. section 2.2.2

Figure 2.8 PRNGs have a state and are initialized with a seed. The PRNG algorithm keeps mutating the state.
figure

Trace how a seed initializes PRNG state and how repeated algorithm steps mutate that state until the sequence cycles. section 2.2.2

How Hacking Cryptography covers it

How deep it goes
Defines repetition and quantifies an LCG’s cycle, but does not derive the period mathematically.
Examples
Uses an LCG with modulus 2^31 − 1 and observes repetition after 2,147,483,647 values.
What it assumes
Assumes familiarity with PRNG algorithms, seeds, and mutable state while defining period directly.
What you can do after
Evaluate a PRNG’s cycle length and recognize when its output sequence will recur.
How it connects
Connects period with PRNGs, seeds, internal state, and linear congruential generators.

Also explained in

Compare how 2 books explain period →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Hacking Cryptography. The section links point to the parts of the book it draws on.