A tamper resistant microprocessor has a task state table for assigning a
task identifier to a task that can take a plurality of states, and
storing a state of the task in correspondence to the task identifier; a
task register for storing the task identifier of a currently executed
task; an interface for reading a program stored in a form encrypted by
using a program key at an external memory, in units of cache lines, when
a request for the task is made; an encryption processing unit for
generating decryption keys that are different for different cache lines,
according to the program key, and decrypt a content read by the
interface; a cache memory formed by a plurality of cache lines each
having a tag, for storing the task identifier corresponding to a
decryption key used in decrypting each cache line in the tag of each
cache line; and an access check unit for comparing the task identifier
stored in the tag of each cache line with a value of the task register,
and discarding a content of each cache line when the task identifier in
the tag and the value of the task register do not coincide.