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 Pprime: 2048 bitsRelated terms
- RSA — A widely used public-key algorithm, named after its inventors Rivest, Shamir and Adleman, used for digital signatures and for encrypting small secrets such as keys.
- Diffie-Hellman — A method that lets two parties agree on a shared secret key over a public network, even while an eavesdropper sees every message they exchange.
- MODP group — A published set of public Diffie-Hellman numbers, a large prime and a generator, that anyone can reuse for key exchange.
- key length — The size of a cryptographic key in bits, which sets how many possible keys an attacker would have to try.
Taught in
- Asymmetric Cryptography: RSA, ECC & Diffie-Hellman — Cybersecurity Fundamentals, GRC & Cryptography