The invention relates to the technical field of
chip software security, and discloses a
chip software code anti-
attack protection method, a
chip and electronic device.The method comprises the steps that in the running process of a chip
software code, when the chip software code is executed to the position of a burying point, a
random delay duration is generated, and the burying point is arranged at a to-be-protected node in the chip software code; pausing a main process of the chip software code and continuing the
random delay duration; and after the
random delay duration expires, recovering the main process of executing the chip software code. Based on the above method, for two or more
fault injection attacks, random
delay at the burying point enables the starting time of the key protection step to be uncertain, an attacker cannot repeatedly match the
attack point, and key inspection is difficult to skip; for side channel attacks, random
delay makes information such as
execution time, chip
power consumption and the like irregular, and attackers cannot extract rule features to reversely deduce sensitive data, so that
attack logic is fundamentally cracked, and the security defect of an existing anti-attack protection scheme is made up.