“If you will not show us the grail, we shall take your castle by force!”
What it’s about
A brute force attack is the process of repeatedly attempting possible combinations to a lock or passcode until the desired outcome is reached. Have you ever tried all possible combinations on a bike lock after forgetting its combination? That’s an example of a brute force attack.

Other examples of brute force attacks include trying all possible PIN (personal identification) numbers to gain access to a cell phone or tablet. Criminals use brute force to determine ATM card PIN numbers. Brute force attacks have also been used as a means to determine encryption keys. In this tutorial, you will experiment with brute force attacks and defenses to counter them:
- Attacks
- Crack a PIN access code programmed into a micro:bit,
- Crack a cipher intended to keep communication private.
- Defenses
- Increasing the number of combinations and adding time delays
- Using stronger ciphers since shift ciphers like Caesar and ASCII Shift are inherently vulnerable to brute force attacks
Before you start
You will need:
- Two or more micro:bit modules, on or off a cyber:bot. There is a cyber:bot project at the end, but most of the activities can be done with just two micro:bit modules.
- Two USB A to Micro B cables
- One or more computers with online access to the micro:bit Python Editor.
Complete these tutorials first:
After you finish
You will understand the basics of brute force attacks and be able to write scripts that perform those attacks. You will also be able to modify scripts in apps to strengthen their defenses against brute force attacks.
You will also be ready to move on to the next tutorials (coming soon!)
Curriculum
- 1 Section
- 17 Lessons
- Lifetime
- Cybersecurity: Brute Force Attacks & Defenses17
- 1.1About Brute Force Attacks
- 1.2micro:bit PIN Pad and Vault
- 1.3How the Example Scripts Work
- 1.4Script Cracks Vault PIN with Brute Force
- 1.5How the Bank Vault Cracking Works
- 1.6Try This: Randomized Vault Key
- 1.7Decimal Vault PIN
- 1.8How the Decimal Code Works
- 1.9Decimal Bank Vault Crack
- 1.10Your Turn: Strategies to Strengthen PINs
- 1.11Crack a Cipher with Brute Force
- 1.12How Using the Random Key Works
- 1.13Try This: More Combinations
- 1.14Strengthen Your Cipher with Substitution
- 1.15How the Scrambled Alphabet Cipher Works
- 1.16Try This: Generate a Random Cryptabet
- 1.17Your Turn: Strengthen Previous Apps