Skip to main content
. 2026 Feb 16;26(4):1285. doi: 10.3390/s26041285
Algorithm 2 Selective encryption scheme
  • Require: 

    Raw video V, secret key K, ROI map based on semantic layer

  • Ensure: 

    Encrypted HEVC/VVC-compliant bitstream

  •  1:

    Extract frames {Ft} from V

  •  2:

    Detect sensitive objects and generate ROI masks

  •  3:

    for each Coding Tree Unit (CTU) do

  •  4:

        Identify syntax elements associated with ROI

  •  5:

        Select bypass-coded elements (QTC, MVD, optional IPM)

  •  6:

        for each selected syntax element do

  •  7:

            Perform CABAC binarisation to obtain bin sequence P={Pi}

  •  8:

            Obtain current Most Probable Symbol (MPS)

  •  9:

            for each bin Pi do

  • 10:

               P˜iPiMPS

  • 11:

               SiAES128(Ci1,K)

  • 12:

               CiSiP˜i

  • 13:

               Send Ci directly to arithmetic encoder

  • 14:

            end for

  • 15:

            if syntax element is non-binary (QTC or MVD) then

  • 16:

               Scramble magnitude using Linear Congruential function

  • 17:

               Xi(aXi+b)modm

  • 18:

            end if

  • 19:

        end for

  • 20:

    end for

  • 21:

    Assemble arithmetic-coded bins into encrypted bitstream

  • 22:

    return Encrypted bitstream