What a key pair is
RSA is asymmetric cryptography: you generate a mathematically linked public and private key. The public key can be shared freely — others use it to encrypt data to you or to verify your signatures. The private key stays secret — you use it to decrypt or to sign. The security rests on the fact that deriving the private key from the public one requires factoring an enormous number, which is computationally infeasible. This tool generates the pair using the browser’s Web Crypto API, backed by the OS’s cryptographically secure RNG — the same randomness source production tools rely on.
Where these keys are used
| Use | Role of the keys |
|---|---|
| TLS/SSL certificates | Server identity + key exchange |
| SSH authentication | Prove identity to a server (Ed25519 preferred) |
| JWT signing (RS256) | Sign tokens with private, verify with public |
| Code/document signing | Authenticity + integrity |
Formats and compatibility
Keys are output in PEM — the Base64 text format wrapped in -----BEGIN…----- headers, the most portable representation. Specifically, this tool emits SPKI for the public key and PKCS#8 for the private key, which modern OpenSSL, SSH (7.8+), and JWT libraries accept directly. If an older app rejects the key, it may expect the legacy PKCS#1 format (BEGIN RSA PRIVATE KEY); convert with openssl rsa -in key.pem -traditional. For SSH’s OpenSSH public-key format, run ssh-keygen -i -m PKCS8 -f public.pem.
Guard the private key
The entire security model collapses if the private key leaks — anyone holding it can impersonate you and decrypt your data. Never paste a private key into untrusted sites, commit it to a repo, or send it over chat/email. This generator runs entirely in your browser (verify by going offline — it still works), so keys are created locally and never transmitted. For development and learning that’s ideal; for high-value production keys, generate them in a controlled environment with proper key management and storage. The Bcrypt and HMAC tools cover the symmetric side of crypto.