DevToys Web Pro

free web developer tools

Blog
Rate us:
Try browser extension:

RSA Key Pair Generator

Configuration

  • Key SizeRSA key modulus length in bits
  • Hash AlgorithmHash algorithm used with RSA-OAEP

Public Key (SPKI PEM)

  • Private Key (PKCS#8 PEM)

  • Technical details

    How the RSA Key Pair Generator Works

    What the Tool Does

    This RSA key pair generator creates public and private keys using the Web Crypto API directly in your browser. It supports key sizes of 2048, 3072, and 4096 bits with SHA-256, SHA-384, or SHA-512 hash algorithms. The public key is exported in SPKI PEM format and the private key in PKCS#8 PEM format, both compatible with OpenSSL and most cryptographic libraries. No data is sent to any server — all key generation happens locally.

    Common Developer Use Cases

    Developers use this tool to quickly generate RSA key pairs for testing encryption workflows, setting up JWT RS256 signing, configuring TLS/SSL certificates, and prototyping secure communication between services. It is useful when you need a disposable key pair for development environments, CI/CD pipelines, or learning about public-key cryptography without installing OpenSSL.

    Key Sizes and Hash Algorithms

    RSA 2048-bit keys are widely used and considered secure for most applications. RSA 3072-bit keys offer a higher security margin and are recommended by NIST for protection beyond 2030. RSA 4096-bit keys provide maximum security but take longer to generate and process. The hash algorithm (SHA-256, SHA-384, SHA-512) is used with RSA-OAEP for encryption operations and does not affect the key format.

    PEM Format and Compatibility

    The generated keys use standard PEM encoding with 64-character line wrapping per RFC 7468. The public key uses the SPKI (Subject Public Key Info) format, while the private key uses PKCS#8 format. These are compatible with OpenSSL, Node.js crypto, Java KeyFactory, Python cryptography, and most other libraries. You can save the keys as .pem files and use them directly in your applications.

    When to Use This Tool vs Code

    Use this generator for quick key generation during development, testing, and learning. For production systems, generate RSA keys using your platform's crypto library or OpenSSL command-line tools to ensure proper key storage, access control, and rotation policies. Never use keys generated in the browser for production security — always follow your organization's key management practices.