MCPcopy Create free account
hub / github.com/0xJs/RedTeaming_CheatSheet / xor

Function xor

coding/projects/Dropper_XOR_Favicon_Notepad/xorencrypt.py:5–16  ·  view source on GitHub ↗
(data, key)

Source from the content-addressed store, hash-verified

3KEY = "privatekeyforxorencryptionfunction"
4
5def xor(data, key):
6
7 key = str(key)
8 l = len(key)
9 output_str = ""
10
11 for i in range(len(data)):
12 current = data[i]
13 current_key = key[i % len(key)]
14 output_str += chr(ord(current) ^ ord(current_key))
15
16 return output_str
17
18def printCiphertext(ciphertext):
19 print('{ 0x' + ', 0x'.join(hex(ord(x))[2:] for x in ciphertext) + ' };')

Callers 1

xorencrypt.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected