Skip to the page
Year 9 · Autumn 2 · Cybersecurity

Brute force: a Python password-strength checker

PracticalPresent ▶

What this lesson covers

Topic 17 Cybersecurity

KS3 Computing · Cybersecurity protects computers and data. Most attacks trick people or use weak systems, so good defences cover both.

Programming Networks and Digital CommunicationCambridge Lower Secondary Computing 0860

You will learn to

  • Calculate how many passwords are possible with the password formula: C to the power L.
  • Explain why making a password longer beats adding symbols.
  • Use the lock-out formula to show why three tries, then a wait, defeats brute force.
  • Write a Python password checker that scores length, digits and symbols.

Success criteria

  • I can work out 26⁸ with a calculator and say what it means.
  • I can compare the time to crack a password with and without a lock-out.
  • I can run my checker on three passwords and explain each score.

Key words

Say each word, then read what it means. Every one is in the glossary too.

Malware
Malicious software: viruses, worms, trojans, ransomware, spyware.
Phishing
Fake messages that trick people into giving details.
Brute force
Trying every possible password until one works.
Encryption
Scrambling data so only someone with the key can read it.
Firewall
Checks network traffic and blocks what isn't allowed.

The explanation

Read it here, or open the study page below to go one step at a time with things to try.

Why password length matters

PasswordCalculationPossibilities
4-digit PIN10⁴10,000
8 lower-case letters26⁸about 209 billion
8 of any keyboard symbol94⁸about 6 quadrillion
12 lower-case letters26¹²about 95 quadrillion
e.g.Example

A long passphrase like purple-violin-tuesday-rain beats a short messy one.

Study it

Open the study page and go one step at a time.

The steps for this lesson

Try it

The maths

Symbols first, then the words, then the equation. Change the numbers to try your own.

Build it

Check yourself

One question at a time. The reason shows after each answer.

Saved on this device.