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 purple-tractor-melon-sock
B Pa$$w0rd1
2. How many random words make a good passphrase?
A Just one
B Three or four
3. Which passphrase is easier to remember but hard to guess?
A kettle sunset giraffe wobble
B xK9#qT2!vLp7
4. Which words should you AVOID in a passphrase?
A Words that have nothing to do with you
B Your pet's name and your birthday
5. Which is the best way to make a passphrase a bit stronger?
A Add a number or symbol, like river!cloud7pencil
B Use the same words as a song lyric

Match the Pairs

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

Left columnRight column
1purple-tiger-bucket-lamp AThis uses a name linked to you and is too short. A passphrase needs three or four random, unrelated words.
2cloud7!sandal!fox!pencil BA passphrase with a number and symbols added to make it even harder to guess
3A good passphrase uses three or four random words that have nothing to do with each other Cspoon-rocket-banana-cliff
4A passphrase should avoid words linked to you, like your pet's name or your favourite team DRex-Swans-Emma-2012
5MyDogMax EA passphrase made of four random, unrelated words that is easy to remember but hard to guess
6I love my school FThis is a common phrase about you. The words are related and easy to guess, so it should be random words like lamp-frog-ocean-chair.

Definitions

passphrase

Fill in the Blanks

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

1.
__________ = "river cactus pencil"
2.
words = ["river", "cactus", "pencil"] print(___(words))
3.
passphrase = "river cactus pencil" _ "7!"
4.
avoid = ["pet", "name", "birthday"] if "pet" __ avoid: print("Pick unrelated words")
5.
passphrase = "river cactus pencil 7" if len(passphrase) __ 16: print("Long enough")

Spot the Error

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

Question 1
A words = ["fox", "map", "sky"]
B passphrase = "-".split(words)
C print(passphrase)
Question 2
A words = ["fox", "map", "sky"]
B count = length(words)
C if count >= 3:
D print("Good length")
Question 3
A phrase = "fox-map-sky"
B number = 7
C phrase = phrase + number
D print(phrase)
Question 4
A avoid = ["Sam", "Rex", "2010"
B word = "Rex"
C if word in avoid:
D print("Too guessable")
Question 5
A passphrase = "sock rocket fig
B length = len(passphrase)
C print(length)

Answer Key

Passphrase
Section A: Quick Questions
Q1
A — purple-tractor-melon-sock
Q2
B — Three or four
Q3
A — kettle sunset giraffe wobble
Q4
B — Your pet's name and your birthday
Q5
A — Add a number or symbol, like river!cloud7pencil
Section B: Match the Pairs
Q1
purple-tiger-bucket-lamp → A passphrase made of four random, unrelated words that is easy to remember but hard to guess
Q2
cloud7!sandal!fox!pencil → A passphrase with a number and symbols added to make it even harder to guess
Q3
A good passphrase uses three or four random words that have nothing to do with each other → spoon-rocket-banana-cliff
Q4
A passphrase should avoid words linked to you, like your pet's name or your favourite team → Rex-Swans-Emma-2012
Q5
MyDogMax → This uses a name linked to you and is too short. A passphrase needs three or four random, unrelated words.
Q6
I love my school → This is a common phrase about you. The words are related and easy to guess, so it should be random words like lamp-frog-ocean-chair.
Section C: Definitions
Q1
passphrase — A long password made of several unrelated words, like three or four random words. It is easy to remember but hard to guess. Add a number or symbol and avoid words linked to you.
Section D: Fill in the Blanks
Q1
passphrase = "river cactus pencil"
Q2
words = ["river", "cactus", "pencil"] print(len(words))
Q3
passphrase = "river cactus pencil" + "7!"
Q4
avoid = ["pet", "name", "birthday"] if "pet" in avoid: print("Pick unrelated words")
Q5
passphrase = "river cactus pencil 7" if len(passphrase) >= 16: print("Long enough")
Section E: Spot the Error
Q1
B — split() breaks a string apart, but here we want to combine the words into one passphrase. It should be "-".join(words).
Q2
B — Python has no length() function. The word count is found with len(words).
Q3
C — You cannot add a number directly to text. The number must be turned into text first with str(number) so it can be added to the passphrase.
Q4
A — The list is missing its closing square bracket ]. The words to avoid (names, pets, birth years) must be inside a complete list.
Q5
A — The string is missing its closing quote mark. It should end with " after fig.