In wireless body area network health care applications, energy-constraint wearable devices are used to monitor patient physiological parameters. The security of the private health information of a person plays a significant role because if it is captured and read by an unauthorized person, the confidentiality of the patient data is lost. Therefore, there is a requirement to secure the data by performing encryption to transfer it into an unreadable form. Since the resources used for encryption should be kept to a minimum as the devices are attached to the human body, a lightweight encryption algorithm has to be used. Therefore, the generation of a unique key used for encryption plays a significant role. In work, generating a unique key uses the ECG values taken from MIT-BIH Arrhythmia database. Four unique keys are generated, which can be used for encryption. The uniqueness and randomness of the keys generated are proved using the runs test and frequency test within the block. Also, the average hamming distance calculated between the ECG keys generated from two different ECG signals is 62.5% ($$\approx$$
≈
80 bits), which proves the distinctiveness of the keys generated. Implementation of the work is performed using Matlab.