Patent ID: 8498412

Claim:
A method of providing an encrypted data stream, including obtaining a first data stream with a first stream of key messages, the first data stream comprising encrypted data, partitioned into sections corresponding to key periods, each of a plurality of the key periods being associated with a respective value of a key, wherein each section corresponding to a key period associated with a value of the key includes at least one encrypted data unit decryptable using that associated key value, obtaining a pre-encrypted replacement data stream section and an associated at least one replacement key message stream section, the at least one replacement key message stream section including a key message carrying key information for obtaining key values for the replacement data stream section and at least one encrypted data unit in a section of the first stream corresponding to a certain key period, forming an encrypted output data stream and an associated stream of key messages, the forming including: inserting the replacement data stream section into the first data stream to form the encrypted output data stream, so as to replace a corresponding part of the first data stream with a tail end of the replacement data stream section preceding the section of the first stream corresponding to the certain key period, wherein the encrypted output data stream corresponds at least partially to the first data stream; and substituting the at least one replacement key message stream section for a corresponding part of the first stream of key messages so as to coincide with a point of the encrypted output data stream preceding the tail end of the replacement data stream section, and providing as output the encrypted output data stream in synchrony with the associated stream of key messages.