Detecting loss of stream cipher synchronization between a transmitter and
a receiver in a video processing system may be achieved by receiving, by
the receiver, an encrypted video frame from the transmitter, obtaining an
encrypted value for a selected pixel in the encrypted video frame,
decrypting the encrypted pixel value using a first portion of the
receiver's current key stream, re-encrypting the pixel value using a
second portion of the receiver's current key stream, sending the
re-encrypted pixel value from the receiver to the transmitter, obtaining,
by the transmitter, a plaintext value for the selected pixel from a
corresponding original video frame and encrypting the plaintext pixel
value using a second portion of the transmitter's current key stream, and
comparing the re-encrypted pixel value received from the receiver with
the encrypted pixel value generated by the transmitter and detecting a
loss of cipher synchronization when the values do not match.