Advanced › Module 5 › Lesson 2
RSA Toy Named
RSA toy literacy uses tiny educational primes in YOUR $CRYPTO_LAB — never factor or break production RSA keys.
Visual · t28_rsa_toy_named
RSA toy literacy. $CRYPTO_LAB only. Original Cyberlium.
Opening
p=61 q=53 teaches the math — production RSA-2048 stays off limits for factorization play.
RSA toy examples use small primes (e.g., p=61, q=53, n=3233) to show key generation, φ(n), public e, private d, encrypt/decrypt on single letters or short strings. Educational openssl genrsa demos use proper key sizes for format literacy — but Cyberlium refuses NFS/factor attacks on captured production moduli. Cyberlium practices RSA toy math on YOUR $CRYPTO_LAB worksheets and labeled crackmes — never break real TLS certificates or wallet keys. Next: openssl CLI.
1. RSA toy math (named, small numbers only)
Generate primes p, q; n=p×q; φ(n)=(p-1)(q-1); choose e coprime to φ(n); find d where e×d≡1 mod φ(n). Encrypt m: c=m^e mod n; decrypt: m=c^d mod n — on toy n only.
On $CRYPTO_LAB, compute one toy keypair on paper or script with primes under 100 — label 'EDUCATIONAL TOY ONLY.'
Command guide
Try these commands — RSA toy math (named, small numbers only)
═══ TOOLS & WEBSITES ═══ Browse / read these (authorized learning only — stay in YOUR lab / program scope)
AES modes — https://csrc.nist.gov/publications/detail/sp/800-38a/final (ECB/CBC literacy)
Optional command
OpenSSL enc — https://www.openssl.org/docs/manmaster/man1/openssl-enc.html
CWE-649 — https://cwe.mitre.org/data/definitions/649.html
═══ INSTALL ═══
Linux (Debian/Ubuntu):
Command — copy this
sudo apt install python3
macOS:
Command — copy this
brew install python3
Windows: Download https://python.org/downloads/
═══ LINUX / macOS ═══
Command — copy this
export CRYPTO_LAB=${CRYPTO_LAB:-$HOME/cyberlium-lab/t28-crypto}
cat > "$CRYPTO_LAB/notes/aes-modes-literacy.txt" <<'EOF'
ECB: identical blocks → identical ciphertext (pattern leakage — avoid for data)
CBC: needs random IV; chaining hides patterns — watch padding oracle concept
GCM: AEAD — confidentiality + integrity (TLS 1.3 preferred mode literacy)
lab: openssl enc -aes-256-cbc -pbkdf2 on YOUR demo.txt only
never: ECB-encrypt production secrets; never padding-oracle live sites
EOFCommand — copy this
grep -E 'ECB|CBC|GCM|never' "$CRYPTO_LAB/notes/aes-modes-literacy.txt"
python3 -c "print('AES modes literacy — use GCM/AEAD in modern apps')"Primary tools to practice this lesson: grep, python3. Reference sites: AES modes (https://csrc.nist.gov/publications/detail/sp/800-38a/final); OpenSSL enc (https://www.openssl.org/docs/manmaster/man1/openssl-enc.html); CWE-649 (https://cwe.mitre.org/data/definitions/649.html). Run every command in the box — install first, then the usage lines — only on YOUR lab / program scope.
2. Production RSA vs toy
Production uses 2048+ bit moduli, OAEP/PSS padding, HSM storage — factorization infeasible. Toy n breaks with grade-school math — purpose is concept literacy, not attack template for live keys.
Defenders monitor key length deprecation and weak padding — students write tickets, not factorization farms.
3. Explicit refusal boundary
Forbidden: factoring scraped production moduli, sharing private keys, running general number field sieve on stranger certs. Allowed: RSA toy card — sample p/q/n, one encrypt/decrypt step, refusal sentence for production breaks.
Ship: RSA toy card for $CRYPTO_LAB. Next: openssl CLI.
4. What you ship: RSA toy card for $CRYPTO_LAB
Toy p/q/n, one encrypt/decrypt example, EDUCATIONAL label, refusal sentence. $CRYPTO_LAB named. chmod 600.
5. What you record before the next lesson
Date. RSA toy card. $CRYPTO_LAB named. File t28-m05-l02-rsa-toy-named.txt chmod 600.
6. Wrong vs right: prod crypto oracles vs CTF toys
Worked failure — same MSF word, opposite target. Right never needs a café Wi-Fi or classmate laptop.
Wrong
Factor production RSA-2048 for CTF credit. Paste TLS private keys in notes.
Right
Write RSA toy card with small educational numbers for YOUR $CRYPTO_LAB. Next: openssl CLI.
Mission: compute YOUR RSA toy keypair
1) Pick toy primes p and q under 100. 2) Compute n and φ(n). 3) Encrypt/decrypt one letter mod n. 4) Label EDUCATIONAL TOY ONLY; chmod 600.
Stuck? Ask Cyberlium AI Mentor
If n has more than three digits in lab, confirm it is still YOUR toy — not a scraped cert modulus.
Knowledge Check
APPLY: RSA toy on Cyberlium means:
Multiple choice
Knowledge Check
APPLY: True or False: Cyberlium refuses RSA factorization attacks on production keys.
True or False
Knowledge Check
APPLY: Production RSA should use:
Multiple choice