in reply to Re (tilly) 1: Streaming Compression
in thread Streaming Compression

hey- good idea. but the reason why i wanted to do encryption first is to give the compression more data to work with to find similarities with. grandted that encryption garbles up the file.... this presents an interesting problem.
russ
  • Comment on Re: Re (tilly) 1: Streaming Compression

Replies are listed 'Best First'.
Re (tilly) 3: Streaming Compression
by tilly (Archbishop) on Dec 18, 2001 at 03:37 UTC
    If you are using a half-way decent encryption algorithm, I guarantee you that the only way a compression algorithm can significantly compress your data later is if it breaks your encryption. By contrast if you compress your data first you will get compression and also make your encryption harder to break.

    But if you want, try coding it up both ways and see for yourself. I would offer a bet that my way works better, but I dislike stealing money on a sucker bet.

      Yeah, after your insight, it does work better to compress first. ::pat's yer back:: this is only based on experimentation with other compression and encryption utils... i'm still having problems figuring out Compress::Zlib. I just cant seem to find enough documentation, even tho I know it's out there. But thanks. :)
Re(3): Streaming Compression
by FoxtrotUniform (Prior) on Dec 18, 2001 at 04:34 UTC

    the reason why i wanted to do encryption first is to give the compression more data to work with to find similarities with.

    Ain't gonna happen. What makes strong encryption strong is the lack of similarities between different parts of the data. Ideal encryption would produce output completely indistinguishable from random noise. Compression algorithms look for patterns in the data they're compressing. So do codebreakers.

    This brings up an interesting question: could one use a compression utility to test the strength of various ciphers? I'd guess that most compression algorithms would look for very naive (cryptographically speaking) patterns, so the "compression test" would only weed out particularly simple ciphers, but I don't have any data or citations to back it up.

    --
    :wq