In order to get starting, I suggest that you explain a little bit more.
1. What kind of powersource is in your mind?
2. What kind of microcontroller?
3. What kind of keypad, and how will it connect to the uC?
4. How about the lock? What type? How will it connect to the uC?
5. Which programming IDE are you going to use? Compiler?
6. Breadboard, perf. board, homemade PCB, or from a PCB house?
I had to do this on a pic16LF877. I'll try to dig up the code. It was years ago but heres how we did it.
Upon first run it would check for a password flag. If it was set it would then ask for the password entered. If it was 0 it would then ask the user to setup the password. Other then that it was all standard 4 key pin password. Worked very well actually and was very small in code size. Its in ASM but I just have to find the code and clean it so I can release it.