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.