Locksmithing should be a skill. Whenever a new lock and key is created, the game could internally assign them numbers (0, 1, 2, and so on) unseen to the players, so that a lock could only be opened by its key, by a copy of its key (made by a locksmith with access to the original key or a copy), or by a successful lockpicking attempt. Players could name locks and keys that they came across so that they would be able to recognize locks and keys that they'd already seen, allowing them to "remember" which keys fit which locks.