# Create a bijective and invertible table that are depending on the cipher key

I'm creating my own symmetric-key algorithm that in many ways are similar to DES. My key is 16 bits long and is random generated, I will encrypt blocks of 16 bit strings that are split into two 8 bit strings. My approach is to make a 4x8 table where row one is selected if the decimal representation of the key is between 0 and 15000, row two if between 15000 and 30000, and so on. The column is chosen by the 3 last binary digits of the 8 bit string that will be encrypted. So column one is chosen if the three last digits is 000 and column 8 will be chosen if the three last is 111.

This metod works for encryption but I need the same function to work for decryption too. The boxes in the table is decimal numbers. How is it possible to make this approach work for my purpose?

In the picture both left and right side are the same function and thats how I want it to work. • This is a toy-cipher I guess? 16 bit keys are not going to offer any kind of practical security, and just doing one round is definately not enough regardless of your S-box. But since you referenced DES: That is a Feistel network, where you don't need a bijective S-box in contrast to substitution-permutation networks like AES. – tylo Nov 29 '16 at 15:55

• You have 16 bit keys but you use effectively only 2 bits to select one of $2^2$ rows. You have essentially only 4 distinct keys.
• You have 8 bit inputs but you use effectively only 3 bits to select one of $2^3$ columns. This gives you many inputs ($2^5=32$) mapping to the same entry in the lookup table so no bijective map is possible.