Challenge 16

🔒

Pin Cracker

Open in Code Editor or Copy Instructions
...solutions at bottom of page...

Pin numbers are often used for phone logins, an authentication method for credit cards etc

Your challenge is to create a solution that can crack 4-digit pin numbers by brute force (trying every combination, from 0000 to 9999)

You should first create code to generate a random 4 digit pin

Then, you would want to try and crack it...

Hint: think about how you will generate the 4 digit pins - 0 and 15 would be invalid for example - they should be 0000 and 0015 respectively

Advice:

Think about how you will generate the 4 digit pins - 0 and 15 would be invalid for example - they should be 0000 and 0015 resptively

Further advice won't be given - use your own approach to implement a solution

Extension:

Adapt your code to work for passwords of 3 lowercase letters. Do you know how many combinations would be from "aaa" to "zzz"?

Now play the defender, rather than the attacker - implement logic to make the system more secure against brute-force attacks

Solutions

A-Level 9618