Choose 2048-bit or 4096-bit key strength
Click Generate to create RSA key pair
Save private and public keys securely
RSA (Rivest-Shamir-Adleman) is a public-key cryptosystem widely used for secure data transmission. It uses a pair of keys: a public key for encryption and a private key for decryption. The public key can be shared freely, while the private key must be kept secret. RSA is fundamental to modern internet security, used in SSL/TLS, SSH, email encryption, and digital signatures.
RSA key pairs consist of two mathematically related keys. Data encrypted with the public key can only be decrypted with the corresponding private key, and vice versa. This asymmetric encryption enables secure communication without sharing secret keys beforehand.
-----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEA... (Base64 encoded data) -----END RSA PRIVATE KEY----- -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA... -----END PUBLIC KEY-----
Select 2048-bit for standard security (recommended for most uses) or 4096-bit for enhanced security. Larger keys are more secure but slower to generate and use. 2048-bit keys are currently considered secure for most applications.
Click "Generate RSA Keys" to create a new key pair. Generation happens entirely in your browser using cryptographically secure random number generation. No keys are transmitted to any server.
Download both keys immediately. Store the private key in a secure location with restricted access. The public key can be shared freely. Never commit private keys to version control or share them via insecure channels.
Use the public key for encryption or signature verification. Use the private key for decryption or signing. Common uses include SSH authentication, SSL/TLS certificates, and encrypted communication.
Use RSA keys for passwordless SSH login to servers. Add your public key to ~/.ssh/authorized_keys on the server. Use the private key to authenticate without entering passwords.
Generate RSA keys for SSL/TLS certificates. The private key stays on your server, while the public key is included in the certificate signed by a Certificate Authority.
Sign software releases with your private key. Users verify signatures with your public key, ensuring the software hasn't been tampered with and comes from you.
Use RSA keys for email encryption with PGP or GPG. Share your public key so others can send you encrypted emails that only you can decrypt with your private key.
Some APIs use RSA keys for authentication. Generate a key pair, register the public key with the API provider, and use the private key to sign requests.
# Add public key to server cat id_rsa.pub >> ~/.ssh/authorized_keys # Set correct permissions chmod 600 ~/.ssh/authorized_keys # Connect using private key ssh -i id_rsa user@server.com
# Encrypt file openssl rsautl -encrypt -pubin -inkey public.pem \ -in file.txt -out file.enc # Decrypt file with private key openssl rsautl -decrypt -inkey private.pem \ -in file.enc -out file.txt
# Sign data with private key openssl dgst -sha256 -sign private.pem \ -out signature.bin data.txt # Verify signature with public key openssl dgst -sha256 -verify public.pem \ -signature signature.bin data.txt
# Extract public key from private key openssl rsa -in private.pem -pubout -out public.pem # View key details openssl rsa -in private.pem -text -noout
# Convert to PKCS#8 format openssl pkcs8 -topk8 -inform PEM -outform PEM \ -in private.pem -out private_pkcs8.pem -nocrypt # Convert to SSH format ssh-keygen -f public.pem -i -m PKCS8
Explore our other security and encryption tools:
Get $200 free DigitalOcean credit or sponsor us on GitHub!