MCPcopy
hub / github.com/Threekiii/Awesome-Redteam / xor

Function xor

scripts/ShellcodeWrapper/shellcode_encoder_py3.py:36–41  ·  view source on GitHub ↗
(data, key)

Source from the content-addressed store, hash-verified

34# data as a bytearray
35# key as a string
36def xor(data, key):
37 l = len(key)
38 keyAsInt = list(map(ord, key))
39 return bytes(bytearray((
40 (data[i] ^ keyAsInt[i % l]) for i in range(0,len(data))
41 )))
42
43#------------------------------------------------------------------------
44def pad(s):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected