Updated · By Pete Bromfield, former Head of Maths with IB examining experience

IA idea · Cryptography & number theory

How long would it take to guess your password? Counting and logarithms

AA SLAI SLAA HLAI HL Accessible Also in: Probability

Research question

How many guesses does it take, on average and in the worst case, to find passwords built by common rules (length, character sets, words plus digits), and which rule change adds the most security?

Make it yours, then agree it with your teacher.

Next step: plan this IA free — the planner opens with this question filled in. For feedback on your own draft, the IA package (€39 once) gives you 5 AI feedback credits and every annotated exemplar in full.

Why it makes a good exploration

Counting principles and logarithms answer a question everyone cares about. Comparing realistic password patterns with purely random ones shows why human choices matter more than length rules.

The mathematics you'll need

  • Multiplication principle and permutations
  • Expected number of guesses for a uniform search
  • Logarithms: bits of entropy as log₂ of the number of possibilities
  • Comparing growth: exponential in length, linear in alphabet
  • Probability of guessing within k tries

Where the data comes from

No personal data. Use rules from real sign-up pages and, for word-based passwords, the size of a dictionary word list you can count.

A possible outline

  1. Count possibilities for several password rules.
  2. Convert to bits and to expected guessing time at a stated guess rate.
  3. Compare adding length with adding symbols.
  4. Model passphrases of random words.
  5. Reflect on human patterns that make the real number much smaller.

Pitfalls that cost marks

  • Never collect or use anyone's real passwords.
  • Treating human-chosen passwords as uniformly random.
  • Using a guess rate with no source; state it as an assumption and vary it.

Showing personal engagement

  • Compare the rules of sites you use.
  • Design a rule that is secure and memorable.
  • Survey (anonymously) which patterns people say they use, not their passwords.

See Criterion C: personal engagement for what examiners look for.

Which course is it for?

CourseFitMaths to lean on
AA SLGood fitMultiplication principle and permutations; Expected number of guesses for a uniform search
AA HLFits, but add an HL techniqueMultiplication principle and permutations; Expected number of guesses for a uniform search
AI SLGood fitMultiplication principle and permutations; Expected number of guesses for a uniform search
AI HLFits, but add an HL techniqueMultiplication principle and permutations; Expected number of guesses for a uniform search

Level: Accessible. A good first extended piece of maths, with room to go deeper. See how the IA differs between AA and AI, SL and HL.

How this idea reaches the top bands

Reflection (D)

For this idea, start with the weak points: never collect or use anyone's real passwords; and treating human-chosen passwords as uniformly random. Say how each one affects your answer.

Use of mathematics (E)

SL: multiplication principle and permutations; expected number of guesses for a uniform search; logarithms: bits of entropy as log₂ of the number of possibilities; comparing growth: exponential in length, linear in alphabet; probability of guessing within k tries, each explained in your own words and carried out correctly.

How cryptography explorations reach the top bands in general: Cryptography & number theory IA ideas. Guides: A · B · C · D · E · self-grade sheet.

Taking it further

Model a dictionary attack with a probability distribution over words, or study how many guesses are needed to find one password in a large set.

Extending it for HL

Add an HL technique the question genuinely needs: what an HL cryptography exploration adds.

Frequently asked questions

Which IB Maths course is this IA idea for?

It works for AA SL, AI SL, AA HL and AI HL. We rate it Accessible: a good first extended piece of maths, with room to go deeper.

What mathematics does this IA use?

Multiplication principle and permutations, expected number of guesses for a uniform search, logarithms: bits of entropy as log₂ of the number of possibilities, comparing growth: exponential in length, linear in alphabet and probability of guessing within k tries.

Where can I get data for this IA?

No personal data. Use rules from real sign-up pages and, for word-based passwords, the size of a dictionary word list you can count. Checked sources and tools: Desmos graphing calculator.

Turn this idea into your IA

The planner opens with “How long would it take to guess your password? Counting and logarithms” filled in: the question, the maths and the data sources.

Plan this IA free

Your plan is kept in this browser. A free account keeps it with your drafts on any device: Join free · Sign in

Also: free IA self-check · A–E checklist (PDF) · have a draft? AI feedback or a review with Pete (€100)

Writing it up: how to write a Maths IA, step by step · structure and format · mistakes that cost marks · annotated exemplars, marked on every criterion

Similar ideas

All cryptography ideas · AA SL ideas · AI SL ideas · AA HL ideas · AI HL ideas · All 239 IA ideas