Combination lock

A **combination lock** is a lock that is opened with a set of secret numbers instead of a key. Mechanical combination locks usually have a dial that is rotated to three different numbers (four numbers on some safe locks) to open the lock. Electronic combination locks usually have a keypad where the combination can be entered like a telephone number.

## Mechanical combination lock 
The mechanical combination lock usually has three discs inside. The last disc is connected directly to the dial, and a notch on this disc rotates the second disc. A notch on the second disc in turn rotates the first disc. The lock is usually opened by rotating the dial clockwise to the first number, counterclockwise past the first number and to the second number, and clockwise to the third number (some locks use the reverse directions, and most safe locks require a return to 0 after entering the combination). This type of lock is popular on safes and padlocks. It is available for entry doors, but is not popular due to the amount of time required to enter the combination. The combination is usually set at the factory and can not be changed easily (if at all).

## Electronic keypad lock 
The electronic combination lock uses a keypad that looks similar to a telephone keypad. The combination is entered one number at a time, like a telephone number. When the number is entered, a motor opens the lock. This type of lock is popular on safes and doors, but is almost never seen on padlocks. These locks require batteries or another source of electricity. There is sometimes a key backup in case the batteries die or the electronics fail. Most safe locks do not have a key backup, as a key backup can be picked. Most electronic locks allow the user to set the combination.

## Advantages 
Combination locks can not be picked (as long as there is no key backup), and the user does not have to carry a key. There is little chance of getting locked out as long as the user is good at remembering the combination.

## Disadvantages 
Mechanical combination locks can be difficult to use for people who have never used one before. The most common mistakes are forgetting to pass the first number when dialing the second number, and rotating the dial backwards. In an electronic combination lock, the batteries can die, preventing the lock from opening until the batteries are replaced. With most combination locks, it is possible for a thief to obtain the combination by watching a legitimate user entering it. On an electronic combination lock, a thief can sometimes guess the combination based on the amount of wear on the buttons. An example of worn buttons can be seen in the photo on the right. More-modern keypad locks require the user to press one or two other buttons indicated by LEDs after the combination is entered. This causes the other buttons that are not part of the combination to wear down as well, preventing a thief from determining which numbers are part of the combination based on wear marks.

# Can be time-consuming: If you forget the combination to your lock, it can be time-consuming and frustrating to try to open it.
# Limited combination possibilities : Some combination locks have a limited number of possible combinations, which can make them easier to crack.
# Vulnerable to brute force attacks: Combination locks can be vulnerable to brute force attacks if the attacker knows the correct sequence of numbers or symbols.
# Not suitable for high-security situations: While combination locks are secure, they may not be suitable for high-security situations where the consequences of a security breach are severe.