View full-text article in PMC Sensors (Basel). 2022 Sep 29;22(19):7413. doi: 10.3390/s22197413 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 1 Initiation. GW: Calculate Rgw=PUFgw(Cgw) GW→CS:M1={Cgw} CS: Generate a random number Ncs1 Calculate X1=NLF(Rgw)⊕Ncs1, H1=h(Ncs1) CS→GW:M2={H1,X1} SK1=Ncs1‖Rgw GW: Calculate Ncs1′=X1⊕NLF(Rgw), Ncs1′=X1⊕NLF(Rgw), H1′=h(Ncs1′) If H1′≠H1, the message is discarded. Otherwise, the gateway generates a new CRP. SK1=Ncs1′‖Rgw Calculate E1=Cgwnew‖RgwnewEncSK1 H2=h(Cgwnew‖Rgwnew‖Ncs1′) GW→CS:M3={H2,E1} CS: Calculate D1=E1DecSK1, H2′=h(D1‖Ncs1) If H2′=H2, we store the updated value Cgwnew and Rgwnew.