The present invention provides a special structure of magnetic elements,
e.g. MRAM elements, as a security device for IC's containing magnetic
memory cells. In an example embodiment, the structure may comprise a
combination of two or more associated magnetic elements with pre-set
anti-parallel magnetization directions. By determining the polarisation
directions of the magnetic elements, exposure to an external magnetic
field can be detected. Inverse polarisation directions indicate a normal
situation, aligned polarisation directions indicate that the MRAM-array
has been exposed to an external field. In this way it can be detected
whether a user has tried to erase or alter the data stored in the MRAM in
an illegal way. The IC can regularly check the resistance of the security
system during operation. Upon detection of a field exposure, the IC can
erase all MRAM data, reset itself or, block its functioning.