Comparing symmetric and asymmetric keys

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

Comparing symmetric and asymmetric keys

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which type of encryption uses the same key to encrypt and decrypt data?
A Symmetric encryption
B Asymmetric encryption
2. Which type of encryption is generally faster for encrypting large amounts of data?
A Symmetric encryption
B Asymmetric encryption
3. What is the key distribution problem?
A Having too many public keys stored on one server
B Sharing a secret key safely with the other person before they can decrypt
4. Which approach avoids having to share a secret key in advance?
A A single symmetric key
B Asymmetric key pair (public and private key)
5. Which key can be shared openly with anyone in asymmetric encryption?
A The public key
B The private key

Match the Pairs

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

Left columnRight column
1AES_encrypt(file, sharedKey) Asend(sharedKey, toBob) // risky if intercepted
2RSA_encrypt(message, publicKey) BAsymmetric encryption: a public key locks the data and only the matching private key can unlock it
3Key distribution problem: both people need the same secret key, so it must be shared securely before they can communicate CSymmetric encryption: the same secret key is used to lock the data, and it is fast for large files
4In practice both are combined: asymmetric encryption protects a symmetric session key, then the fast symmetric key encrypts the data Dkey = RSA_encrypt(sessionKey, publicKey) data = AES_encrypt(file, sessionKey)
5Asymmetric encryption is faster than symmetric, so use it for all large files EThe private key must stay secret. Only the public key is shared, so others can encrypt messages for you
6Asymmetric encryption: share the private key so others can send you messages FAsymmetric encryption is slower than symmetric, so it is not the best choice for encrypting large amounts of data on its own

Definitions

symmetric vs asymmetric

Fill in the Blanks

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

1.
// One shared secret key, very fast keyType ← _________
2.
// A public key and a private key keyType ← __________
3.
encrypt(message, recipient._________) decrypt(ciphertext, myPrivateKey)
4.
sessionKey ← newSymmetricKey() sent ← _________________(sessionKey, pubKey)
5.
// Large file: use the faster key type IF size > 1000000 THEN method ← _________

Spot the Error

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

Question 1
A key ← newSecretKey()
B cipher ← encrypt(msg, key)
C shareKeyOnPublicWeb(key, Bob)
D plain ← decrypt(cipher, key)
Question 2
A // Symmetric: key pair
B cipher ← encrypt(msg, key)
C plain ← decrypt(cipher, key)
Question 3
A pair ← makeKeyPair()
B publish(pair.private)
C keep(pair.private)
Question 4
A c ← receive()
B pair ← Bob.keyPair
C // only Bob holds private key
D msg ← decrypt(c, pair.public)
Question 5
A big ← loadFile('video.mp4')
B k ← newSymmetricKey()
C data ← aesEncrypt(big, k)
D wrapped ← rsaEncrypt(big, pub)

Answer Key

Comparing symmetric and asymmetric keys
Section A: Quick Questions
Q1
A — Symmetric encryption
Q2
A — Symmetric encryption
Q3
B — Sharing a secret key safely with the other person before they can decrypt
Q4
B — Asymmetric key pair (public and private key)
Q5
A — The public key
Section B: Match the Pairs
Q1
AES_encrypt(file, sharedKey) → Symmetric encryption: the same secret key is used to lock the data, and it is fast for large files
Q2
RSA_encrypt(message, publicKey) → Asymmetric encryption: a public key locks the data and only the matching private key can unlock it
Q3
Key distribution problem: both people need the same secret key, so it must be shared securely before they can communicate → send(sharedKey, toBob) // risky if intercepted
Q4
In practice both are combined: asymmetric encryption protects a symmetric session key, then the fast symmetric key encrypts the data → key = RSA_encrypt(sessionKey, publicKey) data = AES_encrypt(file, sessionKey)
Q5
Asymmetric encryption is faster than symmetric, so use it for all large files → Asymmetric encryption is slower than symmetric, so it is not the best choice for encrypting large amounts of data on its own
Q6
Asymmetric encryption: share the private key so others can send you messages → The private key must stay secret. Only the public key is shared, so others can encrypt messages for you
Section C: Definitions
Q1
symmetric vs asymmetric — Symmetric: one shared secret key, fast but hard to share safely. Asymmetric: public and private key pair, no secret to share but slower. Often combined.
Section D: Fill in the Blanks
Q1
// One shared secret key, very fast keyType ← SYMMETRIC
Q2
// A public key and a private key keyType ← ASYMMETRIC
Q3
encrypt(message, recipient.publicKey) decrypt(ciphertext, myPrivateKey)
Q4
sessionKey ← newSymmetricKey() sent ← asymmetricEncrypt(sessionKey, pubKey)
Q5
// Large file: use the faster key type IF size > 1000000 THEN method ← SYMMETRIC
Section E: Spot the Error
Q1
C — A symmetric key is a shared secret, so it must be delivered securely (the key distribution problem). Sending it over the open web lets an attacker copy it. The line should use a secure method, such as shareKeySecurely(key, Bob).
Q2
A — Symmetric encryption uses one shared secret key for both encrypting and decrypting. A public/private key pair is asymmetric encryption. The comment should say one shared key.
Q3
B — In asymmetric encryption the public key is shared with everyone, but the private key must stay secret. Publishing the private key would let anyone decrypt messages. It should be publish(pair.public).
Q4
D — A message encrypted with Bob's public key can only be decrypted with Bob's matching private key. The public key cannot decrypt it. The line should use pair.private.
Q5
D — Asymmetric encryption is slow, so it should only protect the small symmetric key k, not the large file. The file is already encrypted with k. The line should be rsaEncrypt(k, pub).