Public Key Encryption Demo

How Public Key Encryption Works:

1. Each person generates two keys:
- A public key that you share with others
- A private key that you keep secret

2. Messages are encrypted using the recipient's public key

3. Only the recipient's matching private key can decrypt the message

This is a simplified demonstration to help understand the concept of public key encryption.

Generate Your Keys

When you generate keys:

1. Share your public key with anyone who wants to send you messages

2. Keep your private key secret - never share it!

Save your private key securely! It cannot be recovered if lost.

Encrypt a Message

To send an encrypted message:

1. Get the recipient's public key

2. Enter your message

3. Only someone with the matching private key can read it

Decrypt a Message

To read an encrypted message:

1. You need your private key (auto-filled if you generated one)

2. Paste the encrypted message

3. Only your private key can decrypt messages encrypted with your public key