Skip to main content

Table 5 Gateway node simulation process

From: A secure and privacy-preserving authentication protocol for wireless sensor networks in smart city

(*processgateway*)
let processgateway = 
  in(ch1,(SIDj:bitstring,PIDi:bitstring,M1:bitstring,Tu:bitstring,T1:bitstring));
  in(ch2,(SIDj:bitstring,M2:bitstring,M3:bitstring,T2:bitstring));
  let UIDi = XOR(PIDi,hash(GK(Sg,Tu)))in
  let Xi = hash(concat(UIDi,Sg)) in
  let M1' = hash(concat(UIDi,concat(Xi,concat(Tu,T1))))in
  if M1' = M1 then
  event gwnAcceptU(ui);
  let Ts = XOR(M2,hash(concat(GWNPSj,T2)))in
  let M3' = hash(concat(SIDj,concat(GWNPSj,concat(Ts,T2)))) in
  if M3' = M3 then
  event gwnAcceptS(sj);
  new T3:bitstring;
  let M4 = E(GWNPSj,concat(Tu,concat(UIDi,concat(SIDj,T3))))in
  let M5 = hash(concat(GWNPSj,concat(Tu,concat(UIDi,concat(SIDj,T3)))))in
  let M6 = E(Xi,concat(Ts,concat(UIDi,concat(SIDj,T3))))in
  let M7 = hash(concat(Xi,concat(Ts,concat(SIDj,concat(UIDi,T3)))))in
  out(ch2,(M4,M5,T3));
  out(ch1,(M6,M7,T3))