Cryptography & Security
Intermediate

Modular Exponentiation

Core operation of RSA encryption — raise a message to a power, modulo n.

Formula

c=memodnc = m^e \bmod n

Variables

cCiphertext
mMessage
ePublic exponent
nModulus

Example

m=4, e=3, n=33: c = 64 mod 33 = 31

Did You Know?

Fast exponentiation lets computers raise huge numbers to huge powers in milliseconds — the engine of public-key crypto.

Share this formula