KEYS have been around for a long time. The earliest, made from wood, date back to the ancient Egyptians. The Romans improved them by making them from metal. But there, more or less, they have stayed.
A key is still, basically, a piece of metal sporting a series of grooves, teeth and indentations which, when inserted into a keyway, line up to move pins and levers to lock or unlock a mechanism.