Skip to main content

Table 4 Sensor node simulation process

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

(*processsensornode*)
let processsensornode = 
  in(ch2,SIDj:bitstring);
  new b:bitstring;
  new T2:bitstring;
  let Ts = G(b)in
  let M2 = XOR(Ts,hash(concat(GWNPSj,T2))) in
  let M3 = hash(concat(SIDj,concat(GWNPSj,concat(Ts,T2)))) in
  out(ch2,(SIDj,M2,M3,T2));
  in(ch2,(M4:bitstring,M5:bitstring,T3:bitstring));
  let (Tu:bitstring,UIDi:bitstring,SIDj:bitstring,T3:bitstring) = D(GWNPSj,M4) in
  let M5' = hash(concat(GWNPSj,concat(Tu,concat(UIDi,concat(SIDj,T3))))) in
  if M5 = M5' then
  event sensorAccept(gwn);
  let SKsu = hash(concat(GK(b,Ts),concat(UIDi,concat(SIDj,T3)))) in
  new T4:bitstring;
  let Vs = hash(concat(SKsu,T4))in
  out(ch3,(Vs,T4));
  in(ch3,(Vu:bitstring,T5:bitstring));
  let Vu' = hash(concat(SKsu,T5))in
  if Vu' = Vu then
  event Sksuccessful(ui,sj)