The invention discloses an
encryption method and device, equipment, a medium and a program product, and relates to the technical field of
data processing. The method comprises the steps that L rounds of iterative
encryption are conducted according to
plaintext data, nonlinear coding data and a secret key table, confused
ciphertext data are obtained, the nonlinear coding data comprise input nonlinear inverse coding and output nonlinear coding, the input nonlinear inverse coding is used for offsetting output nonlinear coding added in preorder operation, and the output nonlinear coding is used for being offsetting in follow-up operation; and affine transformation and
hybrid nonlinear transformation are carried out on the confused
ciphertext data to obtain encrypted data corresponding to the
plaintext data, and the encrypted data are data after non-
linear coding introduced by counteracting multi-round iterative
encryption. Therefore, affine transformation data and the key table can be confused and protected, attacks from an external coding end can be effectively resisted after nonlinear coding
confusion, the security of the white-box SM4
algorithm is improved, a new
chip does not need to be added, and the encryption cost is reduced.