Skip to content

Instantly share code, notes, and snippets.

Last active February 5, 2019 21:44
What would you like to do?
Decrypt the whole file by XORing each byte with a Key
#!/usr/bin/env python3
__author__ = "Ahmad Bahaa"
__email__ = ""
Thanks to SalusLab for this challenge :)
filename = ''
out_filename = ''
xor_key = 0xEE
bytes_list = []
#reading the file byte-by-byte into our list
# Source:
with open(filename, 'rb') as f:
while 1:
byte_s =
if not byte_s:
byte = byte_s[0]
#XORing each byte with our key (0xEE) and saving all in a new list
bytes_list_2 = []
for i in bytes_list:
ii = i ^ xor_key
#write the result into a zip-file
with open(out_filename,'wb') as f:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment