Sign up free

RSA Key Generator and Encryption Online

Generate RSA key pairs, encrypt and decrypt short messages, and sign or verify, all in your browser.

About RSA Key Generator and Encryption

This online RSA tool covers the jobs that come up when you wire up login encryption, a payment callback or a license check. Generate a 2048, 3072 or 4096-bit key pair in PEM format, with the private key as PKCS#8 and the public key as SPKI. Keys in the older PKCS#1 format, the ones starting with BEGIN RSA PRIVATE KEY, are accepted too.

Encrypt and decrypt with RSA-OAEP, using SHA-256 or SHA-1, or with PKCS#1 v1.5. The latter matches jsencrypt and PHP's openssl_public_encrypt with default settings, so you can test a login form that encrypts passwords in the browser. Sign and verify with SHA-256, using PKCS#1 v1.5 or PSS padding. Ciphertext and signatures come out as Base64. Keys are generated in your browser and never sent anywhere. Tokens signed with RS256 can be checked against your public key in the JWT Decoder.

How to use RSA Key Generator and Encryption

  1. 1
    Generate or paste keys

    Create a 2048, 3072 or 4096-bit pair, or paste your own PEM keys.

  2. 2
    Pick the operation

    Encrypt, decrypt, sign or verify.

  3. 3
    Choose the padding

    RSA-OAEP with SHA-256 or SHA-1, or PKCS#1 v1.5. For signatures, PKCS#1 v1.5 or PSS.

  4. 4
    Copy the result

    Ciphertext and signatures come out as Base64.

Why use Cubfile for this

  • Keys up to 4096 bits

    PEM output with a PKCS#8 private key and an SPKI public key.

  • Works with existing code

    PKCS#1 v1.5 matches the defaults of jsencrypt and PHP openssl_public_encrypt.

  • Sign and verify

    SHA-256 signatures with PKCS#1 v1.5 or PSS padding.

  • Private keys stay private

    Generated and used in your browser, never uploaded.

FAQ

RSA Key Generator and Encryption: questions and answers

Is it safe to generate RSA keys online?
Here the key pair is created in your browser and never sent anywhere. For keys you'll use in production, you can open the page, disconnect from the internet and then generate them.
How much text can RSA encrypt?
Only a little. A 2048-bit key fits 245 bytes with PKCS#1 v1.5 and 190 bytes with OAEP and SHA-256. For longer data, encrypt it with AES and encrypt the AES key with RSA. That AES step can be done in your browser with AES Encrypt and Decrypt.
Which padding should I choose?
Use OAEP with SHA-256 for new work. Pick PKCS#1 v1.5 when the other side uses jsencrypt or PHP openssl_public_encrypt with default settings.
Why is the ciphertext different every time?
RSA padding adds random bytes, so each encryption looks different. All of them decrypt to the same text with the private key.
What's the difference between PKCS#1 and PKCS#8 keys?
They're two wrappers for the same key. A PKCS#1 private key starts with BEGIN RSA PRIVATE KEY and a PKCS#8 one with BEGIN PRIVATE KEY. This tool writes PKCS#8 and reads both.
Share RSA Key Generator and Encryption with a friendIt runs in any browser, and they can try it without signing up.

Related tools

HASH Hash GeneratorGet MD5, SHA-1, SHA-256, SHA-512 and SM3 hashes of text in one go.
TIME Unix Timestamp ConverterConvert Unix timestamps to dates and back, in your time zone and UTC.
U+UNI Unicode ConverterConvert text to and from \u escapes, &#; codes, U+ points and UTF-8 bytes.
AES AES Encrypt and DecryptEncrypt or decrypt text with AES in GCM, CBC or CTR mode.
&;HTML HTML Entity Encoder/DecoderEscape text into HTML entities, or turn entities back into text.
JWT JWT DecoderDecode a JSON Web Token’s header and payload and check its expiry and signature.
01BIN Number Base ConverterConvert numbers between binary, octal, decimal, hex and any base up to 36.
BASE Base32 and Base58 EncoderEncode and decode Base32, Base58, Base85 and Base16.