Meaning and conditions
Only two fixed insecure teaching keys:1 with p 5,q 11,n 55,e 3,d 27;2 with p 7,q 11,n 77,e 7,d 43. Messages are integers 0≤m<n. No text encoder, production key generation or complete secure encryption scheme.[1][2]
Two powers under a valid teaching key pair.[1]
RSAEP and RSADP operate on integer representatives. A complete scheme such as RSAES-OAEP adds specified encoding. Raw exponentiation does not replace those steps.[1]
Step-by-step reasoning
Condition ed=1+k(p−1)(q−1) gives m^ed≡m modulo p and modulo q. If m is divisible by either prime, the corresponding statement follows from zero residues; otherwise Fermat’s little theorem applies. Since p and q are distinct, the two congruences determine the same residue modulo n=pq. Thus recovery holds for every allowed representative, not only values coprime to n.[2]
Binary exponentiation preserves the target product’s residue: if the current exponent is odd, multiply the base into the accumulator; then square the base and halve the exponent using integer division. Modular reduction after each product preserves the residue class.[2]
Residues under repeated squaring
Residues under repeated squaring
Free with a Quanta account. Your download stays ready after registration.
Two fully worked original examples
Teaching modulus 55: encrypt and recover 7
- Given
- p=5,q=11,n=55,φ(n)=40,e=3,d=27,m=7.
- Find
- Check the teaching key and calculate both directions.
e and d are inverses modulo 40.
The message satisfies 0≤m<55.
Square and reduce after each step.
Multiply only powers indicated by set exponent bits.
Result: 7→13→7. The teaching key pair inverts modular exponentiation.
Check: Intermediate residues: 31·36≡16,16·4≡9,9·13≡7 mod 55. Original and recovered messages agree.
Second fixed teaching modulus 77
- Given
- p=7,q=11,n=77,φ(n)=60,e=7,d=43,m=9.
- Find
- Compute ciphertext and recovery using small intermediate residues.
The key condition holds.
7=4+2+1; reduce after every product.
Values correspond to k=0,1,2,3,4,5.
Multiply residues of the selected powers.
Result: 9→37→9 with n=77.
Check: Every intermediate residue remains between 0 and 76. Recovery returns the original message 9.
Recall the method later with the formula’s flashcards.
10 flashcards · English materials
Already have an account? Sign in for flashcardsAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Five exercises with solutions
Calculate · Foundation
Encrypt m=8 using teaching key n=55,e=3.
Show hint
Take the third power and reduce modulo 55.
Learning goal: Calculate a modular power and check the residue range.
Rearrange · Application
For p=5,q=11,e=3, find positive d<40 such that ed≡1 mod 40.
Show hint
Find a modular inverse rather than an ordinary fraction.
Learning goal: Determine the private teaching exponent as a modular inverse.
Interpret · Foundation
May teaching key 1 accept message 55? What about 0?
Show hint
The representative must satisfy 0≤m<n.
Learning goal: Distinguish the input range from modular arithmetic.
Error analysis · Application
A solution computes ciphertext for m=7,e=3,n=55 as 7·3 mod 55=21. Locate the error.
Show hint
The exponent does not mean multiplying plaintext by the key.
Learning goal: Interpret exponentiation correctly before modular reduction.
Transfer · Application
Two identical messages 7 are encrypted with the same teaching key 55,3. What is observed and why is this not a secure general message scheme?
Show hint
Raw modular exponentiation is deterministic.
Learning goal: Separate mathematical reversibility from a secure encryption scheme.
Show solution and calculation
Both ciphertexts are 13.
Equal representatives remain recognizable, and tiny factors 5 and 11 are obvious.
This calculation demonstrates only the primitive power.
Complete RSA encryption schemes use additional encoding such as OAEP and appropriate real keys; the teaching calculator does not implement them.
Check your understanding with the formula’s reference test.
8 test questions · English materials
Already have an account? Sign in for the testAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Model limits and next steps
Tiny teaching keys are intentionally insecure. Deterministic textbook RSA calculations establish no security properties of a complete encryption scheme. The model calls no services and processes only the small supplied integers.[1]
The Euclidean algorithm finds suitable inverses. Exponent laws explain exponent decomposition; Diffie–Hellman introduces a different modular protocol idea.
Sources for this explanation
Quanta · Updated November 9, 2026
- IETF RFC8017: PKCS#1 v2.2 — §5.1.1 RSAEP; §5.1.2 RSADP; §7.1 RSAES-OAEP
- University of Münster: the RSA method in school computer science, section 6; especially 6.3.3 Fast modular exponentiation using square-and-multiply, PDF p. 36 (translated source label)
Editorial responsibility: Quanta Study editorial team
Review scope
This explanation, 2 worked examples and 5 exercises are available in German and English. Structure, source references and mathematical notation undergo automated checks. Calculations, model assumptions and both language versions receive a separate AI review.
An independent, named human subject review has not yet been documented. Our exercise numbers are worked examples, rather than measurements published by the cited sources.
Editorial responsibility, sources and methodsChange history
- Created a DE/EN author draft with a bounded model, original graphic, two examples and varied solved exercises.
Cite this reference page
Quanta. RSA encryption: modular exponentiation. Updated November 9, 2026. https://quanta-study.de/en/formula-sheet/rsa-modulare-potenz
When citing a specific scientific statement, also cite the specialist source linked to that statement.