Research Article

SF-LAP: Secure M2M Communication in IIoT with a Single-Factor Lightweight Authentication Protocol

Pseudocode 1

SF-SLAP authentication protocol.
1: (//) double slash are used for comments
2: Procedure SF-SLAP AUTHENTICATION PROTOCOL
3://we assume that A already known PSK
4://S takes TS1 and Na from A and generates Ns
5://S takes the value of a and x or with IDs
6://S takes value of b, concatenate with and x or with Ns
7: S| ~ M1 to C //sensor sends message M1 to controller
8: if (C ⊲ M1, and match) then //controller receives message M1 and match the timestamp
9:  return true;
10:   if (C | ~ D3, D4, D5, Na, to S) then //controller sends D3, D4, D5, Na, and to sensor
11:    return true;
12:     if (S ⊲ M2, and match) then //sensor receives message M2 and match the timestamp
13:      return true:
14:       if (S | ~ D6, to C) then //sensor sends D6 with timestamp to controller
15:        return true;
16:        if (C ⊲ M3, and match) then //controller receives M3 and matches the timestamp
17:          return true;
18:           if (C | ~ D7 and to S) then //controller sends D7 and timestamp to sensor
19:            return true;
20:             if (S ⊲ M4, and match) then //sensor receives message M4 and match timestamp
21:              return true;
22:              while (S sends OK to C for update the values of a’, b’, Ns’, and Nc’)
23:             else
24:             return false; //does not match
25:           else
26:           return false;
27:         else
28:         return false; //does not match
29:       else
30:       return false;
31:     else
32:     return false; //does not match
33:   else
34:   return false;
35: else
36: return false; //does not match
37: end procedure