Very few people needed really serious security in the Middle Ages; those who did lived in castles or kept their valuables in guarded places. Most people needed moderate deterrence to guard things of moderate value. For these situations, the common solution was a locked chest.
Any chest worth putting a lock on was probably large and heavy. In a typical early medieval hall, the only private room was the lord’s, and in that room, a few locked wooden chests kept his valuables. His wife carried the keys on her belt, and she was responsible for paying the servants.
Lock and key technology was not new to the Mediterranean region. In Roman times, iron locks with bronze keys were embedded in doors and caskets. While the iron locks have corroded, the bronze keys can be studied. Roman locks had the basic interior mechanism that needed the correct shape key inserted in order to make it release. They also developed the ward, which bars the wrong key from entering a lock.
We can assume that lock technology continued without interruption in Italy. Locks also appeared very early in northern Europe, even while other iron-based technology was primitive. Blacksmiths made locks at first. As the technology expanded from simple slide locks to rotary spring mechanisms, locksmiths became their own skilled trade.
The favored key for casket locks was a pipe key. The bit (the specially shaped end of a key) had to fit the turning mechanism, but the hollow shank also had to fit a pin, for extra security. Hollow shanks and pins could be made square, hexagonal, or any other non-round shape. Doors usually used solid keys, and sometimes the lock permitted access from both sides of the door, so the same key could lock in or out. Doors in Norman castles typically had dead bolts, which had to be turned a full turn since the key was directly sliding the bolt.
Lock technology always presumed some kind of human guard. Locks might be smashed, as could the chest itself, but this would make noise. Most locks could be picked with skill and determination; they couldn’t really keep thieves out, but they could slow them down. Extra-secure caskets were reinforced with iron bands and had multiple locks. Even if one could be picked, the next ones might be harder or the guard might come on his rounds and catch a thief.
Late medieval lock technology became very complicated and specialized, for those who could afford to pay for custom work. The finest locks had no visible keyhole; the owner of the chest knew where to press a spring that popped a slide back, exposing the hole. The spring, slides, and holes were all concealed with fancy carving or painting, of course. In the best work, there might be several layers of security like this, in addition to a custom-made lock with only one key. Eventually, locks were better than the wooden doors and boxes they guarded.