RSA Key Pair Generator and the Web Crypto API
An RSA (Rivest-Shamir-Adleman) key pair consists of a public key, which can be shared openly to encrypt messages or verify signatures, and a private key, which must be kept secret to decrypt messages or create signatures. RSA is an asymmetric cryptographic algorithm foundational to much of the secure communication on the internet today, including HTTPS, secure email, and digital certificates.
This RSA Key Pair Generator allows you to create secure cryptographic keys directly within your browser. By selecting different key sizesβsuch as 1024-bit (generally considered weak but sometimes needed for legacy systems), 2048-bit (the current standard for many applications), or 4096-bit (for highly sensitive data and long-term security)βyou can tailor the generated keys to your specific security requirements and performance constraints. Larger keys provide stronger security but require more computational power to generate and use.
The tool utilizes the window.crypto.subtle API, commonly known as the Web Crypto API. This is a low-level cryptographic interface provided by modern web browsers that gives developers access to native, high-performance cryptographic operations without external dependencies. When you click generate, the application requests the browser to create an RSA-OAEP (Optimal Asymmetric Encryption Padding) key pair using the specified modulus length (key size) and a secure public exponent (usually 65537). OAEP is a padding scheme that adds an element of randomness to the encryption process, preventing certain types of cryptographic attacks and making the RSA algorithm much more robust against chosen-ciphertext attacks.
Once the Web Crypto API generates the keys in its internal format, this tool exports them to standardized formats. The public key is exported using the SPKI (Subject Public Key Info) format, and the private key uses the PKCS #8 (Public-Key Cryptography Standards) format. These raw binary formats are then encoded into Base64 and wrapped with standard header and footer lines to create PEM (Privacy-Enhanced Mail) files. PEM is the most widely adopted format for distributing cryptographic keys and certificates, instantly recognizable by its -----BEGIN... and -----END... ASCII markers.
One of the most critical aspects of this tool is that it operates 100% client-side. All key generation, formatting, and processing occur entirely on your device, within the secure sandbox of your web browser. The private key never leaves your computer, and no data is ever transmitted to an external server or network. This client-side architecture is vastly safer than relying on server-side key generation services, which require you to trust that the server is not secretly saving a copy of your highly sensitive private key. By generating the keys locally, you maintain absolute control and cryptographic sovereignty over your secrets.