The invention relates to a non-porous magnetic code lock, and a key mated with the non-porous magnetic code lock for use, wherein the lock comprises a lock shell, a lock cylinder, a lock
machine and a lock head, wherein the lock cylinder consists of
a domain board, domain columns, a first
steel ball, a support plate and a
tappet; the lock
machine and the lock head are formed by a second
steel ball, a cylindrical ball rack and a cylindrical baffle; and the key comprises an outer shell, a main board, a key core and a magnetic. In the non-porous magnetic code lock and the key, the movement range of the first
steel ball is limited by a hole in the domain board and a space formed by the domain columns, so that the movement area of the first steel ball is reduced, and the volume of the lock is effectively reduced; by reasonably designing the shape, the outer
diameter, the arrangement manner and the distance of the domain columns and the key hole, code position is added, secrete key quantity exceeds eight hundred thousand, the produced lock and key have small volumes, and are convenient to carry; the lock is not limited by the installation space of an installation site, can be applied to a door lock, a padlock, a bicycle lock, a motorcycle lock, a luggage lock, a door lock for an
electric equipment cabinet, even a
bottle cap lock, thus having wide application range; and the designed key is matched with a key sheath, thus being convenient to use, and having no
magnetic leakage to outside.