Mathematics · Article
Elementary number theory in cryptography
Turn message number two into seven, then recover it by an inverse. Move from that small residue cipher to a tiny RSA exponent pair, prove why every message comes back, and distinguish correct arithmetic from a secure encryption scheme.
Back to MathematicsAfter reading, you can
- Distinguish an original message representative, a ciphertext representative and the key controlling their transformation.
- Prove when an affine residue map is reversible and explain how collisions prevent unique decoding.
- Derive the prime-residue exponent theorem and prove distinct-prime RSA recovery for every canonical message.
- Compute encryption and decryption by exact repeated squaring, retaining domain conditions and the limits of a deterministic classroom example.
A small transformation that can be undone
Suppose a classroom message is already represented by one of the integers 0 through 7. Transform x by multiplying by 3, adding 1, then keeping the remainder modulo 8. Message 2 becomes 3·2+1 = 7. To undo it, subtract 1 and multiply by 3 again: 3(7−1) = 18, whose remainder modulo 8 is 2.
That second multiplier works because 3·3 = 9 leaves remainder 1 modulo 8. The complete map below shows where every possible message goes. Predict whether two different messages can reach the same encoded number before revealing the inverse calculation.
Solid line: one preimage
Dashed line: shared output
Filled circle: selected input and output
| Message | Ciphertext | Recovered message | Messages sharing ciphertext | Recovered? |
|---|---|---|---|---|
| 0 | 1 | 0 | 1 | Yes |
| 1 | 4 | 1 | 1 | Yes |
| 2 | 7 | 2 | 1 | Yes |
| 3 | 2 | 3 | 1 | Yes |
| 4 | 5 | 4 | 1 | Yes |
| 5 | 0 | 5 | 1 | Yes |
| 6 | 3 | 6 | 1 | Yes |
| 7 | 6 | 7 | 1 | Yes |
Prepare the arithmetic and separate the three objects
Use the published Multiplication and division, Negative numbers and absolute value, and Powers, roots and the real number line lessons for products, signed differences and integer powers. Below, each needed fact about primes, common divisors and congruences is defined and proved before it is used.
A plaintext is the original message. A ciphertext is its transformed representation. A key specifies the transformation or its inverse. Here messages are integer representatives in a stated finite range. Turning a word, file or byte string into such numbers requires a separate encoding; two different texts must not accidentally be assigned the same representative.
Write ℤ for the integers. Write h | t if t = hk for an integer k, and h ∤ t otherwise. For a positive modulus N ≥ 2, x ≡ y (mod N) means N | (x−y). Each integer has one canonical residue in 0,…,N−1: divide with a remainder in that range. Congruence means equal residues, not equality of the original integers.
On a first reading, follow the reversible map and the small RSA calculation, then return to the integer-combination and prime-residue proofs. Keep the message-domain condition and the distinction between recovery and secrecy in view throughout.
An integer combination supplies the inverse
For an integer a and N ≥ 2, gcd(a,N) is the greatest positive integer dividing both. Such divisors exist and form a finite list because they divide N. The pair is coprime when this greatest common divisor is 1. An inverse of a modulo N is an integer u satisfying au ≡ 1 (mod N).
Euclidean division writes A = qB+r for nonnegative A and positive B, with 0 ≤ r < B. A common divisor of A,B divides B,r by subtracting qB; a common divisor of B,r divides A by adding qB. Repeating (A,B) → (B,r) preserves common divisors, and positive remainders strictly decrease until one is zero. The last nonzero value is the gcd.
Start with N = 0·a+1·N and |a| = s·a+0·N, where s is 1 for a ≥ 0 and −1 for a < 0. Every new remainder is the difference of two integer combinations, so the final gcd has form ua+vN with integer coefficients. For a = 0, the identity is N = 0·a+1·N. Thus the calculation supplies both the gcd and its integer-combination identity.
If the gcd is 1, ua+vN = 1 gives au ≡ 1, hence an inverse. If an inverse exists, au−1 is a multiple of N, so every common divisor of a,N divides 1; the gcd must be 1. Thus an inverse exists exactly for a coprime multiplier.
If gcd(a,N) = 1 and N | at, multiply ua+vN = 1 by t. Both terms of t = uat+vNt are multiples of N, so N | t. This cancellation argument will also justify the prime-residue proof below. Modular addition and multiplication preserve congruence because sums of divisible differences, and xy−x′y′ = y(x−x′)+x′(y−y′), remain divisible by N. Repeated multiplication gives the same rule for positive integer powers.
The multiplier decides whether an affine map is reversible
An affine residue map has form y ≡ ax+b (mod N), where a,b are fixed integers and x is canonical. If a has inverse u, decoding by x ≡ u(y−b) returns the input: u(ax+b−b) ≡ x. Each canonical ciphertext has exactly one canonical preimage. Conversely, equal outputs imply a(x−x′) ≡ 0, so cancellation gives equal canonical inputs.
If g = gcd(a,N) > 1, inputs 0 and N/g are distinct canonical residues with the same output. Their output difference is aN/g, a multiple of N because g divides a. This proves failure of unique decoding for every noncoprime multiplier, not merely for one drawing. The offset b cannot remove a collision.
Solid line: one preimage
Dashed line: shared output
Filled circle: selected input and output
| Message | Ciphertext | Recovered message | Messages sharing ciphertext | Recovered? |
|---|---|---|---|---|
| 0 | 1 | None | 2 | No |
| 1 | 3 | None | 2 | No |
| 2 | 5 | None | 2 | No |
| 3 | 7 | None | 2 | No |
| 4 | 1 | None | 2 | No |
| 5 | 3 | None | 2 | No |
| 6 | 5 | None | 2 | No |
| 7 | 7 | None | 2 | No |
For a = 2,b = 1,N = 8, messages 0 and 4 both encode as 1. No function receiving only ciphertext 1 can return both different originals. In the reversible a = 3 example, the complete outputs are 1,4,7,2,5,0,3,6: each residue appears once.
Reversibility alone is not secrecy. An observer who knows this affine key can compute the same inverse; even an unknown tiny key can be exhausted. A cipher that operates independently on repeated symbols also preserves repeated-symbol patterns. These facts concern the stated classroom map, not a claim that every cryptographic method is an affine cipher.
A public exponent and a decoding exponent have different roles
Choose two distinct positive primes p,q. A prime is an integer greater than 1 whose only positive divisors are 1 and itself. Set N = pq and T = (p−1)(q−1). Choose positive integers e,d with ed ≡ 1 (mod T). A coprime e,T admits such a d by the integer-combination identity. This convenient exponent condition is sufficient for our recovery proof, rather than a claim that it is the only possible decoding exponent. T is the product of the two prime decrements; the proof below explains why this choice works.
The arithmetic encryption rule sends a canonical message m to the canonical ciphertext c ≡ m^e (mod N). Decoding sends c to r ≡ c^d (mod N). The public pair is (N,e); the intended receiver retains the decoding exponent d. Our teaching tables expose all these tiny values so that the mathematics can be checked.
| Message | Ciphertext | Recovered message | Messages sharing ciphertext | Recovered? |
|---|---|---|---|---|
| 7 | 13 | 7 | 1 | Yes |
| Dividend | Divisor | Quotient | Remainder | Coefficient of exponent | Coefficient of product |
|---|---|---|---|---|---|
| 20 | 3 | 6 | 2 | -6 | 1 |
| 3 | 2 | 1 | 1 | 7 | -1 |
| 2 | 1 | 2 | 0 | -20 | 3 |
Take p = 3,q = 11. Then N = 33,T = 20. With e = 3, Euclidean divisions give 20 = 6·3+2, 3 = 1·2+1 and 2 = 2·1+0. Back substitution gives 1 = 3−(20−6·3) = 7·3−20. Therefore d = 7 works and ed = 21 = 1+20.
Message 7 encrypts to 7³ = 343 = 10·33+13, so c = 13. Decoding by the seventh power returns 7, as the next exact calculation shows. This one success is an example; the later proof must also cover every other message, including 0 and multiples of 3 or 11.
Keep intermediate residues small
Repeated squaring calculates a power without first writing the huge integer power. For 13^7 modulo 33, 13² = 169 ≡ 4 and 13⁴ ≡ 4² = 16. Since 7 = 4+2+1, combine 16·4·13: first 16·4 = 64 ≡ 31, then 31·13 = 403 ≡ 7. Every reduction is justified by the congruence product rule.
The tables record powers with exponents 1,2,4,… and identify which contributions are included. An available repeated square is not automatically a factor in the final product. All exponents in this lesson are positive, including the zero-message case 0^e = 0. No undefined 0⁰ or negative-power step is used.
| Exponent contribution | Power residue | Included? |
|---|---|---|
| 1 | 13 | Selected |
| 2 | 4 | Selected |
| 4 | 16 | Selected |
Multiplication permutes the nonzero residues of a prime
Let p be prime and suppose p ∤ a. Their gcd is 1, because a positive common divisor of p is either 1 or p and the latter is excluded. Multiply the residues 1,2,…,p−1 by a modulo p. None becomes 0: cancellation from p | aj would force p | j, impossible for 1 ≤ j < p.
No two outputs coincide. If aj ≡ ak, cancellation gives j ≡ k; their canonical ranges force j = k. There are p−1 different nonzero outputs and only p−1 possible nonzero residues, so they are exactly 1,2,…,p−1 in some order. This is a permutation: an ordering that uses each element once.
Solid line: one preimage
Dashed line: shared output
| Input | Product residue | Inputs sharing this output |
|---|---|---|
| 1 | 3 | 1 |
| 2 | 6 | 1 |
| 3 | 2 | 1 |
| 4 | 5 | 1 |
| 5 | 1 | 1 |
| 6 | 4 | 1 |
| Exponent contribution | Power residue | Included? |
|---|---|---|
| 1 | 3 | Omitted |
| 2 | 2 | Selected |
| 4 | 4 | Selected |
Let F = 1·2···(p−1), the product also written (p−1)!. Each factor has an inverse modulo p, so their inverse product is an inverse of F. The output product is congruent to a^(p−1)F by multiplication, and is congruent to F because it is a reordered copy of the same factors. Multiplying by the inverse of F gives a^(p−1) ≡ 1 (mod p). This proves Fermat’s little theorem with its required prime and nonzero-residue conditions.
For a = 3,p = 7, the outputs are 3,6,2,5,1,4. They use every nonzero residue exactly once, so 3⁶ ≡ 1 modulo 7. If the modulus is composite, those conditions may fail: for a = 2,N = 8, output 0 occurs, other outputs collide and 2⁷ ≡ 0 rather than 1. The theorem does not assert the prime-exponent rule for arbitrary composite moduli.
Handle divisible messages before combining the prime checks
For distinct primes p,q and positive e,d with ed = 1+kT, T = (p−1)(q−1), the integer k is nonnegative because ed ≥ 1 and T > 0. Decoding an encrypted message is congruent to (m^e)^d = m^(ed) modulo N. We will prove m^(ed) ≡ m separately modulo each prime.
Modulo p, first handle p | m. Both m and m^(ed) have residue 0 because ed is positive. Otherwise Fermat’s theorem gives m^(p−1) ≡ 1. Since ed = 1+k(q−1)(p−1), write m^(ed) = m·(m^(p−1))^(k(q−1)); its residue is m. If that last exponent is zero, its base is nonzero and its value is 1. The same two-case argument works modulo q.
Circle: recovered
Square: failed recovery
Tiny arithmetic keys; no secure scheme is implemented
| Message | Ciphertext | Recovered message | Messages sharing ciphertext | Recovered? |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | Yes |
| 1 | 1 | 1 | 1 | Yes |
| 2 | 8 | 2 | 1 | Yes |
| 3 | 27 | 3 | 1 | Yes |
| 4 | 31 | 4 | 1 | Yes |
| 5 | 26 | 5 | 1 | Yes |
| 6 | 18 | 6 | 1 | Yes |
| 7 | 13 | 7 | 1 | Yes |
| 8 | 17 | 8 | 1 | Yes |
| 9 | 3 | 9 | 1 | Yes |
| 10 | 10 | 10 | 1 | Yes |
| 11 | 11 | 11 | 1 | Yes |
| 12 | 12 | 12 | 1 | Yes |
| 13 | 19 | 13 | 1 | Yes |
| 14 | 5 | 14 | 1 | Yes |
| 15 | 9 | 15 | 1 | Yes |
| 16 | 4 | 16 | 1 | Yes |
| 17 | 29 | 17 | 1 | Yes |
| 18 | 24 | 18 | 1 | Yes |
| 19 | 28 | 19 | 1 | Yes |
| 20 | 14 | 20 | 1 | Yes |
| 21 | 21 | 21 | 1 | Yes |
| 22 | 22 | 22 | 1 | Yes |
| 23 | 23 | 23 | 1 | Yes |
| 24 | 30 | 24 | 1 | Yes |
| 25 | 16 | 25 | 1 | Yes |
| 26 | 20 | 26 | 1 | Yes |
| 27 | 15 | 27 | 1 | Yes |
| 28 | 7 | 28 | 1 | Yes |
| 29 | 2 | 29 | 1 | Yes |
| 30 | 6 | 30 | 1 | Yes |
| 31 | 25 | 31 | 1 | Yes |
| 32 | 32 | 32 | 1 | Yes |
| Prime | Message residue | After exponent ed | Message case |
|---|---|---|---|
| 3 | 0 | 0 | Message divisible by this prime |
| 11 | 3 | 3 | Nonzero message residue |
To combine the checks, let D = m^(ed)−m. We know p | D and q | D. Write D = pt. The distinct primes p,q are coprime, so cancellation from q | pt gives q | t. Thus pq | D, proving m^(ed) ≡ m (mod N). The two independent prime checks therefore determine the residue modulo their product.
Both the original message m and recovered representative r lie in 0,…,N−1. Congruence in that range forces equality, so r = m. It follows that encryption is a permutation of all N canonical messages: equal ciphertexts would decode to equal originals. The proof covers multiples of either prime and zero, as well as coprime messages.
In the model N = 33,e = 3,d = 7, message 3 is divisible by 3 but still returns correctly; message 11 uses the zero case modulo 11, and 0 uses both zero cases. The complete table verifies all 33 exact instances. The general proof, rather than this finite verification alone, establishes recovery for every admissible distinct-prime pair.
A collision or one failed message exposes an invalid rule
With N = 33 and e = 2, messages 1 and 32 both encrypt to 1 because 32 ≡ −1 and (−1)² = 1. Here gcd(2,20) = 2, so no inverse exponent modulo 20 exists. No decoder acting on that ciphertext alone can recover both originals.
Keeping e = 3 but choosing d = 3 gives ed = 9, which is not congruent to 1 modulo 20. Message 7 encrypts to 13 but the proposed decoder gives 13³ = 2197 ≡ 19 modulo 33. Some inputs, such as 0 or 1, still return; those successes do not establish all-message recovery.
Circle: recovered
Square: failed recovery
Tiny arithmetic keys; no secure scheme is implemented
| Message | Ciphertext | Recovered message | Messages sharing ciphertext | Recovered? |
|---|---|---|---|---|
| 0 | 0 | 0 | 3 | Yes |
| 1 | 1 | 1 | 1 | Yes |
| 2 | 5 | 5 | 1 | No |
| 3 | 0 | 0 | 3 | No |
| 4 | 7 | 7 | 1 | No |
| 5 | 2 | 2 | 1 | No |
| 6 | 0 | 0 | 3 | No |
| 7 | 4 | 4 | 1 | No |
| 8 | 8 | 8 | 1 | Yes |
| Dividend | Divisor | Quotient | Remainder | Coefficient of exponent | Coefficient of product |
|---|---|---|---|---|---|
| 4 | 5 | 0 | 4 | 0 | 1 |
| 5 | 4 | 1 | 1 | 1 | -1 |
| 4 | 1 | 4 | 0 | -4 | 5 |
| Exponent contribution | Power residue | Included? |
|---|---|---|
| 1 | 3 | Selected |
| 2 | 0 | Omitted |
| 4 | 0 | Selected |
| Exponent contribution | Power residue | Included? |
|---|---|---|
| 1 | 0 | Selected |
| Prime | Message residue | After exponent ed | Message case |
|---|---|---|---|
| 3 | 0 | 0 | Message divisible by this prime |
| 3 | 0 | 0 | Message divisible by this prime |
Distinct primes are also essential for the stated theorem. If p = q = 3, N = 9 and the copied product T = (3−1)² = 4, choosing e = 5,d = 1 gives ed ≡ 1 modulo that T. Yet message 3 encrypts to 3⁵ ≡ 0 modulo 9 and decodes to 0. The two checks modulo 3 cannot imply divisibility by 9. This example is deliberately outside the distinct-prime key definition.
A recovery proof answers one question about the system
The all-message proof establishes correctness: the intended decoding rule reverses the arithmetic map. It does not establish that an observer cannot recover the message. Knowing p,q supplies T and then d by Euclidean division. Factoring 33 is immediate, so this particular public-key example conceals nothing from someone who inspects its tiny table.
Raw exponentiation is deterministic: equal message representatives give equal ciphertexts with the same key. For a small known message set, an observer can encrypt every candidate using the public key and compare with the intercepted ciphertext. The present table is precisely such a complete comparison.
It also preserves multiplication of representatives. If c₁ ≡ m₁^e and c₂ ≡ m₂^e, then c₁c₂ ≡ (m₁m₂)^e modulo N. For our key, 2 encrypts to 8 and 3 encrypts to 27. Their ciphertext product 216 has residue 18, which is also the encryption of 6. This useful arithmetic identity is not a message-integrity guarantee.
Actual RSA encryption schemes combine the exponentiation primitive with specified message encoding and padding. For example, RSAES-OAEP includes a random seed in its encoding. This lesson implements neither that scheme nor a digital-signature protocol. Larger numbers alone would not turn its bare residue maps into a complete secure system.
Predict reversibility, then inspect every row
Compare the affine collision with the invertible affine map, then examine valid RSA arithmetic, a wrong private exponent, an even public exponent and a repeated-prime countercase. Predict whether the selected message returns and whether that result applies to every message in the table.
For the prime example, predict whether multiplication can reach zero or duplicate an output. Every displayed map lists its whole finite domain; the formulas and proofs state exactly which conclusions extend beyond those cases.
Which residue maps can be reversed?
Predict whether a complete map preserves distinct messages, and whether the stated decoding rule returns the original message. These tiny published-key examples teach exact arithmetic; their full tables are intentionally visible for inspection.
Predict recovery or a collision before revealing
Solid line: one preimage
Dashed line: shared output
Filled circle: selected input and output
The exact teaching functions bound integer magnitudes by one million, moduli by 120 and positive exponents by 1000. The fixed models use much smaller values. Complete finite cases illustrate the proofs; neither small keys nor successful recovery establish cryptographic security.
Worked examples
Undo the offset before the multiplier
Decode ciphertext 7 under y ≡ 3x+1 (mod 8).
- The multiplier inverse is 3 because 3·3 = 9 ≡ 1 modulo 8.
- First subtract the offset: 7−1 = 6.
- Multiply by the inverse: 3·6 = 18 ≡ 2 modulo 8.
- Check encryption: 3·2+1 = 7.
The unique canonical original message is 2.
An offset cannot repair colliding inputs
Show why y ≡ 2x+1 (mod 8) cannot uniquely encode all messages 0,…,7.
- The gcd of 2 and 8 is 2, so no multiplier inverse exists.
- Messages 0 and 4 are distinct canonical inputs.
- Their outputs are 1 and 9, both with canonical residue 1.
- Receiving 1 cannot distinguish those two originals; the added offset is the same in both outputs.
The map loses information and has no decoder that recovers every original.
Carry the small RSA example through both powers
Encrypt and decode message 7 with N = 33,e = 3,d = 7.
- Encrypt: 7³ = 343 ≡ 13 modulo 33.
- Square the ciphertext: 13² ≡ 4 and 13⁴ ≡ 16.
- Since 7 = 4+2+1, reduce 16·4 ≡ 31, then 31·13 ≡ 7.
- The decoded canonical representative equals the original 7; the key satisfies 3·7 = 1+20.
7 → 13 → 7. The full prime-case proof extends this recovery to all 33 messages.
Do not discard a message divisible by a prime
Why does message 3 still recover with N = 33,e = 3,d = 7?
- Modulo 3, the original and every positive power both have residue 0.
- Modulo 11, 3 is nonzero and 3^10 ≡ 1 by the locally proved prime theorem.
- Since ed = 21 = 1+2·10, 3^21 ≡ 3 modulo 11, as well as modulo 3.
- The distinct prime divisibilities combine to a multiple of 33; canonical representatives therefore agree.
The recovered message is 3. Coprimality of the message with 33 is not required.
Two copies of one prime do not supply two independent checks
Does p = q = 3,e = 5,d = 1 prove recovery modulo 9 because ed ≡ 1 modulo 4?
- The primes are equal, violating the stated key theorem.
- Although 5 ≡ 1 modulo (3−1)² = 4, message 3 has 3⁵ divisible by 9.
- Its ciphertext is 0 and decoding with exponent 1 still gives 0.
- Divisibility by 3 twice is the same condition; it does not imply divisibility by 3².
No. Message 3 is lost. The distinct-prime hypothesis cannot be dropped.
Try it yourself
Encode message 5 under y ≡ 3x+1 (mod 8), then decode the result.
Show the answer and reasoning
5 encodes to 0, and decoding gives 3(0−1) ≡ 5 modulo 8.
3·5+1 = 16 has residue 0. Negative −3 has canonical residue 5, so ciphertext zero need not mean the original was zero.
For y ≡ 2x+5 (mod 8), give two distinct messages with the same ciphertext.
Show the answer and reasoning
Messages 0 and 4 both encode to 5.
The second integer output is 2·4+5 = 13 ≡ 5. Changing the offset preserves the difference 8 between those outputs.
Explain why 1 = 7·3−20 gives d = 7 for the N = 33,e = 3 example.
Show the answer and reasoning
It gives 3·7 ≡ 1 modulo 20, where 20 = (3−1)(11−1).
The required inverse concerns the prime-decrement product, not modulus 33. The equality also verifies that 3 and 20 are coprime.
Compute the encryption of message 11 under e = 3,N = 33. Does the all-message proof apply?
Show the answer and reasoning
11 encrypts to 11 and recovers to 11. Yes, the proof includes it.
11³ = 1331 = 40·33+11. Modulo 11 the zero branch applies; modulo 3 the nonzero branch applies. A shared factor with N does not exclude the message.
Can you use the stated prime theorem to infer 2⁷ ≡ 1 modulo 8? What is its actual residue?
Show the answer and reasoning
No: 8 is composite, and 2⁷ ≡ 0 modulo 8.
The theorem requires a prime modulus and a multiplier not divisible by that prime. Replacing p with any positive integer is an unjustified change.
In the proof modulo prime p, why is cancelling F = 1·2···(p−1) justified?
Show the answer and reasoning
Every factor is nonzero modulo p and has an inverse; multiplying those inverses gives an inverse of F.
No factor is divisible by p. The cancellation is multiplication by an existing inverse, not ordinary division by a residue without a condition.
With N = 33,e = 3,d = 3, message 7 encrypts to 13. What does the proposed decoder return?
Show the answer and reasoning
It returns 19, so the message is not recovered.
13³ = 2197 = 66·33+19. Here ed = 9 is not congruent to 1 modulo 20; correct recovery of some other messages is not an all-message proof.
If distinct primes p,q both divide D, why does pq divide D?
Show the answer and reasoning
Write D = pt. Since q divides pt and p,q are coprime, cancellation gives q | t, so D is a multiple of pq.
The integer-combination cancellation proof supplies the needed step. Repeating the same prime would not satisfy the coprimality condition.
If you silently reduce original integers 7 and 40 modulo 33 before encrypting, can the decoder distinguish them?
Show the answer and reasoning
No. Both reduce to canonical representative 7 and therefore have the same ciphertext.
The all-message recovery statement concerns the stated input range 0,…,32. A separate encoding must preserve information about longer or out-of-range originals.
An observer knows that a message is one of 0,…,32 and knows the public key (33,3). Does the recovery proof prevent a candidate-table comparison?
Show the answer and reasoning
No. The observer can encrypt all 33 candidates and compare their ciphertexts.
For this admissible arithmetic key the map is a permutation, so each matching ciphertext identifies one candidate. Correctness and secrecy are different claims.
Messages 2 and 3 encrypt to 8 and 27 under N = 33,e = 3. Compare the ciphertext product with the encryption of 6.
Show the answer and reasoning
8·27 ≡ 18 modulo 33, and 6³ ≡ 18 modulo 33.
Exponentiation preserves multiplication of representatives. This identity is a property of the raw primitive, not an authentication or integrity proof.
What to carry forward
- An integer message domain and a reversible representation must be stated before arithmetic encryption can recover the original.
- An affine map is reversible exactly when its multiplier is coprime to the modulus; an offset cannot remove collisions.
- Integer combinations provide modular inverses and justified cancellation.
- Prime multiplication permutes all nonzero residues, proving the prime-exponent theorem with its conditions.
- Distinct-prime RSA arithmetic with ed ≡ 1 modulo (p−1)(q−1) recovers every canonical message, including zero and noncoprime messages.
- Repeated squaring preserves exact residues without constructing huge ordinary powers.
- Correct recovery, large numbers and raw exponentiation alone do not establish a secure encryption scheme.
References
Sources for the concepts and teaching approaches in this article.
- Criptografia · First edition, twelfth printing, 2016Severino Collier CoutinhoTextbook chapter · PDFCriptografiaModular inverses and cancellation — §§3.2–3.3Prime residue permutation proof — §5.2Why RSA recovery works — §6.3
- PKCS #1: RSA Cryptography Specifications, Version 2.2 · RFC 8017, November 2016Kathleen M. Moriarty (editor), Burt Kaliski, Jakob Jonsson, Andreas RuschTeaching resourcePKCS #1: RSA Cryptography Specifications, Version 2.2Message representatives and exponentiation — §5.1OAEP message encoding — §7.1.1