Skip to main content
. 2020 Apr 6;20(7):2049. doi: 10.3390/s20072049
Algorithm 2: sendMessage (A, B, m, K)
Input: Sender node A, receiver node B, message m and mutual key K
Output: True if the message sending operation completed successfully, otherwise return false
/* perform encryption operation                          */
me extract control part from m and encrypt the control part using K; Finally merge the encrypted control part with the message m
/* Node A transmits the encrypted message to node B, where B receives it and decrypts the control part                                 */
/*( If B receives the message successfully then return a positive acknoledgment
*/
rettransmit(A,me,B)
return ret