# Terminator 2 – Code Cracking

## The Movie

Terminator 2: Judgement Day is the 1991 sequel to the original 1984 film The Terminator, with the iconic Arnold Schwarzenegger starring as the unstoppable, time travelling terminator cyborg. The young protagonist John Connor spends a bit of time cracking codes in the movie, firstly for criminal and later for life saving reasons.

## Math Situation 1: Cracking an ATM card code

A young John Connor engages in a number of criminal activities, including stealing money from other people’s bank accounts. In one of the early movie scenes, John uses a computer (an Atari Portfolio) to plug into an ATM machine and crack the code on an account.

After a few seconds, the machine spits out the pin code for the account: 9003. A lot of pin codes even nowadays (the movie is now 25 years old) are 4 digits and can only contain numbers.

If we assume that he’s trying a brute force attack and can try 500 pin codes per second, then we can calculate the maximum time it will take to crack the code:

*maximum decoding time = number of combinations / combinations tried per second*

The number of possible pin code combinations depends on the **number** of digits in the pin code – 4 – and the number of possible digit types – 10 in total (0, 1, 2, 3, 4, 5, 6, 7, 8, 9).

*number of combinations = number of possible digit types^(number of digits)*

*number of combinations = 10^4*

*number of combinations = 10000*

Now we can calculate the maximum code cracking time:

*maximum decoding time = 10000 / 500*

*maximum decoding time = 20 seconds*

## Math Situation 2: Cracking Cyberdyne’s Security Code

When the team gets to the Cyberdyne systems building security is alerted and the building goes into lockdown.

John is once again required to get out his code cracking portable computer and try and crack the code for a security door.

In this scene the pin code for the door is, conveniently, also 4 digits – 7256

Normally however the security at a high tech robot firm is a lot tighter than for a personal bank account. If John only had five minutes to crack the code – how many extra digits could he handle?

*A 4 digit code takes up to 20 seconds to decode*

*Each extra digit multiples the maximum possible time taken by a factor of 10. So:*

*4 digits: 20 seconds*

*5 digits: 200 seconds = 3 minutes 20 seconds*

*6 digits: 2000 seconds = 33 minutes 20 seconds*

So John could probably have handled one extra digit, but not two extra digits.

## Real Life Example – Brute Force Attack

One of the simplest methods for cracking the cryptography behind a lot of the security used for online operations such as email, bank transactions etc… is called a **brute force attack**.

This attack is time consuming but simple – the hacker or computer program tries every possible pin code or password until it gets the right one.

It has many weaknesses – apart from anything, better security systems will slow you down or stop you trying to enter a password after a few tries.

However, for systems that aren’t that sophisticated, it’s possible to calculate how long it would take – which is covered in this tutorial section.