Loading Pyodide...

This may take a few seconds on first load

Back
You are Alice

Crypto Primitives Lab

Understanding Key Exchange & Encrypted Communication

👩

Alice

You
👨

Bob

Communication Partner
1
2
3
4
5
6
7
👩
Alice
Ready
👨
Bob
Available
Ready to begin key exchange with Bob

Ready to begin key exchange with Bob. Click "Next Step" to continue.

Step 2: Key Generation

Alice's Keys

Recipient's Keys

*** SECRET ***

💡 Tip: Public keys are shared; private keys stay secret!

Step 3: Generate Shared Secret

Shared secret is being generated. Watch the frame above!

Shared Secret Key

Step 4: Wrap Shared Secret

Watch the frame above to see Alice wrap the secret with the recipient's public key!

Encryption Details

Step 5: Send Wrapped Secret

Alice sends the wrapped secret to the recipient.

Watch the animation above!

Step 6: Unlock with Private Key

The recipient uses his private key to unlock the message.

Watch the animation above to see the private key unlock the secret!

Step 7: Symmetric Encryption Communication

✓ Now Using Symmetric Encryption Only!

Both parties share the same secret key.

Fast and efficient for ongoing communication!

Watch messages exchange automatically above using the shared secret!

🔑 Same key used by both Alice and Bob for encryption/decryption

Alice: Messages will appear here...

Symmetric Encryption

Recipient: Messages will appear here...

Key Insight: Asymmetric encryption (public/private keys) was only needed to establish the shared secret. Now all communication uses fast symmetric encryption!

Learning Points

Public Key Encryption

Encrypt with public key, decrypt with private key

Shared Secret

Enables fast two-way encrypted communication

Key Exchange

Securely transmit shared secret using public key

Symmetric Encryption

Efficient once both parties have the secret