The invention discloses a tamper-proof MCU security data writing method and
system, and relates to the technical field of
data security, and the method comprises the steps: determining a to-be-upgraded MCU, obtaining an associated
upgrade data packet, calculating an initial hash value retention, generating a random
byte fragment according to a data size, and obtaining a
plaintext upgrade data packet fragment sequence; secondly, randomly sorting from the anti-
quantum encryption algorithm candidate
pool to determine an
encryption algorithm set sequence, generating a
plaintext encryption algorithm mapping table, encrypting the
plaintext encryption algorithm mapping table, and synchronously issuing the plaintext encryption algorithm mapping table along with a
ciphertext upgrading data packet fragment; after the to-be-upgraded MCU obtains the related
ciphertext, decryption is carried out to determine an encryption algorithm index,
ciphertext fragments are decrypted, a hash value is calculated in a combined mode, and upgrading or
rollback operation is determined; the MCU is monitored in real time in the process, all keys are cleared after the process is finished, data tampering is effectively prevented, and it is ensured that MCU upgrading is safe and reliable.