Skip to content

Instantly share code, notes, and snippets.

@komen205
Created November 20, 2022 10:04
Show Gist options
  • Save komen205/aa415acaa2fbb3a086904cc420a8b323 to your computer and use it in GitHub Desktop.
Save komen205/aa415acaa2fbb3a086904cc420a8b323 to your computer and use it in GitHub Desktop.
SquareCTF 2022 Yara Challenge "Yet Another Reversing Activity"
```
Create removed.txt file
5F 39
33 5F
F8 99
53 34
F8 83
9A F7
DD EE
5C 6F
F9 8D
F9 A6
C8 A5
80 E5
86 D9
0D 3C
65 0B
77 28
8F B8
80 E8
AA 99
28 77
69 08
56 24
A1 92
2A 44
EC D8
EA 97
```
def encrypt1(var, key):
return bytes(a ^ b for a, b in zip(var, key))
assert encrypt1(b'hello', b'supersecretkey') == b'\x1b\x10\x1c\t\x1d'
file = open("removed.txt","rb")
with file as f:
data = f.read().splitlines()
for line in data:
splitLine = line.split(b' ')
encryptedStuff = encrypt1(splitLine[0],splitLine[1])
asd = int(splitLine[0],16) ^ int(splitLine[1],16)
print(chr(asd))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment