Kemarin pas pemanasan gemastik14 kebagian soal reverse engineering, langsung aja bedah
Soal :
import java.util.*;
public class KodeBit {
public static void main(String[] args) {
System.out.print("Enter Password: ");
Scanner s = new Scanner(System.in);
String user_key = s.next();
if (user_key.length() != 16) {
System.out.println("Wrong");
return;
}
char[] verify_arr = {131,195,194,67,1,225,66,2,73,233,0,35,33,9,193,192};
ArrayList<Character> user_arr = new ArrayList<Character>();
char[] user_submitted_arr = user_key.toCharArray();
for (char ch : user_submitted_arr) {
user_arr.add((char)((((ch << 5) | (ch >> 3)) ^ 111) & 255));
}
int i;
for(i = 0; i < 16; i++) {
if (!user_arr.get(i).equals((char)verify_arr[i])) {
System.out.println("Wrong");
return;
}
}
System.out.println("Success");
}
}
the key is here :
for (char ch : user_submitted_arr) {
user_arr.add((char)((((ch << 5) | (ch >> 3)) ^ 111) & 255));
}
Buat solving pake python :
verify_arr = [131,195,194,67,1,225,66,2,73,233,0,35,33,9,193,192]
key = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(16):
for k in range(128):
if verify_arr[i] == (((k << 5) | (k >> 3)) ^ 111) & 255:
key[i] = chr(k)
flag = ''
for i in key:
flag += i
print(flag)
Top comments (3)
Mang tagnya typo untuk
#reverseengginering !== #reverseengineering
oooh oke, makasih infonya
Thank you!