Online Tool Store Online Tool Store
🔒 Security & Privacy

· 3 min read

How to Encrypt Text With a Public Key

Heshan Fernando

Co-founder & COO

Heshan Fernando is the Co-founder and Chief Operating Officer of Ceyentra Technologies, where he leads project management, engineering, and research and development strategy. With over nine years of industry experience, he is passionate about transforming complex customer challenges into practical, high-impact solutions. His customer-centric leadership has enabled multidisciplinary teams to consistently deliver secure, scalable, and industry-grade digital products that create lasting business value. View on LinkedIn

Share

How to Encrypt Text With a Public Key

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.

PieceRole
Public keyUsed to encrypt
Private keyUsed to decrypt
AES keyEncrypts the message body
GCM tagDetects 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

  1. Open the free Text Encryptor.
  2. Generate a key pair or paste the recipient’s RSA public key.
  3. Enter the message to encrypt.
  4. Encrypt the text and copy the ciphertext.
  5. Send the ciphertext to the recipient.
  6. 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.

Try the free Text Encryptor

#text-encryptor#public-key-encryption-online#rsa-encrypt-text#asymmetric-encryption-tool#online-tools#free-tools