Rating:

# AP Lab: Computer Science Principles

>This activity will ask you to reverse a basic program and solve an introductory reversing challenge. You will be given an output that is to be used in order to reconstruct the input, which is the flag.
>
>Note: The "Student Guide" isn't needed to solve the challenges in this series.
>
>Author: AC

We are reversing a Java program. The program is asking for a password. I'm assuming the password is the flag.

```java
inp=shift2(shift(inp));
if (inp.equals("inagzgkpm)Wl&Tg&io")) {
System.out.println("Correct. Your input is the flag.");
}
else {
System.out.println("Your input is incorrect.");
}
```

The input is put into two functions, `shift` and `shift2`. The output must be that obfuscated string or else the password is incorrect.

Because we are working our way backwards, let's start with `shift2()`

```java
public static String shift2(String input) {
String ret = "";
for (int i = 0; i

Original writeup (https://github.com/Jord4563/CTF-writeups/tree/master/HSCTF2020/cs-principles).