Patent ID: 7650515

Claim:
A secure processing device comprising: a secure storage unit having a first memory that is to be protected from unauthorized access from outside, the first memory holding first target data in a normal power mode and losing the first target data in a power saving mode; a protection storage unit having a second memory that is to be protected from the unauthorized access from outside, the second memory holding data in the power saving mode; an encryption/decryption unit operable to encrypt the first target data to generate ciphertext during a first switching process, and decrypt the ciphertext to generate second target data during a second switching process, the first switching process being switching from the normal power mode to the power saving mode, and the second switching process being switching from the power saving mode to the normal power mode; a generation unit operable to generate a first authentication code based on the first target data during the first switching process, and to generate a second authentication code based on the second target data during the second switching process; a switch control unit operable to, during the first switching process, cause (i) the generation unit to generate the first authentication code, based on the first target data, (ii) the second memory of the protection storage unit to store therein the first authentication code, (iii) the encryption/decryption unit to encrypt the first target data, and (iv) an external memory to store therein the ciphertext; an authentication code generation control unit operable to, during the second switching process, cause (i) the encryption/decryption unit to decrypt the ciphertext stored in the external memory, and (ii) the generation unit to generate the second authentication code, based on the second target data; a judgment unit operable to judge whether or not the second authentication code is identical with the first authentication code; and a restoration control unit operable to prohibit restoring of the second target data to the secure storage unit when the judgment is in the negative, and restore the second target data to the secure storage unit when the judgment is in the affirmative.