In Python3, the bytes object already knows it's length, so there is no need to pass it into the function explicitly > def LFSR(data, iv): I'm not sure on how to get started on this and my Python knowledge is at the novice level. String LFSR(int dataLength, BYTE * data, unsigned char initial_value) The function should adhere to the following signature: if 0101 was shifted andįor example, if the register contains 0x82, stepping it would produce 0x41. If the bit shifted out of the register is a one, xor the register with 0x95 (e.g.The next byte of the key is read from the shift register after each step. The shift register is initialized with a value and stepped to produce the key stream. For this version, you'll be using an 8‐bit shift register. A problem occurs when this is used on file formats like portable executable that contain lots of nulls, since xor'ing nulls with your key ends up writing your key out.Ī slightly more complex algorithm is to implement a linear feedback shift register to generate a key stream which will be xor'ed with the data. "A common technique for obfuscating data is to use exclusive‐or (xor) and some key it is inexpensive and symmetric. ![]() I'd like some input from anyone on how to implement this algorithm in Python:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |