Developer

Gerador de par de chaves RSA

Gere pares de chaves RSA públicas e privadas seguras (até 4.096 bits) inteiramente em seu navegador. Ele roda inteiramente no seu navegador — nenhum dado é enviado para nenhum servidor, nenhuma conta é necessária e é totalmente gratuito.

Security Note: These keys are generated securely entirely within your browser using the WebCrypto API. They are never transmitted over the internet or stored on our servers.

The Definitive Guide to RSA Cryptography: Mathematics, Key Formats, and Security Standards

Rivest–Shamir–Adleman (RSA) is an asymmetric public-key cryptosystem developed in 1977 that remains one of the foundational security protocols powering modern digital communication. From securing HTTPS traffic via Transport Layer Security (TLS/SSL) to authenticating developer access over SSH and signing JSON Web Tokens (JWTs), RSA key pairs provide non-repudiation, identity verification, and confidential data transmission.

Our free RSA Key Generator uses your web browser's native, cryptographically secure Web Crypto API (window.crypto.subtle). Key generation happens 100% locally in hardware-accelerated memory; your private keys never leave your browser and are never transmitted over the internet or logged to any server.


Cryptographic Key Strength & NIST Security Comparison

The table below summarizes standard RSA key sizes, their estimated equivalent symmetric encryption strength according to the National Institute of Standards and Technology (NIST SP 800-57), and their current production status.

Key Size (Modulus) Equivalent Symmetric Strength NIST Status Primary Use Cases Performance Cost
1024-bit 80 bits DEPRECATED & INSECURE Legacy backward compatibility only (Do NOT use) Very Fast
2048-bit 112 bits STANDARD (Recommended) SSH keys, standard TLS certificates, RS256 JWT tokens Baseline (~1.0×)
3072-bit 128 bits (AES-128 equivalent) RECOMMENDED FOR LONG-TERM Enterprise CA roots, long-term confidential archiving ~2.5× slower
4096-bit 140+ bits MAXIMUM SECURITY PGP / GPG master identities, high-security government PKI ~4.5× slower

The Mathematical Foundation of RSA

The mathematical security of RSA relies on the computational difficulty of the Integer Factorization Problem: multiplying two large prime numbers is computationally trivial, but discovering those original primes given only their product is practically impossible within a reasonable timeframe using classical computers.

  1. Key Generation: Two distinct large prime numbers p and q are chosen randomly. Their product is the modulus n = p × q.
  2. Euler's Totient Function: Compute φ(n) = (p − 1) × (q − 1).
  3. Public Exponent: Choose an integer e such that 1 < e < φ(n) and gcd(e, φ(n)) = 1. Almost all modern implementations use the Fermat prime 65537 (0x10001) because it provides optimal verification speed without compromising security.
  4. Private Exponent: Compute d as the modular multiplicative inverse of e modulo φ(n), such that (d × e) ≡ 1 (mod φ(n)).

The Public Key consists of the pair (n, e). The Private Key consists of (n, d) (along with components p, q, dp, dq, qinv for Chinese Remainder Theorem acceleration).


Understanding PEM Key Formats (PKCS#1 vs. PKCS#8)

Cryptographic keys are stored as Base64-encoded ASN.1 structures enclosed by ASCII header and footer banners (Privacy Enhanced Mail - PEM format):

Header Banner Standard Description
-----BEGIN RSA PRIVATE KEY----- PKCS#1 Traditional format containing raw RSA private key parameters only.
-----BEGIN PRIVATE KEY----- PKCS#8 (Modern Standard) Universal container format that includes an algorithm identifier OID (used by WebCrypto, Node.js, and Java).
-----BEGIN PUBLIC KEY----- SPKI (X.509) Standard SubjectPublicKeyInfo format for sharing public keys across platforms.

Essential Security Best Practices for RSA Private Keys

  • Restrict File Permissions: On Unix and macOS servers, always secure private keys with chmod 600 id_rsa so only the owner has read access.
  • Never Commit to Git: Ensure *.pem, *.key, and id_rsa* patterns are included in your project's .gitignore.
  • Use Passphrase Encryption: Protect private keys at rest with AES-256 passphrase encryption (e.g. ssh-keygen -p -f id_rsa).
  • Enforce Regular Key Rotation: Rotate enterprise TLS and JWT signing keys on a scheduled 90-day to 1-year cycle.

Use our client-side RSA Key Generator above whenever you need instant, cryptographically sound keys for local development, API prototyping, or cryptographic demonstrations without exposing secrets to third-party networks.

Compartilhar:

From the Blog

Why Client-Side Web Utilities are Superior for Privacy and Data Security →

Deep dive into related concepts, tutorials, and best practices.