(n.) A device operated by a key, combination, or keycard and used, as on a door, for holding, closing, or securing.

Source: Dictionary.com

(n.) Any device which prevents access or use by requiring special knowledge or equipment.

Source: Lock Industry Standards and Training (LIST) Council

Read more about Definition and Types of Locks