Rsa Pair Key Generator
Fast, accurate and free online rsa key pair generator tool running directly in your browser.
-
1Enter data
Enter content, paste text or load a file from disk. -
2Click the button
The tool will immediately process your data in the browser. -
3Get the result
Copy the finished text or save the file to your device.
return "Result ready in 0.1s";
}
Rate this tool:
Related tools
Other tools you may find usefulRSA Key Pair Generator - Mathematical foundations and roles in cryptography
Asymmetric cryptography is the foundation of security on the Internet. The HTTPS protocol securing banking transactions, SSH connections used for server administration, and SSL certificates - all these technologies are based on public key algorithms. The most popular, longest used and best tested of them is the **RSA algorithm** (named after its creators: Ronald Rivest, Adi Shamir and Leonard Adleman, who described it in 1977). RSA is based on the computational difficulty of the factorization problem, i.e. decomposition of large complex numbers into prime factors.
Our **Online RSA Key Pair Generator** is a free, local tool. It allows you to instantly generate a pair of keys (public key and private key) in the standard PEM format (PKCS#1 or PKCS#8). Thanks to the use of WebCrypto API, key generation takes place directly in your browser, which guarantees full protection against data leakage on the network.
RSA mathematical algorithm
The RSA algorithm is based on modular arithmetic and number theory. Here is a simplified scheme for creating keys:
- Two very large, different prime numbers \( p \) and \( q \) are chosen.
- Their product is calculated: \[ n = p \times q \] The number \( n \) (called the modulus) specifies the length of the key (e.g. 2048 bits) and is part of both the public and private keys.
- The value of the Euler function (\( \phi \)) for the module \( n \) is calculated: \[ \phi(n) = (p-1) \times (q-1) \]
- The number \( e \) (public exponent) is chosen such that it is relatively prime of \( \phi(n) \) (i.e. \( \gcd(e, \phi(n)) = 1 \)) and satisfies the condition: \( 1 < e < \phi(n) \). The most commonly used value in practice is the number \( 65537 \).
- Calculate the number \( d \) (private exponent), which is the modular inverse of the number \( e \): \[ d \times e \equiv 1 \pmod{\phi(n)} \]
The public key consists of a pair of numbers \( (e, n) \), while the private key consists of a pair \( (d, n) \) or additional parameters facilitating calculations (Chinese residue theorem algorithm - CRT).
Table: RSA key length and security level
As computer processing power increases, shorter RSA keys become susceptible to cracking. The following table shows a comparison of key lengths:
| Key length (bits) | Security level | Recommendation and application status | Online generation time |
|---|---|---|---|
| 1024 bits | Low (unsafe) | Deprecated. Vulnerable to attacks using advanced supercomputers. Do not use! | Instant (< 50 ms) |
| 2048 bits | Standard (secure) | The default standard for most SSL certificates and SSH keys. Provides protection until approximately 2030. | Very short (50 - 200 ms) |
| 4096 bits | Very high (maximum security) | Recommended for long-term protection of data, certificate authorities (CAs), and government systems. | Short (200 - 1500 ms) |
How to generate an RSA key pair step by step?
- Select key length:Select security level (2048 or 4096 bits). The 4096-bit length offers maximum protection at the expense of slightly longer computation time.
- Click "Generate Keys":The browser will run the built-in high-entropy random number generator and determine the cryptographic parameters.
- Read the results:You will receive two blocks of data in PEM text format. The block starting with
-----BEGIN PUBLIC KEY-----is your public key. The block starting with-----BEGIN PRIVATE KEY-----is the private key. - Save fi