Lock development throughout history has been a continuing battle between lock designers and lock breakers, who figure out ways to defeat innovation.
Locking devices have been used ever since there were cave dwellers who wanted to protect themselves, their tools, and harvested grain from intruders. A large stone rolled in front of the cave entrance would ward away animals, but if the cave dweller could move the stone, so could a thief! So… enterprising dwellers fashioned a wedge and buried it beneath the stone. This wedge would be known only to the cave dweller’s family, hence the first key.