Skip to main content
. 2025 Jan 15;25(2):460. doi: 10.3390/s25020460
Algorithm 2: Simplified Fountain Code Encoder (SFCEA)

Input: P: byte array of shellcode,

l: slice size (in bytes),

s: encryption seed

Output: Encoded packet (I,C) where

I: slice indices;

C: encoded data

  • 1
    Step 1: Encrypt the shellcode:
  • 2
    PaPas,a{0,1,,|P|1};
  • 3
    Step 2: Calculate the number of slices:
  • 4
    X|P|/l;
  • 5
    Step 3: Randomly select the degree:
  • 6
    d[1,X];
  • 7
    Step 4: Initialize the packet data:
  • 8
    C{0}l;
  • 9
    Step 5: Randomly choose d indices:
  • 10
    I{0,1,,X1};

graphic file with name sensors-25-00460-i002.jpg

  • 17
    Step 7: Return the encoded packet: (I,C);