

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: RSA
incomplete
2: RSA vs. ECC
incomplete
3: RSA Key Generation
incomplete
4: Totient and E
incomplete
5: Modular Arithmetic
incomplete
6: Modular Arithmetic
incomplete
7: Encryption
incomplete
8: Multiplicative Inverse
incomplete
9: Private Key
incomplete
10: Decryption
incomplete
11: Encryption and Decryption Explained
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Modular arithmetic and modular exponentiation are widely used in cryptography, and RSA is no exception.
In modular arithmetic, numbers "wrap around" when reaching a certain value, called the "modulus". The calculation is simple.
a = b (mod n)
Using the modulo operator %, we first do a % n = b. Now we know number a is congruent with the remainder, b, in (mod n). Likewise, all numbers with this remainder are congruent in (mod n).
In the world of (mod 2), 0 is congruent with 0 (mod 2). So we would write:
0 ≡ 0 (mod 2)
And so on:
≡ is the congruence symbol.
As you saw above, in the world of (mod 2), there are only 2 possible values: {0, 1}. However, in the world of (mod 3), there are 3 possible values: {0, 1, 2}.