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:    kde←VF−CP−ABPRE.ReDecskABPRE,CTkey,CTkey′
4:  else
5:    kde←VF−CP−ABPRE.OriginDecskABPRE,CTkey
6: end if
7: mde←AES.DecCTdata,kde
8: if DD=SHA−256mde then
9:  return mdata←mde
10: else return ⊥