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. his app is known by many names, including message encryption tool, secure message tool, secret text creator, and key generator. To ensure global discoverability, the app can also be found by its names in other languages: Herramienta de encriptación RSA in Spanish, RSA-Verschlüsselungstool in German, and Ferramenta de criptografia RSA in Portuguese. Our mission is to provide an accessible and educational utility that helps you understand and use fundamental data security concepts with confidence.

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.

Key Features:

  • 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.