Chapter 20. The Final Phase, Creating a Door Unlocking Tool
We have everything ready for the escape. As I’ve already told you, I will be in charge of opening the final door. Right next to the exit there’s a desk with a computer from which you can access the entire system and, by the way, open the main door. Normally, five security keys are used and, without them, it’s impossible to open it. Needless to say, with my current computer knowledge it would be impossible for me to hack it.
However, Bud and Pedro know the system perfectly. They have been working with it for years and have even Programmed much of the code that controls the main security functions. They wanted to make things easier for me to ensure we can get out quickly and without complications. For this, they have created five Programs that are housed in five different classes. These classes are already hidden within the system, so my only task is to create a Main class and call the methods that are in them.

It’s a humble task, but of vital importance. I’m not going in blind; Bud has taken care of showing me the five Programs and explaining what they’re for. Additionally, we’ve already practiced how I should call the methods, so you could say I know by heart what I have to do. I wouldn’t want to get nervous and go blank right at the most critical moment.
To give you an idea, I’m going to show you the classes and give you an explanation of what each one is for. Obviously, Bud has spent a lot of time working on them and has checked many times that there are no errors that could compromise our escape.
1. Key Class
I had told you that five keys are needed to open the door normally. We only have one; we got it when we accessed Vicente’s office. We’re lucky, as it’s the most important one; thanks to it we can follow the other steps to, in the end, manage to completely disarm it. This class allows the system to verify that the key we have is still active and valid. Therefore, this class represents a key and verifies if the key is valid.
public class Key {
private String key;
public Key(String key) {
this.key = key;
}
public boolean Valid() {
// Simple key verification
return "correctKey".equals(this.key);
}
}
Once the access key is entered, the system wants to know who is the person trying to access. We will pretend to be the director. For this, we have his personal identification code. It’s very easy to know the identification number of any prison worker; it’s no secret, as it appears on any employee document or record.
2. AccessCode Class
This class represents an access code and verifies if the code is correct.
public class AccessCode {
private int code;
public AccessCode(int code) {
this.code = code;
}
public boolean isValid() {
// Simple access code verification (can be any logic)
return this.code == 1234;
}
}
3. Light class
For the door to open, it is absolutely mandatory that the light beam illuminating the door from the outside is on. This helps increase security and visibility in the area. However, we prefer darkness, so the cameras don’t detect us. Therefore, we must make the system believe that the light is on. We’ll do this with the following method.
public class Light {
public void turnOn() {
// Simulates turning on the light
System.out.println("The light is on.");
}
}
4. Alarm class
When the door opens without authorization, an alarm sounds, and we don’t want that to happen. We must create a method that indicates that the alarm is activated, although we have already taken care of deactivating it previously.
public class Alarm {
public void enable() {
// Simulates that the alarm is active.
System.out.println("The alarm is activated.");
}
}
5. Door class
Finally, we want to deceive the security system and indicate that the door is open. We’ll simply have to create a class that indicates that, indeed, the door is open. That way, it really will be open and, at last, we’ll be able to get out.
public class Door {
public void open() {
// Simulates opening the door
System.out.println("The door is open.");
}
}
Clase Main
In this class, we create the necessary objects and call their methods to open the door.
public class Main {
public static void main(String[] args) {
// Create objects
Key key = new Key("67898");
AccessCode accessCode = new AccessCode(787656);
Light light = new Light();
Alarm alarm = new Alarm();
Door door = new Door();
// Process to open the door
if (key.isValid() && accessCode.isValid()) {
light.turnOn();
alarm.enable();
door.open();
} else {
System.out.println("The key or access code is incorrect. The door cannot be opened.");
}
}
}
Basically, this is everything. Let’s hope everything goes well tonight. It has taken a lot of effort to get here, and it would be a big problem not to achieve our escape. Although it would be much worse if we got caught. If that happened, I would be facing a long time locked up, Rich would go unpunished, and justice would never be served.