· 3 min read
How to Encrypt Text With a Public Key
Heshan Fernando
Co-founder & COO
Sharing an encrypted message is awkward when both people need the same password. If the password travels through the same chat or email as the message, the protection is weaker. Public-key encryption solves that by letting someone share a public key for encryption while keeping the private key secret for decryption.
A text encryptor can encrypt a message to a recipient’s RSA public key using hybrid encryption, so no shared password has to be sent.
What public-key text encryption involves
Public-key encryption uses a key pair. The public key can be shared. The private key must be kept secret. Anyone with the public key can encrypt a message, but only the private key holder can decrypt it.
Large messages are usually handled with hybrid encryption. RSA protects a random symmetric key, and AES-256-GCM encrypts the message itself. This avoids RSA size limits and detects tampering.
Why people get stuck here
The concept is simple, but key handling matters. The recipient must send the correct public key, and the private key should never be shared. People also confuse encryption with signing; encryption hides content, while signatures prove who sent something.
Another issue is message length. Raw RSA encryption has strict limits, which is why hybrid encryption is the practical approach.
| Piece | Role |
|---|---|
| Public key | Used to encrypt |
| Private key | Used to decrypt |
| AES key | Encrypts the message body |
| GCM tag | Detects tampering |
What good encrypted text looks like
No shared secret travels
The sender only needs the recipient’s public key.
Message length is practical
Hybrid encryption handles messages larger than direct RSA can support.
Tampering is detected
AES-GCM helps reveal when ciphertext has been changed.
Common mistakes to avoid
- Sharing the private key. Only the public key should be distributed.
- Sending keys through untrusted channels without verification. Confirm the public key belongs to the recipient.
- Treating encryption as identity proof. Use signatures when sender authenticity matters.
- Losing the private key. Encrypted messages cannot be recovered without it.
How to do it with Text Encryptor
- Open the free Text Encryptor.
- Generate a key pair or paste the recipient’s RSA public key.
- Enter the message to encrypt.
- Encrypt the text and copy the ciphertext.
- Send the ciphertext to the recipient.
- The recipient decrypts it with their private key.
The tool runs in your browser and uses hybrid RSA-OAEP plus AES-256-GCM for practical message encryption.
Frequently asked questions
Can someone decrypt with the public key?
No. The public key encrypts; the matching private key decrypts.
Why use hybrid encryption?
It avoids RSA message-size limits and lets AES handle the actual message content efficiently.
Is this the same as a password encryptor?
No. Public-key encryption does not require both people to know the same password.
Final thought
Public-key encryption is useful because the secret does not have to travel. Protect the private key, verify the public key, and keep the workflow clear.