Skip to main content
. 2024 Mar 4;24(5):1667. doi: 10.3390/s24051667
Algorithm 3 Data Decryption
Input:
 Ciphertext CTkey,CTkey or CTkey, access policy AP
 Ciphertext of data CTdata
 Digital digest DD
 Users’ secret key skABPRE
Output:
 Agricultural product traceability data mdata
1: if skABPRE satisfies the access structure AP
2:  if CTkey is provided then
3:    kdeVFCPABPRE.ReDecskABPRE,CTkey,CTkey
4:  else
5:    kdeVFCPABPRE.OriginDecskABPRE,CTkey
6: end if
7: mdeAES.DecCTdata,kde
8: if DD=SHA256mde then
9:  return mdatamde
10: else return