Lesson 2: Brute force

How easy is it to steal someone’s password? Children learn what brute force hacking is and the importance of secure passwords

Before the lesson

Download classroom resources

Learning objective

  • To understand the importance of having a secure password

National curriculum

Pupils should be taught to:

  • Design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts
  • Use sequence, selection, and repetition in programs; work with variables and various forms of input and output
  • Use logical reasoning to explain how some simple algorithms work and to detect and correct errors in algorithms and programs
  • Select, use and combine a variety of software […] to design and create a range of programs, systems and content that accomplish given goals, including collecting, analysing, evaluating and presenting data and information

Success criteria

Cross-curricular links

Attention grabber

Main event


Pupils needing extra support: If they are really struggling, hand them the answer sheet, but get them to explain each of the changes to the code.


Pupils working at greater depth: Encourage independence in creativity in terms of the style of the hack. Can they change the code so that it only searches for digits less than five? How does that affect the ease with which the wizard can crack the code?

Wrapping up

Assessing pupils' progress and understanding


Created by:
Cat Lamin,  
Computing specialist
Cat was a committed primary school teacher for twelve years. After starting her independent consultancy ‘Crossover Solutions’ she has travelled to Argentina, Brazil and America to share her wealth of knowledge of computer science with other teachers. Her enjoyment for…
Find out more
Lesson 1: Secret codes Previous Lesson