Skip to content

Instantly share code, notes, and snippets.

@AnnikenYT
Created November 22, 2025 14:24
Show Gist options
  • Select an option

  • Save AnnikenYT/8d737dce600101fa887604297b84e545 to your computer and use it in GitHub Desktop.

Select an option

Save AnnikenYT/8d737dce600101fa887604297b84e545 to your computer and use it in GitHub Desktop.
import struct
def decrypt_transmission(encrypted):
FLAG_LEN = 30
XOR_KEY = [0x42, 0x73, 0x21, 0x69, 0x37]
MAGIC_ADD = 0x2A
buffer = bytearray(encrypted)
for i in range(FLAG_LEN):
buffer[i] ^= i
for i in range(FLAG_LEN):
buffer[i] = (buffer[i] - MAGIC_ADD) % 256
for i in range(0, FLAG_LEN, 2):
buffer[i], buffer[i + 1] = buffer[i + 1], buffer[i]
for i in range(FLAG_LEN):
buffer[i] ^= XOR_KEY[i % 5]
return buffer.decode('utf-8')
if __name__ == "__main__":
TARGET = [
0x5A, 0x3D, 0x5B, 0x9C, 0x98, 0x73, 0xAE, 0x32, 0x25, 0x47,
0x48, 0x51, 0x6C, 0x71, 0x3A, 0x62, 0xB8, 0x7B, 0x63, 0x57,
0x25, 0x89, 0x58, 0xBF, 0x78, 0x34, 0x98, 0x71, 0x68, 0x59
]
encrypted = bytearray(TARGET)
decrypted = decrypt_transmission(encrypted)
print("Decrypted flag:", decrypted)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment