Skip to main content
. 2023 May 14;23(10):4746. doi: 10.3390/s23104746
Algorithm 1 HE encryption algorithm.
  • 1:

    Input N: the number of the households

  • 2:

    Input P: the plaintext consumption data array of the households

  • 3:

    Input encryptor: the object that performs encryption

  • 4:

    for index=1,2,,N do

  • 5:

          dataP[index]

  • 6:

          cencrypt(data,encryptor,pk)

  • 7:

          push c into ciphertexts array

  • 8:

    end for

  • 9:

    Output ciphertexts array