Magnetic keyed lock

A magnetic keyed lock or magnetic-coded lock is a locking mechanism whereby the key utilizes magnets as part of the locking and unlocking mechanism. Magnetic-coded locks encompass knob locks, cylinder locks, lever locks, and deadbolt locks as well as applications in other security devices.
Design.
A magnetic key uses from one to many small magnets oriented so that the North / South Poles would equate to a combination to push or pull the lock's internal tumblers thus releasing the lock. This is a totally passive system requiring no electricity or electronics to activate or deactivate the mechanism. Using several magnets at differing polarity / orientations and different strengths can allow thousands of different combinations per key. 
Magnetic-coded technology utilizes multiple pairs of magnetic pins with opposing poles that are embedded inside keys and plugs. When a correctly matched key is inserted into the lock, not only are all the mechanical pins pushed into the correct positions, the magnetic pins are also driven to the appropriate level by the magnetic force inside the key.
The magnetic pins are made with permanent magnets which means the magnets stay magnetized. The intensity of the magnet will not decay over time or be affected by other magnetic fields.
Security.
In order to open a magnetic-coded lock, three criteria must be met: correct teething of the key, magnetic pin locations and poles of the magnetic pins. If any of these three criteria are not satisfied, the lock stays inoperable and cannot be turned.
Traditional lock picking is impossible due to the tumblers being magnetically operated instead of via a physical up and down action. Magnetic keys also cannot be reproduced by locksmiths by sight or other "human sensed" information. 
Equation.
where
History.
The magnetic-coded lock was invented by an engineer in Nanchang, China. There have been several Chinese patents taken out on this technology. 