Skip to content

Instantly share code, notes, and snippets.

@shreyansh26
Created November 29, 2019 19:02
Show Gist options
  • Save shreyansh26/391d4103c8175cd3484c286d7c51dfd7 to your computer and use it in GitHub Desktop.
Save shreyansh26/391d4103c8175cd3484c286d7c51dfd7 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
img = bytearray(open('matrix_modified.bmp', 'rb').read())
key = "matrix"
new_f = []
for i, x in enumerate(img):
new_f.append(hex(ord(key[i%6]) ^ x))
result = bytes([int(x,0) for x in new_f])
with open("image.bmp", "wb") as newFile:
newFile.write(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment