I'm reversing a cryptographic algorithm. This is part of the encryption function translated to python (starting from assembly code):
cleartext = [ 0x24,0x11,0x33,0x63,0xbc,0x59,0x07,0x5b,0x96,0x4b,0x07,0x15,0x2d,0x23,0x4b,0x70 ] clearlen = 16 # Init the dictionary cdict = [ 0 ] * 256 for i in range(256): cdict[i] = i v1 = 0 # Load the dictionary for i in range(256): v1 += (cleartext[ i % clearlen ] + cdict[i]) v1 = v1 & 0xFF v2 = cdict[v1] ^ cdict[i] cdict[i] = v2 v3 = cdict[v1] ^ v2 cdict[v1] = v3 cdict[i] ^= v3
Then this array of 256 bytes is used to extract clearlen bytes which are XORed with a key. I didn't translate it to python yet.
I was trying to understand if this was a known cryptographic algorithm, or it is completely custom. So far I was not able to identify it. Do you?