liveBook · Manning

Prime number

A prime number is an integer greater than one whose only positive divisors are one and itself.

How 5 Manning books explain it

Hacking Cryptography

A prime number is an integer greater than one that has no positive divisors other than one and itself.

How it is used
Supports asymmetric key generation and explains why integer factorization can serve as a public-key cryptographic trapdoor.
How deep it goes
Defines primes, demonstrates factorization, and explains probabilistic testing, but defers detailed asymmetric algorithms.
Examples
Uses 13, 37, 42, and the worked factorization of 764,512 to distinguish primes from composite numbers.
What you can do after
Evaluate candidate integers, follow cryptographic prime generation, and understand its relationship to RSA factorization hardness.

Read how Hacking Cryptography explains prime number →

Real-World Cryptography

A prime number is an integer greater than one with no positive divisors other than one and itself, used in finite-field Diffie-Hellman as the modulus.

How it is used
Supplies the modulus and group size for finite-field Diffie-Hellman key exchange.
How deep it goes
Defines primality, relates size to discrete-logarithm security, and stops short of proving primality or deriving DH attacks.
Examples
Uses small primes, a modulus-5 clock, probable-prime generation, ROCA, and historical broken DH parameter sets.
What you can do after
Configure DH with appropriately sized, carefully specified prime groups and recognize risks from faulty parameter generation.

Read how Real-World Cryptography explains prime number →

Elliptic Curve Cryptography for Developers

A prime number is a positive integer greater than one that has no positive divisors other than one and itself.

How it is used
Defines the modulus for finite-field arithmetic used throughout elliptic-curve cryptography.
How deep it goes
Develops prime numbers through field rules, modular arithmetic, cryptographic scale, and implementation-oriented GMP routines.
Examples
Uses a modulo-43 clock, 256-bit field sizes, and a largest-prime curve cardinality to ground the concept.
What you can do after
Evaluate/understand how prime moduli support finite-field operations and cryptographic elliptic-curve parameters.

Read how Elliptic Curve Cryptography for Developers explains prime number →

Learn C++ by Example

A prime number is a positive integer greater than one that has no positive divisors other than one and itself.

How it is used
Uses primality testing to constrain random targets in a number-guessing game.
How deep it goes
Explains a tested modulo algorithm through square-root bounds, while deferring further optimizations and the sieve of Eratosthenes.
Examples
Demonstrates primes through 2, 3, 4, 6, and 35, then applies them to a five-digit guessing game.
What you can do after
Build a C++ primality predicate and use rejection sampling to generate prime game targets.

Read how Learn C++ by Example explains prime number →

Regular Expression Puzzles and AI Coding Assistants

A prime number is a natural number greater than one that has no positive divisors other than one and itself.

How it is used
Uses prime sequences to test whether regular expressions can recognize arithmetic structure rather than merely imitate its surface pattern.
How deep it goes
Contrasts prime definition, sieve mechanics, encoded examples, and regex failure without developing a formal impossibility proof.
Examples
Uses @-encoded prefixes such as 2 3 5 7 11 and counterexamples that skip 5 or include 4.
What you can do after
Evaluate prime-recognition solutions by checking correctness, edge cases, algorithmic fit, and explanations instead of trusting executable-looking code.

Read how Regular Expression Puzzles and AI Coding Assistants explains prime number →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.