Asymmetric RSA Key Pair Generation, Web Crypto & PKCS#8 Architecture
RSA Key Pair Generator creates cryptographically secure public and private key pairs for asymmetric encryption, SSH access, and digital signatures. It utilizes the native browser Web Crypto API (SubtleCrypto) to generate 2048-bit and 4096-bit RSA keys.
Featuring instant PEM formatting (PKCS#8 for private keys, SPKI for public keys) and JWK export, this tool runs 100% in-browser, guaranteeing that your private master encryption keys never touch external servers.
البنية الأساسية والمعادلة الرياضية
RSA Algorithm: Public Key (e, n) ; Private Key (d, n) ; Encryption: C = M^e mod n ; Decryption: M = C^d mod n
Generates large probable prime numbers p and q, computes modulus n = p × q, and derives private exponent d using the Extended Euclidean Algorithm.
أفضل الممارسات والإرشادات الأساسية
- Mandate 4096-Bit Key Lengths for Long-Term Cryptographic Security: While 2048-bit RSA keys meet current baseline security standards, NIST guidelines recommend 3072-bit or 4096-bit keys for confidential data requiring protection beyond 2030 against rising computational power.
- Never Share or Expose the Private Key (id_rsa): The public key (SPKI / id_rsa.pub) is designed to be shared openly across servers and clients. The private key (PKCS#8 / id_rsa) must remain strictly confidential; anyone with access to the private key can decrypt all past communications and forge digital signatures.
- Set Restrictive Filesystem Permissions on Exported Private Keys: When saving generated private keys to Unix/Linux environments, immediately restrict file permissions using chmod 600 id_rsa. SSH and OpenSSL clients will reject private keys with permissive file permissions.
- Consider Ed25519 for Modern SSH and Digital Signatures: While RSA remains the universal legacy standard, modern cryptography favors Ed25519 (Edwards-curve Digital Signature Algorithm), which provides equivalent security to a 3072-bit RSA key with dramatically smaller 68-character keys and faster signing.