A lock is a mechanical or electronic fastening device that secures an object, like a door, drawer, or container, and prevents it from being opened without a key, password, or combination. It can also refer to a wrestling hold or a section of a canal.