An electromechanical lock comprising: an electrically-operated actuator to move between a locked position and an unlocked position; an electric generator to produce electric power from mechanical power; an engagement mechanism mechanically coupled with the electric generator to engage with an insertion of a key and convey mechanical insertion power to the electric generator; and an electronic circuit, powered by the electric power produced from the mechanical insertion power, to read encrypted data from a memory embedded into the key, and, if the encrypted data matches a predetermined criterion, to operate the actuator, with the electric power produced from the mechanical insertion power, to set the actuator to the unlocked position; wherein the engagement mechanism is also configured to engage with an extraction of the key and convey mechanical extraction power to the electric generator, and the electronic circuit, powered by the electric power produced from the mechanical extraction power, is also configured to operate the actuator, with the electric power produced from the mechanical extraction power, to reset the actuator to the locked position; and wherein the engagement mechanism is configured to resist the insertion of the key until a first predetermined momentum is overcome and a sufficient amount of electric power is produced from the mechanical insertion power to power the electronic circuit and operate the actuator to set the actuator to the unlocked position, and the engagement mechanism is further configured to resist the extraction of the key until a second predetermined momentum is overcome and a sufficient amount of electric power is produced from the mechanical extraction power to power the electronic circuit and operate the actuator to reset the actuator to the locked position; characterized in that the engagement mechanism comprises a first spring to resist with the first predetermined momentum, and a second spring to resist with the second predetermined momentum. an electrically-operated actuator to move between a locked position and an unlocked position; an electric generator to produce electric power from mechanical power; an engagement mechanism mechanically coupled with the electric generator to engage with an insertion of a key and convey mechanical insertion power to the electric generator; and an electronic circuit, powered by the electric power produced from the mechanical insertion power, to read encrypted data from a memory embedded into the key, and, if the encrypted data matches a predetermined criterion, to operate the actuator, with the electric power produced from the mechanical insertion power, to set the actuator to the unlocked position; wherein the engagement mechanism is also configured to engage with an extraction of the key and convey mechanical extraction power to the electric generator, and the electronic circuit, powered by the electric power produced from the mechanical extraction power, is also configured to operate the actuator, with the electric power produced from the mechanical extraction power, to reset the actuator to the locked position; and wherein the engagement mechanism is configured to resist the insertion of the key until a first predetermined momentum is overcome and a sufficient amount of electric power is produced from the mechanical insertion power to power the electronic circuit and operate the actuator to set the actuator to the unlocked position, and the engagement mechanism is further configured to resist the extraction of the key until a second predetermined momentum is overcome and a sufficient amount of electric power is produced from the mechanical extraction power to power the electronic circuit and operate the actuator to reset the actuator to the locked position; characterized in that the engagement mechanism comprises a first spring to resist with the first predetermined momentum, and a second spring to resist with the second predetermined momentum.