Keypads are placed on walls similar to Levers and require a 4 digit code to be put into it to open it. The first time you input a code into it the keypad it'll remember that as its code. Whenever that code is input into the keypad in the future, it'll output redstone signal similar to a lever.
The GUI for the keypad would be a typical 10 digit numpad with 4 digits allowed for the code. Clicking any of the numbers puts it in the next available slot.
I was thinking about this while designing my new factory/research lab, there are places I think should be offlimits to other people, would be nice to have doors locked using a Keypad.
Or maybe a keycard system.. Dye colored keycard system..