Locks are known as a fastening device. Locks are used to close doors and cupboards to avoid scrutiny by others and to maintain privacy. A lock can be either mechanical or electronic. A lock is opened using a key or a key card, even by punching in numbers in the form of a password. Locks can also be opened on identification of fingerprints. Locks prevent unauthorized access. Locks are of different types.