Friday, May 21, 2004

Block Cipher to Stream cipher

Block ciphers can be converted into stream ciphers by xoring with the encrypted plaintext like 1,2,3,4,5,etc. so we don't need to use RC4 and all it's FUD about weak keys and weak initial 256 bits and even the fact that it's trapped in binary-land. Though it does ask an interesting mathematical question: Given a stream of bits, how can we convert it losslessly (non-wastefully) into another base? Wastefully, for example, if we wanted to convert to base-65, we can read 7 bits at a time and throw away values from 65..127. But non-wastefully?

No comments :