Skip to content

Instantly share code, notes, and snippets.

@pavunato
Created November 7, 2017 03:05
Show Gist options
  • Select an option

  • Save pavunato/492425e7a3aa165501e86887d0ea4a56 to your computer and use it in GitHub Desktop.

Select an option

Save pavunato/492425e7a3aa165501e86887d0ea4a56 to your computer and use it in GitHub Desktop.
import sys
import base64, string
flag = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
def addition(data, key):
enc = ''
for c in data:
enc += chr((ord(c) + key) & 0xFF)
return enc
def xor(data, key):
enc = ''
for c in data:
enc += chr(ord(c) ^ key)
return enc
if base64.b64encode(xor(addition(flag, 0xCA), 0xFE)) == '49714ODgAgQF/7vAzBXD180Q17/MA8ID1xDR08HCzf+919IDzwXGw7k=':
print 'Congrats! You found the flag.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment