The invention discloses an electronic lock cylinder and an electronic key. The electronic lock cylinder and the electronic key work in a matched mode. The electronic lock cylinder comprises an outer fixing sleeve, a lock cylinder body, an electromagnet, an armature integrated with a linkage part, a following spring, a code identification and control circuit, a touch triggering device and an unlocking execution device. During use, when a code is right, the armature is attracted by the electrified electromagnet in place and not moved by the following spring, so that the touch triggering device is allowed to further trigger the unlocking execution device to execute unlocking operation; and when the code is wrong, the electromagnet is not electrified, the armature and the linkage part are pushed and pressed by the following spring to move and separated from the surface of a sucker of the electromagnet, the unlocking execution device is locked and cannot execute unlocking operation, and the electronic lock cylinder is kept locked. According to the electronic lock cylinder, force is applied by the touch triggering device, and a mode that work is done by moving the armature through attraction of the electromagnet is replaced, so that the power consumption of the electronic lock cylinder is greatly reduced. The electronic lock cylinder is matched with the electronic key.