Explore how one key can lock a message, while a different matching key unlocks it.
A public key is meant to be shared. Other people can use it to encrypt a message for the key owner or verify that the owner signed something.
A private key stays secret. The owner uses it to decrypt messages sent to them or create a digital signature.
This solo lab gives you a simulated partner so you can practice both sending and receiving without a classmate. The key tokens, ciphertext, and signatures are simplified for learning, but the process is the same.
You need to send a message securely to your partner.
Your partner's private key is not a tool you get to use. It is your partner's secret.
Your partner sent you a secure response. They used your public key to send you a private message. Choose the key that pairs with the public key your partner used.
Your partner encrypted this for you using your public key. Your job is to open it.
Same key pair, new message. Pick the key that lets your partner read it later.
The receiver's public key locks the message for that receiver.
Your partner sent a second secure response. This time, decide faster: which key opens messages sent to you?
Your public key can be shared. Your private key is kept just for you.
When someone uses your public key, they can create a message intended for you. Sharing that public key does not give them the matching private key.
The private key is the secret part. If it stays protected, only the owner can decrypt messages that were encrypted with the matching public key.
The math used to encrypt with a public key is a one-way operation: it cannot be reversed using that same key. The public key can only lock a message. It cannot undo its own work and decrypt what it just encrypted. Only the mathematically paired private key can run the reverse operation.
Confidentiality means protecting who can read the message. In asymmetric encryption, you usually encrypt with the receiver's public key so only the receiver's private key can decrypt it.
First, create a valid signature and verify the original message.
Your partner's private key stays off the table. You can verify their public messages, but you cannot sign as them.
The signature was created for the original message. Now test what happens when the message text is altered after signing.
A public key can verify a signature, but it should reject a changed message.
Your partner signed a message, then encrypted it for you. First check who sent it, then open it.
Verify that your partner is the person who sent this message. Then decrypt the message that was sent to you.
Real cryptography uses carefully designed algorithms, trusted libraries, and secure key management. This activity is a simplified model to make the roles of the keys visible.