A lock device including a keyway sized and configured to receive a key, a sensor assembly including an optical source and a key height sensor, and a controller in communication with the sensor assembly. The optical source is configured to generate an optical signal, and the key height sensor is configured to generate a key height signal in response to receiving the optical signal. The key is configured to interact with the optical signal such that the key height signal varies based upon the height of the key. The controller is configured to generate a key profile based at least in part upon the key height signal, to compare the key profile to authorization data, to select an action based upon the comparing, and to perform the action.