an electronic lock system senses codes on a key by means of opto - electronic , magnetic or other electrical means and compares the key code to a code stored internally in a memory . when the key code is equal to its respective stored code the lock activates an electrical clutch operated bolt , and may also change the internal code to a new code . this invention relates to electronic locks , and is more particularly directed to the provision of an electronic lock which can be operated by a key having a code in the form of an electric parameter or optical parameter thereon .