Patent ID: 8213607

Claim:
A method for stretching a key stream, comprising: obtaining a key stream having a length of L Z bits by a hardware stream stretcher, where L Z is a positive integer; obtaining a length L D corresponding to a data block by the hardware stream stretcher, where L D is a positive integer and L D >L Z ; generating L D −L Z new bits recursively by combining at least two bits of the key stream by the hardware stream stretcher; appending the L D −L Z new bits to the key stream by the hardware stream stretcher to generate a stretched key stream; and encrypting the data block with the stretched key stream, wherein generating L D −L Z new bits recursively by combining at least two bits of the key stream includes obtaining a first offset O 1 such that 0<O 1 <L Z ; and generating the new bits such that a new bit S k =Z i ⊕Z (i+O1) mod Lz , where L Z ≦k<2L Z , 0≦i<L Z , Z i represents a bit in the key stream and S k represents a bit in the stretched key stream.