What is an RSA Key Pair?
RSA (Rivest–Shamir–Adleman) is one of the first public-key cryptosystems and is widely used for secure data transmission. Unlike symmetric encryption algorithms which use the same key for encryption and decryption, RSA relies on an asymmetric key pair:
- Public Key: Can be shared with anyone. It is used to encrypt data or verify a digital signature generated by the corresponding private key.
- Private Key: Must be kept secret. It is used to decrypt data that was encrypted with the public key, or to generate digital signatures.
The security of RSA relies on the mathematical difficulty of factoring the product of two large prime numbers. A key length of 2048 bits is currently the industry standard for secure communication, offering a strong balance between computational overhead and cryptographic strength.
Key Features and Settings
This tool provides a local, secure sandbox to generate asymmetric key pairs:
- Algorithm & Strength: Automatically generates a 2048-bit RSA key pair using the standard Web Crypto API (
RSASSA-PKCS1-v1_5with a public exponent of65537and SHA-256 hashing). - Public Key (PEM format): Generates a standard SubjectPublicKeyInfo (
spki) format key enclosed in-----BEGIN PUBLIC KEY-----and-----END PUBLIC KEY-----blocks, wrapped to 64 characters per line. - Private Key (PEM format): Generates a standard PKCS#8 (
pkcs8) format key enclosed in-----BEGIN PRIVATE KEY-----and-----END PRIVATE KEY-----blocks, wrapped to 64 characters per line. - Client-Side Generation: Since it utilizes
window.crypto.subtle, all key generation logic runs entirely inside your browser’s local context. Your private key is never transmitted over the internet or sent to a remote server. - Separate Key Copying: Independent Copy buttons for the public and private keys allow you to capture exactly the key you need.
Real-World Use Cases
- SSH Authentication: Generating key pairs to configure passwordless login to remote Linux servers, copying the public key to
~/.ssh/authorized_keysand keeping the private key locally. - Secure Email (PGP/MIME): Encrypting email communication or files where users encrypt messages using a recipient’s public key, ensuring only the recipient can decrypt it with their private key.
- JSON Web Tokens (JWT) Signing: Configuring asymmetric token signatures (like
RS256), where the auth server signs JWTs using the private key, and external microservices verify the token integrity using the public key.
Step-by-Step Guide to Using the RSA Key Pair Generator
- Generate the Key Pair: Click the Generate RSA 2048-bit Key Pair button at the top of the interface.
- Observe Key Rendering: Wait a brief moment. The tool will calculate the mathematical prime components and render the formatted PEM strings inside the textareas.
- Copy the Public Key: Click the Copy button inside the Public Key (PEM format) card header.
- Copy the Private Key: Click the Copy button inside the Private Key (PEM format) card header.
- Apply Keys: Paste these keys into your config files, SSH folders, or developer credentials vault as required.