Encryption / Hash

RSA Encrypt / Decrypt

Generate RSA key pairs and encrypt with public key, decrypt with private key.

Keys are exported in JWK (JSON Web Key) format for use in encryption/decryption.

What is RSA Encryption?

RSA is an asymmetric encryption algorithm using public/private key pairs for secure data encryption and digital signatures.

Features

  • Key Generation: Generate RSA key pairs
  • Encrypt/Decrypt: Public key encryption, private key decryption
  • Sign/Verify: Digital signature support

Use Cases

  • Secure data transmission
  • Digital signatures
  • Key exchange

Frequently Asked Questions

Are RSA encryption and signing in opposite directions?
Yes, and it trips everyone up once: encryption uses the recipient’s public key (their private key decrypts — confidentiality); signing uses your own private key (others verify with your public key — authenticity and non-repudiation). What a public key encrypts only the private key can open; what a private key signs, anyone with the public key can verify but none can forge.
Can RSA encrypt data of any length?
No. One RSA operation encrypts at most a few hundred bytes (about 190 bytes with OAEP and a 2048-bit key) and is slow. Real systems use hybrid encryption: RSA wraps a random AES key, and AES encrypts the actual data — the structure behind TLS and RSA-mode JWTs.
Is 2048-bit RSA still safe? Should I jump to 4096?
2048 remains acceptable (NIST-approved beyond 2030); 4096 adds margin but signs and verifies 5–10× slower with larger ciphertexts. New keys: 3072 or 4096. The urgent risks are legacy 1024-bit keys and outdated signature algorithms like RSA-SHA1, not key size on modern deployments.