modulus

In modular arithmetic, the number you divide by while keeping only the remainder, so that results wrap around like hours on a clock.

In more detail

Public-key algorithms do their calculations modulo a very large number. In RSA the modulus is the product of two secret primes, and its size in bits is the key length, such as 2048 or 3072; in Diffie-Hellman it is a large public prime shared by everyone using the group. In Python the three-argument pow(g, a, p) computes g to the power a, modulo p, efficiently.

Examples

A = pow(G, a, P)           # G to the power a, modulo the 2048-bit prime P
prime: 2048 bits

Related terms

Taught in

References