About rsa key generator
RSA is a public-key system. You keep the private key secret and share the public key, which anyone can use to encrypt data to you or to verify your signatures.
Key sizes
- 2048 bits: the usual minimum today.
- 3072 bits: a stronger option for long-lived keys.
- 4096 bits: strongest here but slower to generate and use.
Handling the private key
Never share it, commit it to a repository or paste it into chat. Store it with restricted permissions. Larger keys take longer to generate in the browser.
Handle real secrets with care
Keep production keys and secrets in a secrets manager or environment variables, never in source code or chat messages, and rotate them if they may have leaked.
A worked example
A 2048-bit key pair produces a PEM private key starting with -----BEGIN PRIVATE KEY----- and a public key starting with -----BEGIN PUBLIC KEY-----. You share the public key, for example with a service that must verify your signatures, and you keep the private one secret.
Good practice
- Use a key only for the purpose you created it for.
- Prefer a hardware key or a secrets manager for production keys.
- Consider Ed25519 or ECDSA keys where supported, since they are smaller and faster.
