The embodiment of the present application provides a
mask protection method and device for the
Advanced Encryption Standard AES
algorithm, including performing XOR
processing on the data carrying the i-th round
mask and the key data, reusing N multiplication modules to perform inversion operation and affine transformation, performing row transformation, if i=10, performing
mask compensation, and then performing demasking
processing, outputting the
ciphertext processed by the key data, if i<10, after column
confusion, performing mask compensation, obtaining the j-th round data carrying the mask, and continuing to perform the step of performing XOR
processing on the j-th round data carrying the mask and the key data, j=i+1, 2≤j≤10. That is to say, when performing the inversion operation, the multiplication module is reused to optimize the inversion operation in the AES
algorithm. Compared with the resources required by the multiplication module in other protection methods, the resource overhead occupied by the multiplication module in the present application is greatly reduced, meeting the requirements of reducing the use of resources and reducing resource overhead of the protection method.