Asymmetric encryption

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Asymmetric encryption

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Asymmetric encryption uses two different but mathematically linked keys.
A True
B False
2. Which key should be shared openly: the public key, or the private key?
A Private key
B Public key
3. The private key can be shared openly without any risk to security.
A False
B True
4. Which decrypts data encrypted with the public key: the matching private key, or the same public key?
A The matching private key
B The same public key
5. Asymmetric encryption requires both parties to share the same secret key beforehand.
A True
B False

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1ct = encrypt(msg, pub) AThe mistake: decrypting with the public key instead of the private key
2pt = decrypt(ct, priv) BDecrypting data using the matching private key
3Asymmetric encryption uses a linked pair of keys CEncrypting data using the recipient's public key
4The public key can be shared openly without weakening security DThe mistake: sharing the private key, which must stay secret
5share_publicly(priv) Eshare_publicly(pub)
6pt = decrypt(ct, pub) Fpub, priv = generate_key_pair()

Definitions

Asymmetric encryption

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
__________ = get_public()
2.
___________ = get_private()
3.
ct = ____________(msg, public_key)
4.
pt = ____________(ct, private_key)
5.
def _________________():

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A pub = get_public()
B priv = get_private()
C ct = encrypt(msg, priv)
Question 2
A pub = get_public()
B priv = get_private()
C ct = encrypt(msg, pub)
D pt = decrypt(ct, pub)
Question 3
A pub = get_public()
B keep_secret(pub)
C priv = get_private()
Question 4
A priv = get_private()
B share_publicly(priv)
C pub = get_public()
Question 5
A pub = priv
B ct = encrypt(msg, pub)
C pt = decrypt(ct, priv)

Answer Key

Asymmetric encryption
Section A: Quick Questions
Q1
A — True
Q2
B — Public key
Q3
A — False
Q4
A — The matching private key
Q5
B — False
Section B: Match the Pairs
Q1
ct = encrypt(msg, pub) → Encrypting data using the recipient's public key
Q2
pt = decrypt(ct, priv) → Decrypting data using the matching private key
Q3
Asymmetric encryption uses a linked pair of keys → pub, priv = generate_key_pair()
Q4
The public key can be shared openly without weakening security → share_publicly(pub)
Q5
share_publicly(priv) → The mistake: sharing the private key, which must stay secret
Q6
pt = decrypt(ct, pub) → The mistake: decrypting with the public key instead of the private key
Section C: Definitions
Q1
Asymmetric encryption — Encryption that uses a linked pair of keys: a public key to encrypt data and a private key to decrypt it, with no shared secret key needed.
Section D: Fill in the Blanks
Q1
public_key = get_public()
Q2
private_key = get_private()
Q3
ct = asym_encrypt(msg, public_key)
Q4
pt = asym_decrypt(ct, private_key)
Q5
def generate_key_pair():
Section E: Spot the Error
Q1
C — Line 3 encrypts using the private key, but asymmetric encryption should encrypt with the public key.
Q2
D — Line 4 decrypts using the public key, but decryption should use the matching private key instead.
Q3
B — Line 2 treats the public key as secret, but the public key is meant to be shared openly.
Q4
B — Line 2 shares the private key publicly, but the private key must stay secret to remain secure.
Q5
A — Line 1 sets the public key equal to the private key, but they must be a distinct, linked pair.