Please tell me if I understand the initial IP permutation table in Serpent encryption. Because it is used when receiving round keys, and each key K0={w0,w1,w2,w3} w0 is 32 bytes in size, but the IP table has 128 values, which means you need to glue 4 keys to get a 128-bit key. Then each bit of the 128-bit key goes to the corresponding cell. For example, K0={0xBBBBBBBB,0xBBBBBBBB,0xBBBBBBBB,0xBBBBBBBB} translate everything into bin

 10111011101110111011101110111011,10111011101110111011101110111011,10111011101110111011101110111011,10111011101110111011101110111011 

The first 5 values ​​in IP are 0, 32, 64, 96, 1, which means the zero bit goes to the zero position, 32 bits to the first, 64 to the second, 96 to the third, 1 bit to the fourth.
This means: 11110 and so on. In other words, we simply take the position according to the IP table in the glued 128-bit string and transfer it to a new position. In any case, this is what happens in DES. But still in Serpent, in my opinion, IP / Inv IP does not work that way.

    1 answer 1

    @Rrace8 , why are you trying to independently implement the Serpent permutations?

    Firstly, this is a rather dreary task, and secondly, it is largely meaningless. There are reference (exemplary) Serpent implementations - google or just click here .

    Bit permutations are usually quite complicated to implement, and the cryptographers themselves are involved in them.

    • It's just that an IP table is given on Wikipedia, and it is said that the “32nd bit will go to the 1st position”, I thought that we are doing IP, as in DES. It turns out that the example that I gave is wrong, and IP can not be done this way? - Rrace8