to select 15 the appropriate row and four bits b 2 5 of the input value are used to select the column in table 1 referring to fig2 a block diagram of a portion of the sbox of fig1 is shown constructed according to an embodiment of the present invention four bits b 2 5 are provided as inputs to each of four look up tables 11 12 13 14 in this embodiment lut 11 is used to generate an intermediate bit value i 1 which is input to a first multiplexer 15 a second lut 12 is used to generate an intermediate value i 2 that is also input to the first multiplexer third and fourth intermediate values i 3 i 4 are output by third and forth luts 13 14 respectively the outputs of the third and fourth luts are provided to a second multiplexer 16 two bits b 1 and b 6 are provided as control inputs to multiplexers in the circuit of fig2 for example bit b 1 is used as the control input for multiplexers 15 and 16 depending on the value of bit b 1 one of the inputs to each multiplexer is selected and output to a third multiplexer 17 bit b 6 is used as the control input to the third multiplexer to select one of the outputs of multiplexers 15 and 16 in this embodiment the sbox shown in fig2 produces the first bit s 1 of the four.