Compare commits
2 Commits
84c640a03c
...
efa1327691
Author | SHA1 | Date | |
---|---|---|---|
efa1327691 | |||
f0613543b2 |
27
241/fixme2.py
Normal file
27
241/fixme2.py
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
import random
|
||||
|
||||
|
||||
|
||||
def str_xor(secret, key):
|
||||
#extend key to secret length
|
||||
new_key = key
|
||||
i = 0
|
||||
while len(new_key) < len(secret):
|
||||
new_key = new_key + key[i]
|
||||
i = (i + 1) % len(key)
|
||||
return "".join([chr(ord(secret_c) ^ ord(new_key_c)) for (secret_c,new_key_c) in zip(secret,new_key)])
|
||||
|
||||
|
||||
flag_enc = chr(0x15) + chr(0x07) + chr(0x08) + chr(0x06) + chr(0x27) + chr(0x21) + chr(0x23) + chr(0x15) + chr(0x58) + chr(0x18) + chr(0x11) + chr(0x41) + chr(0x09) + chr(0x5f) + chr(0x1f) + chr(0x10) + chr(0x3b) + chr(0x1b) + chr(0x55) + chr(0x1a) + chr(0x34) + chr(0x5d) + chr(0x51) + chr(0x40) + chr(0x54) + chr(0x09) + chr(0x05) + chr(0x04) + chr(0x57) + chr(0x1b) + chr(0x11) + chr(0x31) + chr(0x5f) + chr(0x51) + chr(0x52) + chr(0x46) + chr(0x00) + chr(0x5f) + chr(0x5a) + chr(0x0b) + chr(0x19)
|
||||
|
||||
|
||||
flag = str_xor(flag_enc, 'enkidu')
|
||||
|
||||
# Check that flag is not empty
|
||||
if flag == "":
|
||||
print('String XOR encountered a problem, quitting.')
|
||||
else:
|
||||
print('That is correct! Here\'s your flag: ' + flag)
|
||||
|
||||
|
2
242/solve.py
Normal file
2
242/solve.py
Normal file
@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env python3
|
||||
print('picoCTF{gl17ch_m3_n07_' + chr(0x39) + chr(0x63) + chr(0x34) + chr(0x32) + chr(0x61) + chr(0x34) + chr(0x35) + chr(0x64) + '}')
|
Loading…
Reference in New Issue
Block a user