A program execution device that executes a first secure program which runs in a secure processing mode and a second secure program which runs in a normal processing mode, the program execution device comprising: an execution unit operable to operate by switching between the secure processing mode and the normal processing mode; a first protection unit operable to disconnect the execution unit from an external device according to an instruction of the first secure program in the secure processing mode, a memory configured to store the first secure processing program and the second secure processing program; wherein the execution unit is operable to execute a tamper detection program in the first secure program to judge whether or not at least part of the second secure program is tampered with, in the secure processing mode, and in the secure processing mode, interruption of the first secure program is prohibited, and the execution unit is disconnected from the external device; wherein the first secure processing program is called by a calling program, which passes tamper detection data made up of a tamper detection value, a TRS area start address, a binary size, and an encrypted key to the first secure processing program; wherein the tamper detection program contains a secret key, and detects whether the second secure processing program has been tampered with, by acquiring the tamper detection data including the tamper detection value, the TRS area start address (542, the binary size, and the encrypted key, from the calling program of the second secure processing program; wherein the tamper detection program reads an amount of data corresponding to the binary size from a position on the memory specified by the TRS area start address, as the TRS area program; the tamper detection program calculates a hash value of the TRS area program using the secret key according to a hash function; the tamper detection program compares the calculated hash value and the tamper detection value; and if the two values match, the tamper detection program judges that the second secure processing program has not been tampered with, else if the two values do not match, the tamper detection program judges that the second secure processing program has been tampered with, and discontinues subsequent processing. an execution unit operable to operate by switching between the secure processing mode and the normal processing mode; a first protection unit operable to disconnect the execution unit from an external device according to an instruction of the first secure program in the secure processing mode, a memory configured to store the first secure processing program and the second secure processing program; wherein the execution unit is operable to execute a tamper detection program in the first secure program to judge whether or not at least part of the second secure program is tampered with, in the secure processing mode, and in the secure processing mode, interruption of the first secure program is prohibited, and the execution unit is disconnected from the external device; wherein the first secure processing program is called by a calling program, which passes tamper detection data made up of a tamper detection value, a TRS area start address, a binary size, and an encrypted key to the first secure processing program; wherein the tamper detection program contains a secret key, and detects whether the second secure processing program has been tampered with, by acquiring the tamper detection data including the tamper detection value, the TRS area start address (542, the binary size, and the encrypted key, from the calling program of the second secure processing program; wherein the tamper detection program reads an amount of data corresponding to the binary size from a position on the memory specified by the TRS area start address, as the TRS area program; the tamper detection program calculates a hash value of the TRS area program using the secret key according to a hash function; the tamper detection program compares the calculated hash value and the tamper detection value; and if the two values match, the tamper detection program judges that the second secure processing program has not been tampered with, else if the two values do not match, the tamper detection program judges that the second secure processing program has been tampered with, and discontinues subsequent processing.