mipText is any Binary string
keys like: (48, 34, 65, 168, 91, nn)
And please explain me code below
def test(mipText,keys):
mipText = list(mipText)
for i, encryptedChar in enumerate(mipText):
mipText[i] = encryptedChar ^ keys[i & 0xFF]
return mipText
It creates a list out of the contents of a file
eg.
“Hello Word” after unpack becomes [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]
then it XORS each index with a value from key (eg. 0b010101 ^ 0b110011 = ‘0b100110’)
i&0xFFjust ensures the index of keys will never be greater than 0xff (255) …basically the same asi%256only faster