On 09/22/2011 11:20 AM, Frank M. Ramaekers wrote:
> (something like ARC4)?

That would be straightforward, given a way to reblock one stream with
the length of records on another.  Just seed RANDOM with your key, and
COMBINE XOR to encode or decode.

So what's a simple way to reblock the output of RANDOM to match the
length of the input records?

Failing that, I suppose if you don't mind reblocking the input you could
do it that way instead.  You'd need to block it in single bytes to avoid
junk bytes at the end--and, actually, that also avoids delaying the
record, in case this is mixed with other data.  To encode:

  (end /) ... | block 1 cms4 | xor: combine stop anyeof xor | ...
     / random * ... | fblock 1 | xor:

To decode:

  (end /) ... | xor: combine stop anyeof xor | deblock cms4 | ...
     / random * ... | fblock 1 | xor:

¬R

Reply via email to