Heartbeat Key Generation Demonstration

You may have used fingerprint authentication or face recognition with your smartphone. But do you know that you can use your heartbeat signals to encrypt your wireless communications?

In this demonstration, we will present a heartbeat-based key generation technique developed at Advanced Networks Research Group, University of Liverpool.


This demonstration uses PPG sensors to collect heartbeat signals and extract cryptographic keys from the collected signals. A full key generation protocol has been implemented by the Python.

Key Generation Protocol


Heartbeat Measurement

Any sensor that can measure heartbeat signals will work, e.g., ECG and PPG sensors. This demonstration uses PPG sensors as example. PPG sensors are very easy to use.

IPI Extraction:

Key Establishment




Please refer to this link for the hardware and software setup.



Demo Video

Click the image below to watch the video. Hearbeat Key Generation Demo


Junqing Zhang, Yushi Zheng, Weitao Xu, and Yingying Chen, “H2K: A Heartbeat-based Key Generation Framework for ECG and PPG Signals,” IEEE Transactions on Mobile Computing, vol. 22, no. 2, pp. 923 - 934, Feb. 2023. link


We would like to thank Mr Yushi Zheng for his hard work on completing this excellent demo.