# What is the Physical Process of Corrupting a Magnetic Key Card and Is There a Detectable Difference Between a Corrupted and Non-Corrupted Card?

I was just watching the BBC show Sherlock, S3E3: His Last Vow and I got to the part where John and Sherlock are breaking into the penthouse office. The technique Sherlock employs to get into the office is corrupting a standard magnetic keycard and relying on the fact that it would not read as the wrong card. This question is twofold because I haven't found an answer to either part in my research.

First: Magnetic keycards function by lining up a bunch of tiny iron magnets, polarized to be pointing either one way or the other (I'll just call them up and down) in a strip. This strip then encodes a sequence of ups and downs that is unique to the keycard and can be read by a card reader. There is a widely disputed question as to whether or not these magnetic strips can be corrupted by being near external magnetic fields, such as a phone. Assuming they can be corrupted in this way, what is the mechanism of corruption? What does it actually mean for a magstrip to be "corrupted"?

Second: This question relies strongly on the answer to the first and is more tied in with the show I was watching. If a keycard is corrupted, would a keycard reader read the card as corrupted or just as the wrong card? If I were to assume the simplest mechanism I can think of for corrupting a keycard, which would have the external magnetic field flip random bits in the sequence, it would seem that there would be no noticeable difference between a corrupted and a non-corrupted keycard.

One way there might exist a difference is if all keycards for a specific reader possessed a very similar sequence that only differed by a few bits for each card. Then a card could be considered corrupted if the sequence that should be common to each card was different. But then, why not just use a card from a completely different reader to get the same effect of swiping a corrupted card?

The only other explanation I can think of is that the corruption manifests itself in some other way that makes it obvious that there is in fact corruption of the magstrip.

Thanks to anyone who can offer me helpful resources or explanations.

• It just needs a magnetic field that is stronger than the coercive field of the magnetic strip. A phone won't do much. But neodymium magnet can reorient the magnetization. – Pieter Mar 13 '18 at 18:58
• I can attest to neodymium magnets messing up key-card strips, I have accidentally done this a number of times, especially with hotel key-cards that are frequently recoded. None of these times did the key-card reader allow me through. It would be a very insecure and stupid system allowing unreadable cards access... although it might make normal users happy and hence reduce customer complaints. – Anders Sandberg Mar 13 '18 at 20:04