Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ricardojba/092b31f63abf3e89b36a084b9fa9a909 to your computer and use it in GitHub Desktop.

Select an option

Save ricardojba/092b31f63abf3e89b36a084b9fa9a909 to your computer and use it in GitHub Desktop.
# ncat madlabs.pw 1337
encrypted_flag = bytes.fromhex("418831b6416977a29459e1071f4a08ceb24beed7d9364ca2b23460")
encrypted_plaintext = bytes.fromhex("61a81196414f558eaa09f6390c181cdce075bec5e7301ef7a7747c77")
known_plaintext = b"flag{" + b"a" * 50
key = bytes(x ^ y for x, y in zip(encrypted_plaintext, known_plaintext))
flag = bytes(x ^ y for x, y in zip(encrypted_flag, key))
print(flag)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment