{"id":50486924,"url":"https://github.com/systemslibrarian/crypto-lab-rsa-forge","last_synced_at":"2026-06-01T23:02:53.110Z","repository":{"id":349825861,"uuid":"1204052139","full_name":"systemslibrarian/crypto-lab-rsa-forge","owner":"systemslibrarian","description":"Browser-based RSA demo — textbook RSA, OAEP, PSS signatures, and live attacks including small exponent, Bleichenbacher PKCS#1 v1.5 oracle, and padding oracle. Real WebCrypto operations. No backends. No simulated math.","archived":false,"fork":false,"pushed_at":"2026-04-07T17:31:25.000Z","size":11203,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-07T19:22:14.834Z","etag":null,"topics":["asymmetric-encryption","attacks","bleichenbacher","browser","crypto-lab","cryptography","padding-oracle","pkcs1","post-quantum","public-key-cryptography","rsa","rsa-oaep","rsa-pss","typescript","vite"],"latest_commit_sha":null,"homepage":"https://systemslibrarian.github.io/crypto-lab-rsa-forge/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/systemslibrarian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-07T16:37:59.000Z","updated_at":"2026-04-07T17:31:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/systemslibrarian/crypto-lab-rsa-forge","commit_stats":null,"previous_names":["systemslibrarian/crypto-lab-rsa-forge"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/systemslibrarian/crypto-lab-rsa-forge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-rsa-forge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-rsa-forge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-rsa-forge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-rsa-forge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/systemslibrarian","download_url":"https://codeload.github.com/systemslibrarian/crypto-lab-rsa-forge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-rsa-forge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33797128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asymmetric-encryption","attacks","bleichenbacher","browser","crypto-lab","cryptography","padding-oracle","pkcs1","post-quantum","public-key-cryptography","rsa","rsa-oaep","rsa-pss","typescript","vite"],"created_at":"2026-06-01T23:02:52.450Z","updated_at":"2026-06-01T23:02:53.105Z","avatar_url":"https://github.com/systemslibrarian.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crypto-lab-rsa-forge\n\n[![Live Demo](https://img.shields.io/badge/Live%20Demo-GitHub%20Pages-blue?style=for-the-badge)](https://systemslibrarian.github.io/crypto-lab-rsa-forge/)\n[![RSA-2048](https://img.shields.io/badge/RSA--2048-WebCrypto-navy?style=flat-square)](https://www.w3.org/TR/WebCryptoAPI/)\n[![RSA-4096](https://img.shields.io/badge/RSA--4096-WebCrypto-navy?style=flat-square)](https://www.w3.org/TR/WebCryptoAPI/)\n[![OAEP](https://img.shields.io/badge/OAEP-RFC%208017-teal?style=flat-square)](https://www.rfc-editor.org/rfc/rfc8017)\n[![PSS](https://img.shields.io/badge/PSS-RFC%208017-teal?style=flat-square)](https://www.rfc-editor.org/rfc/rfc8017)\n[![PKCS#1 v1.5](https://img.shields.io/badge/PKCS%231%20v1.5-LEGACY-orange?style=flat-square)](https://www.rfc-editor.org/rfc/rfc8017)\n\n---\n\n## What It Is\n\nRSA Forge is a browser-based interactive demonstration of RSA encryption, signatures, and real attack vectors. It covers textbook RSA (raw BigInt modular exponentiation), RSA-OAEP-SHA-256 encryption (RFC 8017 §7.1), RSA-PSS-SHA-256 signatures (RFC 8017 §8.1), Håstad's broadcast attack on small-exponent unpadded RSA, and Bleichenbacher's adaptive chosen-ciphertext attack on PKCS#1 v1.5 padding oracles. RSA is an asymmetric (public-key) cryptosystem — security rests on the hardness of integer factorization. All operations run entirely in the browser using the WebCrypto API for real 2048/4096-bit keys and native JavaScript BigInt for textbook arithmetic; there is no backend.\n\n## When to Use It\n\n- **Encrypting data for a single recipient over an untrusted channel** — RSA-OAEP provides IND-CCA2 security, meaning ciphertexts are non-malleable and semantically secure under chosen-ciphertext attack.\n- **Signing data to prove authenticity and integrity** — RSA-PSS provides a tight security reduction to the RSA problem in the random oracle model, making it the preferred RSA signature scheme for new systems.\n- **Wrapping symmetric keys for hybrid encryption** — RSA-OAEP is commonly used to transport an AES session key, since RSA plaintext is limited to modulus size minus padding overhead (k − 66 bytes for SHA-256).\n- **Legacy interoperability with systems that require RSA** — many existing protocols (TLS certificate signatures, S/MIME, PKCS#12) still mandate RSA support.\n- **Do NOT use RSA when post-quantum security is required** — Shor's algorithm breaks all RSA key sizes in polynomial time on a fault-tolerant quantum computer. Use ML-KEM (FIPS 203) for key encapsulation or ML-DSA (FIPS 204) for signatures instead.\n\n## Live Demo\n\n🔗 **https://systemslibrarian.github.io/crypto-lab-rsa-forge/**\n\nThe demo has six tabbed panels. You can generate real RSA key pairs (small or 2048/4096-bit), encrypt and decrypt messages with textbook RSA or RSA-OAEP, sign and verify with RSA-PSS, run a live Håstad broadcast attack that recovers plaintext via CRT and cube root, and execute a real Bleichenbacher PKCS#1 v1.5 padding oracle attack on 128-bit RSA. Controls include key size selection (32-bit primes, 2048-bit, 4096-bit), plaintext input, and attack abort.\n\n## What Can Go Wrong\n\n- **Using textbook RSA without padding** — textbook RSA is deterministic: the same plaintext always produces the same ciphertext, enabling chosen-plaintext attacks and the homomorphic property (c₁·c₂ = Enc(m₁·m₂)).\n- **Small public exponent without OAEP** — with e=3 and no padding, intercepting the same message sent to three recipients allows immediate recovery via the Chinese Remainder Theorem and integer cube root (Håstad 1988).\n- **PKCS#1 v1.5 encryption padding oracle** — any system that distinguishes PKCS#1 v1.5 padding errors from other decryption errors leaks a one-bit oracle, enabling Bleichenbacher's adaptive chosen-ciphertext attack to recover the full plaintext (Bleichenbacher 1998). The ROBOT attack (2017) found 8 major TLS implementations still vulnerable 19 years later.\n- **Insufficient key size** — RSA-1024 is considered factored-equivalent in capability for well-funded adversaries. NIST SP 800-57 requires 2048-bit minimum; 3072-bit or larger for data protected beyond 2030.\n- **No forward secrecy in RSA key exchange** — TLS 1.3 removed RSA key exchange entirely because compromise of the server's long-term RSA private key retroactively decrypts all past sessions. Use ephemeral ECDHE instead.\n\n## Real-World Usage\n\n- **TLS certificates** — the majority of HTTPS certificates on the public internet use RSA-2048 or RSA-4096 keys for the certificate's public key, with signatures using RSASSA-PKCS1-v1_5 or RSASSA-PSS.\n- **SSH authentication** — OpenSSH uses RSA key pairs (typically 3072-bit or 4096-bit) for client and host authentication, with `rsa-sha2-256` and `rsa-sha2-512` signature algorithms.\n- **S/MIME email encryption** — RFC 8551 uses RSA-OAEP to wrap per-message content-encryption keys, providing end-to-end encrypted email in enterprise environments.\n- **Code signing** — Windows Authenticode, macOS codesign, and Java JAR signing all support RSA signatures to verify that binaries have not been tampered with.\n- **JSON Web Tokens (JWT)** — the `RS256`, `RS384`, and `RS512` algorithms in RFC 7518 use RSASSA-PKCS1-v1_5 signatures; `PS256`, `PS384`, `PS512` use RSASSA-PSS.\n\n---\n\n## Running Locally\n\n```bash\ngit clone https://github.com/systemslibrarian/crypto-lab-rsa-forge.git\ncd crypto-lab-rsa-forge\nnpm install\nnpm run dev\n```\n\nOpen http://localhost:5173/crypto-lab-rsa-forge/ in your browser.\n\n### Build for production\n\n```bash\nnpm run build\n```\n\nOutput is in `dist/`.\n\n### Deploy to GitHub Pages\n\n```bash\nnpm run deploy\n```\n\nRequires `gh-pages` package and appropriate GitHub repository permissions.\n\n---\n\n## Related Demos\n\n- **[crypto-lab-kyber-vault](https://systemslibrarian.github.io/crypto-lab-kyber-vault/)** — ML-KEM-768 (FIPS 203): the RSA replacement\n- **[crypto-lab-iron-letter](https://systemslibrarian.github.io/crypto-lab-iron-letter/)** — AES-GCM and ChaCha20-Poly1305 symmetric encryption\n- **[crypto-lab-dilithium-seal](https://systemslibrarian.github.io/crypto-lab-dilithium-seal/)** — ML-DSA-65 (FIPS 204): post-quantum digital signatures\n- **[crypto-compare](https://systemslibrarian.github.io/crypto-compare/#asymmetric)** — Side-by-side algorithm comparison\n- **[Crypto Lab](https://systemslibrarian.github.io/)** — Full collection of interactive cryptography demos\n\n---\n\n\u003e *\"So whether you eat or drink or whatever you do, do it all for the glory of God.\" — 1 Corinthians 10:31*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-rsa-forge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-rsa-forge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-rsa-forge/lists"}