Skip to main content
. 2021 Jun 24;21(13):4320. doi: 10.3390/s21134320
Algorithm 2: Decryption Algorithm
    Input : r1,,r6: pseudo-random sequences
    (t,x,y,p): an encrypted event
    M,N: the width and height of the NVS
    Output: (t,x,y,p): an event
  • 1

    r6=Sort(r6);

  • 2

    Generate Sr6 which maps the index of each element in the sorted sequence r6 to the original sequence r6;

  • 3

    ptemp=Sr6(pM+x)M;

  • 4

    x=Sr6(pM+x)modM;

  • 5

    r5=Sort(r5);

  • 6

    Generate Sr5 which maps the index of each element in the sorted sequence of r5 to the original sequence r5;

  • 7

    p=Sr5(ptempN+y)N;

  • 8

    y=Sr5(ptempN+y)modN;

  • 9

    x=(xr4y)modM;

  • 10

    y=(yr3x)modN;

  • 11

    x=(xr2y)modM;

  • 12

    y=(yr1x)modN;