Locksmiths began as the science and art of making and defeating locks. A lock is a mechanism that secures buildings, rooms, cabinets, objects, or other storage facilities. A key is often used to open a lock. Means of opening a lock may include a security token or two-factor authentication for greater security, such as requiring both something you know (a combination) and something you have (a key or key-card).
The oldest known lock was approximately 4,000 years old and was of Egyptian make. It was found in the palace ruins of Emperor Sargon II in Khorsabad. It used the same pin tumbler principle employed by many modern locks. Here are some examples of locks from ancient Egypt, and a modern pin tumbler lock. The principle for which each operates is the same.