We start by downloading the provided file.
It looks weird and we can't really tell what it is. Luckily there is an image that might help us.
If we look at the image we see someone who looks like caesar. This might be a hint that we have to use the caesar cipher.
Because normal caesar cipher won't work with theses characters we have to find another way to solve this.
After googling a bit we stumble upon ascii caesar cipher. We can check for it using this website: https://www.dcode.fr/ascii-shift-cipher.
The calculated offset of
def load_file(path):
with open(path, "rb") as file:
return file.read()
def caeser_ascii(message, shift):
decoded = b''
for char in message:
decoded += bytes([(char + shift) % 128])
return decoded
print("Enter path to file:")
file_path = input()
encoded = load_file(file_path)
print(encoded)
decoded = caeser_ascii(encoded, -49)
print(decoded)
This outputs
def load_file(path):
with open(path, "rb") as file:
return file.read()
def caeser_ascii(message, shift):
decoded = b''
for char in message:
decoded += bytes([(char + shift) % 128])
return decoded
def caeser(message, shift):
# only shift letters
decoded = b''
for char in message:
if char >= 65 and char <= 90:
decoded += bytes([(char - 65 + shift) % 26 + 65])
elif char >= 97 and char <= 122:
decoded += bytes([(char - 97 + shift) % 26 + 97])
else:
decoded += bytes([char])
return decoded
print("Enter path to file:")
file_path = input()
encoded = load_file(file_path)
print(encoded)
decoded = caeser_ascii(encoded, -49)
print(decoded)
decoded = caeser(decoded, -9)
print(decoded)
This outputs the correct flag.