Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- KEY = 'musZTXmxV58UdwiKt8Tp'
- def xor_str(x, y):
- if len(x) > len(y):
- return ''.join([chr(ord(z) ^ ord(p)) for (z, p) in zip(x[:len(y)], y)])
- else:
- return ''.join([chr(ord(z) ^ ord(p)) for (z, p) in zip(x, y[:len(x)])])
- key = KEY.encode('hex')
- cipher = open('flag.enc','r').read()
- dec = xor_str(key*632,cipher)
- file = open('flag.png' ,'w')
- file.write(dec.decode('hex'))
- file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement