Longer means harder to guess

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

Longer means harder to guess

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A 3-digit code (000 to 999) has 1,000 possible combinations. How many does a 4-digit code have?
A 10,000 combinations
B 1,001 combinations
2. Which secret is harder to guess?
A A 3-digit code
B A 4-digit code
3. What happens to the number of combinations each time you add one more character?
A It multiplies, so there are many more combinations
B It only goes up by one
4. Which password would take a guesser longer to crack?
A cat7
B purple-tiger-bike-cloud
5. A computer can try thousands of guesses every second. Which is the safer choice?
A A long passphrase
B A short password

Match the Pairs

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

Left columnRight column
13-digit code: 000 to 999 AComputers can guess very fast, so a short password with few combinations can be found quickly.
24-digit code: 0000 to 9999 BEach extra digit multiplies the combinations by 10, so it is 10 times harder, not just a little harder.
3A longer password has many more combinations, so it takes a computer much longer to guess. CThere are 1000 possible codes. A guesser has 1000 combinations to try.
4A short password has few combinations, so a fast computer can guess it very quickly. Dcat12
5A 4-digit code is only a little harder to guess than a 3-digit code. EThere are 10000 possible codes. That is 10 times more combinations than a 3-digit code.
6Computers guess slowly, so a short password is safe enough. Fblue-tiger-jumps-high-87

Definitions

combinations

Fill in the Blanks

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

1.
combos = __ ** 3 print(combos)
2.
small = 10 ** 3 big = small _ 10 print(big)
3.
small = 10 ** 3 big = 10 ** 4 print(big _ small)
4.
length = 8 combos = 26 ** ______ print(combos)
5.
combos = 26 ** 8 speed = 1000000 seconds = combos / _____

Spot the Error

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

Question 1
A codes3 = 10 ** 3
B codes4 = 10 ** 4
C extra = codes4 - codes3
D print(extra)
Question 2
A length = 4
B combos = 10 * length
C print(combos)
Question 3
A short = 26 ** 4
B long = 26 ** 8
C print(long < short)
Question 4
A for length in range(3, 6):
B combos = length ** 10
C print(length, combos)
Question 5
A password = 'cat'
B total = 26 ** password
C print(total)

Answer Key

Longer means harder to guess
Section A: Quick Questions
Q1
A — 10,000 combinations
Q2
B — A 4-digit code
Q3
A — It multiplies, so there are many more combinations
Q4
B — purple-tiger-bike-cloud
Q5
A — A long passphrase
Section B: Match the Pairs
Q1
3-digit code: 000 to 999 → There are 1000 possible codes. A guesser has 1000 combinations to try.
Q2
4-digit code: 0000 to 9999 → There are 10000 possible codes. That is 10 times more combinations than a 3-digit code.
Q3
A longer password has many more combinations, so it takes a computer much longer to guess. → blue-tiger-jumps-high-87
Q4
A short password has few combinations, so a fast computer can guess it very quickly. → cat12
Q5
A 4-digit code is only a little harder to guess than a 3-digit code. → Each extra digit multiplies the combinations by 10, so it is 10 times harder, not just a little harder.
Q6
Computers guess slowly, so a short password is safe enough. → Computers can guess very fast, so a short password with few combinations can be found quickly.
Section C: Definitions
Q1
combinations — The number of possible guesses for a secret. Each extra character multiplies them, so longer passwords take much longer to guess, even for fast computers.
Section D: Fill in the Blanks
Q1
combos = 10 ** 3 print(combos)
Q2
small = 10 ** 3 big = small * 10 print(big)
Q3
small = 10 ** 3 big = 10 ** 4 print(big > small)
Q4
length = 8 combos = 26 ** length print(combos)
Q5
combos = 26 ** 8 speed = 1000000 seconds = combos / speed
Section E: Spot the Error
Q1
C — To see how many times more codes a 4-digit code has, divide: codes4 // codes3 gives 10. Subtracting only gives the gap between the two numbers, not how many times bigger it is.
Q2
B — Each extra digit multiplies the combinations by 10, so we need the power operator: 10 ** length. Using * only gives 40, not 10000.
Q3
C — A longer password has more combinations than a shorter one, so long > short should be True. The < sign checks the wrong way round and would print False.
Q4
B — The base (10 digits to choose from) stays the same and the length is the power: 10 ** length. Swapping them gives the wrong numbers and hides how fast combinations grow.
Q5
B — The power must be the number of characters, which is len(password). A word cannot be used as a power, so this causes an error.