Home

RSA Encryption/Decryption Live Demo

An interactive tool to generate RSA keys, encrypt messages with a public key, and decrypt with a private key. For educational purposes only. Find a detailed user guide in the "About" section at the bottom of the app.

1. Key Generation

Creates a new public and private key.
Downloads the public key as a .pem file.
Downloads the private key as a .pem file.

2. Import Keys

No file chosen
No file chosen

3. Encrypt Message

Encrypts your message using the currently loaded public key.
Downloads the encrypted message as a .b64 file.

4. Decrypt Message

No file chosen
Decrypts the message using the currently loaded private key.
About this RSA Encryption/Decryption Demo

What is this tool?

This RSA Encryption/Decryption Demo is an interactive web-based application designed to illustrate the fundamental principles of RSA public-key cryptography. It allows users to generate their own RSA key pairs, encrypt text messages using a public key, and then decrypt those messages using the corresponding private key.

How does it work?

RSA (Rivest–Shamir–Adleman) is an asymmetric encryption algorithm, meaning it uses two different keys: a public key for encryption and a private key for decryption. Messages encrypted with the public key can only be decrypted by its corresponding private key. This tool utilizes the browser's built-in Web Cryptography API to perform all cryptographic operations directly within your browser. This means your keys and messages are processed locally and are not transmitted to any server.

Quick Points

  • Key Pair Generation: Generate a new RSA public and private key pair (2048-bit).
  • Message Encryption: Encrypt any text message using the generated or imported public key.
  • Message Decryption: Decrypt an encrypted message using the corresponding private key.
  • Key & Message Import/Export: Save your generated keys and encrypted messages to files, and load them back into the tool.
  • Local Processing: All cryptographic operations happen in your browser, ensuring privacy for your demo data.
  • Theme Toggle: Switch between light and dark themes for a comfortable user experience.

How to Use This Tool: A Step-by-Step Guide

  1. Generate Keys:
    • Click the "Generate New RSA Key Pair" button.
    • Your Public Key and Private Key will appear in the text areas below the button.
    • *Note:* For encryption, you only need the Public Key. For decryption, you need the Private Key.
  2. Export Keys (Optional but Recommended):
    • Click "Export Public Key" to download your public key as a `.pem` file.
    • Click "Export Private Key" to download your private key as a `.pem` file.
    • *Tip:* Saving your keys allows you to use them in future sessions or to share the public key with others for secure communication (in a real-world scenario, but remember this is a demo!).
  3. Import Keys (Optional):
    • If you have existing RSA keys (e.g., from a previous session or another tool), use the "Import Public Key" or "Import Private Key" buttons in Section 2.
    • Click the button, select your `.pem` or `.txt` key file, and the key will be loaded into the tool.
  4. Encrypt a Message:
    1. Type or paste the message you wish to encrypt into the "Enter message to encrypt..." text area (in Section 3).
    2. **Crucial:** Ensure you have a Public Key loaded. If you just generated keys, it's already loaded. If not, import one using the options above.
    3. Click the "Encrypt Message" button.
    4. The encrypted message, represented in Base64 format, will appear in the "Encrypted message (Base64) will appear here..." text area.
    5. You can then click "Export Encrypted Message" to download this Base64 string as a `.b64` file.
  5. Decrypt a Message:
    1. Type or paste your encrypted message (the Base64 string) into the "Enter encrypted message (Base64) to decrypt..." text area (in Section 4). Alternatively, use the "Import Encrypted Message" button to load an encrypted message from a `.txt` or `.b64` file.
    2. **Crucial:** Ensure you have the **corresponding Private Key** loaded. This must be the private key that matches the public key used for encryption.
    3. Click the "Decrypt Message" button.
    4. The original, decrypted message will appear in the "Decrypted message will appear here..." text area.
  6. Theme Toggle:
    • Click the sun/moon icon at the top right corner of the app to switch between the light and dark themes.

Important Note:

This tool is for educational purposes only and should NOT be used for real-world secure communication or for handling any sensitive data. Cryptography is complex, and proper secure implementations require careful design, robust key management, and server-side validation, which are beyond the scope of this client-side demonstration.

Related tools List

Discover more free online conversion and utility tools!. Explore our collection of Conversion & Utility Tools.

Frequently Asked Questions (FAQ)
What is an RSA encryption tool used for?

It is used to encrypt messages using a public key and decrypt them using a private key based on RSA cryptography principles.

Is my data sent to a server?

No. All encryption and decryption operations are performed locally in your browser using the Web Crypto API.

Can I generate RSA keys with this tool?

Yes. The tool allows you to generate 2048-bit RSA public and private key pairs instantly.

Can I import my own RSA keys?

Yes. You can import public and private keys in PEM or text format into the tool.

What format is the encrypted message?

Encrypted messages are encoded in Base64 format and can be exported as .b64 files.

Why does decryption fail sometimes?

Decryption fails if the private key does not match the public key used during encryption or if the encrypted data is invalid.

Is this tool safe for real-world secure communication?

No. This tool is intended for educational and demonstration purposes only and should not be used for sensitive or production-level security.

Key Features
  • Generate RSA key pair (2048-bit)
  • Encrypt messages using public key
  • Decrypt messages using private key
  • Import public and private keys (.pem, .txt)
  • Export keys in PEM format
  • Export encrypted messages (.b64)
  • Client-side cryptography using Web Crypto API
  • Local processing with no server communication
  • Base64 encoded encrypted output
  • Light and dark theme toggle
Alternate Names & Global Discoverability

This utility is also recognized globally by the following names:

  • RSA Encryption Tool
  • Message Encryption Tool
  • Secure Text Encryptor
  • RSA Key Generator
  • Secret Message Creator
  • Public Key Encryption Tool
  • RSA Encryption Demo Online
  • Text Encryption Tool
  • Private Message Encryptor
  • Herramienta de encriptación RSA
  • RSA-Verschlüsselungstool
  • Ferramenta de criptografia RSA