Basically an electronic lock system consists of keypad for entering the password, an eeprom where the password can be saved in case of power failure, display unit may be optional, and an relay to activate or deactivate the lock
check this link for basic blocks of password lock system
http://www.dnatechindia.com/index.php/Kits/Microcontroller-Kits/Programmable-Electronic-Lock.html