Skip to main content
. 2026 Sep 20;26(18):5960. doi: 10.3390/s26185960
Algorithm 1 YB-IoT-CG Layered Access Decision
Require: IoT message Mi=(di,τi,ni,ti,pi,σi); fwi, ctxi
Require: 0≤θrisk<θrevoke≤1; revocation cache Rcache
 1: if ¬WellFormed(Mi) then
 2:       CommitAudit(H(Mi),1,Challenge,Malformed)
 3:       return Challenge
 4: end if
 5: κi←H(DID(di))
 6: if  κi∈Rcache then
 7:        CommitAudit(H(Mi),1,Revoke,OnChainRevoked)
 8:        return Revoke ▹ recognize existing revocation; do not create a new one
 9: end if
10: if  ¬VerifyBaseAuth(Mi) then
11:        CommitAudit(H(Mi),1,Challenge,InvalidBaseAuth)
12:        return Challenge ▹ unauthenticated traffic cannot update risk or enqueue revocation
13: end if
14: Ci←(di,τi,ni,ti,H(pi),fwi,ctxi); hi←H(encC(Ci))
15: (ai,bi,ci)←ρq(hi)
16: L←r12r23r12(ai,bi,ci)
17: RYB←r23r12r23(ai,bi,ci)
18: if  L≠RYB then
19:        ei←H(hi ‖ L ‖ RYB ‖ YBE_Mismatch)
20:        CommitAudit(hi,1,Challenge,ei)
21:        RecordAuthenticatedNonce(di,ni,ti)
22:        return Challenge
23: end if
24: Sfresh ← FreshnessScore(ni,ti,di) using Equation (19)
25: Schain ← TMTOProximity(hi,di) using Equation (16)
26: Sctx ← ContextScore(di,ctxi) using Equation (20)
27: Ri←αschain+βsfresh+γsctx
28: Di ← ContextDECISION(di,Ri,ctxi) ▹ Algorithm 3
29: if  Di=Revoke then
30:        if Ri≥θrevoke then
31:              ei←H(hi ‖ Ri ‖ CorroboratedRisk)
32:              CommitAudit(hi,Ri,Revoke,ei)
33:              QueueRevocation(κi,ei)
34:              RecordAuthenticatedNonce(di,ni,ti)
35:              return Revoke
36:        else
37:              CommitAudit(hi,Ri,Challenge,CorroborationBelowThreshold)
38:              RecordAuthenticatedNonce(di,ni,ti)
39:              return Challenge
40:        end if
41: else if  Ri≥θrisk or  Di=Challenge then
42:        CommitAudit(hi,Ri,Challenge,PolicyRisk)
43:        RecordAuthenticatedNonce(di,ni,ti)
44:        return Challenge
45: end if
46: CommitAudit  (hi,Ri,Accept,OK)
47: RecordAuthenticatedNonce  (di,ni,ti)
48: θrisk←BoundedEWMA(θrisk,Ri,λ,η,θmin,θmax) ▹ Algorithm 2; accepted traffic only
49: return Accept