The invention discloses a method and apparatus for implementing a lightweight
block cipher SCS. A turn key and a control key are divided in keys, the round key participates in a round key adding operation, the control key controls the generation of each turn of
S box to obtain a random
S box, the update of the control key and the turn key is related to the operation result of the last turn, the Sbox used in each turn is random, the operation result of each turn is also random, so that the degree of
confusion can be increased; in a
round function, a high pseudo-random P permutation is generated by the Mason rotation
algorithm in each round to achieve the
diffusion, and after the end of the
round function iteration, row shift and the column
confusion transform are executed, so that the
diffusion effect is enhanced by using the dual
diffusion mode, and the security is improved. Compared with the situation that the difference between the
resource consumption of fixed
cipher structures isnot large, the internal structure of the device has the advantages of greatly improving the security of the scheme, and increasing the defense coefficients of linear
attack, differential
attack and the like to a certain extent.