Passphrase

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

Passphrase

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which is a passphrase?
A Purple1
B purple-tractor-melon-sky
2. What makes a passphrase strong?
A It is short and uses one common word
B It is long and uses several unrelated words
3. Which words make the best passphrase?
A Random words that do not belong together
B Words from your name and birthday
4. How can you make a passphrase even stronger?
A Add numbers or symbols
B Make it shorter
5. A passphrase can be built from a memorable sentence. Which is a true example?
A The sentence 'My cat eats 3 green apples' becomes Mycat3greenapples
B The sentence 'My cat eats 3 green apples' becomes 123

Match the Pairs

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

Left columnRight column
1purple-Teapot-runs-87 AA passphrase built from a memorable sentence, using the first letters or words plus numbers and a symbol
2Myd0gEats2Pies! BA passphrase that combines random, unrelated words and adds numbers and a symbol to make it stronger
3A passphrase is made by combining several random, unrelated words CThis is not a passphrase. It is a short password using a name and a year, which is easy to guess. Use several unrelated words instead.
4You can make a passphrase stronger by adding numbers or symbols DThe words are related and form a personal sentence that is easy to guess. Use unrelated words instead, such as from your own memorable sentence.
5Sam2012 Ecloud-banana-rocket-pencil
6my-name-is-sam-and-i-like-cats Ffrog-lamp-ocean-42!

Definitions

passphrase

Fill in the Blanks

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

1.
__________ = "purple-tiger-cloud-boat"
2.
passphrase = word1 _ word2 + word3
3.
words = "blue-frog-tree" passphrase = words + ______ + symbol
4.
sentence = "My dog likes red apples" passphrase = sentence._______(" ", "-")
5.
passphrase = "purple-tiger-cloud-boat" if len(passphrase) __ 16: print("Long and strong")

Spot the Error

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

Question 1
A words = ["frog","lamp","tea"]
B passphrase = "".join(words)
C passphrase += "42"
D print(passphrase2)
Question 2
A sentence = "I eat 3 red pies"
B letters = ""
C for w in sentence.split()
D letters += w[0]
E print(letters)
Question 3
A import random
B words = ["moon","tree","bus"
C pick = random.sample(words,3)
D passphrase = "-".join(pick)
E print(passphrase)
Question 4
A passphrase == "pig-rain-kite"
B if len(passphrase) >= 12:
C print("Long enough")
D else:
E print("Add more words")
Question 5
A words = ["pen","sky","fox"]
B passphrase = " ".join(words)
C passphrase = passphrase + 7
D print(passphrase)

Answer Key

Passphrase
Section A: Quick Questions
Q1
B — purple-tractor-melon-sky
Q2
B — It is long and uses several unrelated words
Q3
A — Random words that do not belong together
Q4
A — Add numbers or symbols
Q5
A — The sentence 'My cat eats 3 green apples' becomes Mycat3greenapples
Section B: Match the Pairs
Q1
purple-Teapot-runs-87 → A passphrase that combines random, unrelated words and adds numbers and a symbol to make it stronger
Q2
Myd0gEats2Pies! → A passphrase built from a memorable sentence, using the first letters or words plus numbers and a symbol
Q3
A passphrase is made by combining several random, unrelated words → cloud-banana-rocket-pencil
Q4
You can make a passphrase stronger by adding numbers or symbols → frog-lamp-ocean-42!
Q5
Sam2012 → This is not a passphrase. It is a short password using a name and a year, which is easy to guess. Use several unrelated words instead.
Q6
my-name-is-sam-and-i-like-cats → The words are related and form a personal sentence that is easy to guess. Use unrelated words instead, such as from your own memorable sentence.
Section C: Definitions
Q1
passphrase — A password made of several unrelated words that is long but easy to remember. You can add numbers or symbols to make it stronger.
Section D: Fill in the Blanks
Q1
passphrase = "purple-tiger-cloud-boat"
Q2
passphrase = word1 + word2 + word3
Q3
words = "blue-frog-tree" passphrase = words + number + symbol
Q4
sentence = "My dog likes red apples" passphrase = sentence.replace(" ", "-")
Q5
passphrase = "purple-tiger-cloud-boat" if len(passphrase) >= 16: print("Long and strong")
Section E: Spot the Error
Q1
D — The variable holding the passphrase is called passphrase, not passphrase2. Python would give a NameError. It should be print(passphrase).
Q2
C — A for loop line must end with a colon. It should be for w in sentence.split():
Q3
B — The list of random words is missing its closing square bracket. It should end with ].
Q4
A — A single = stores the passphrase in a variable. == only compares values, so passphrase would not exist. It should be passphrase = "pig-rain-kite".
Q5
C — Numbers and symbols added to a passphrase must be text. 7 is not in quotes, so Python cannot add it to a string. It should be + "7!" or + "7".