Skip to main content
. 2019 Jan 24;19(3):487. doi: 10.3390/s19030487
Algorithm 3: IP Marks Authentication algorithm
Input: (i) Position Pn and Ln (ii) Constraint function HWxy
Output: (i) Legal user (ii) Illegal user
/* To satisfy the condition HWxy, Ln and Pn are compared, and then judge whether Ln is legal or not */
/* Ln represents the element that satisfies the condition of HWxy,Sn represents the same element */
1: Calculate Ln according to Ln and HWxy
/* Compare each of Sn and Pn elements */
2: gets(Ln); gets(Pn);
for (i = 0; i < sizeof(Ln) / sizeof(Ln[0]); i++)
{    for (j = 0; j < sizeof(Pn) / sizeof(Pn[0]); j++)
    {
      if (Ln[i]==Pn[i])
      {
       Store Ln in Sn;
      }
    }
  }
3: End for
/* Evaluate the similarity */
4: If (sizeof(Sn) / sizeof(Pn) ≥ 0.8)
5: Output: Legal user
6: else if (sizeof(Sn) / sizeof(Pn) < 0.8)
7: Output: Illegal user;