Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Compressing and Encrypting files on Windows

by tachyon (Chancellor)
on Nov 01, 2004 at 14:45 UTC ( [id://404313] : note . print w/replies, xml ) Need Help??


in reply to Re: Compressing and Encrypting files on Windows
in thread Compressing and Encrypting files on Windows

Sorry that is absolute rubbish. First you are completely wrong in than anyone with two neurons to scratch together or even rudimentary investigative skill can show your first premise is complete rubbish. You second premise has nothing to do with the price of fish, or the question at hand for that matter. There is no analogy between tar and either encryption or compression. All tar does is glue files together with just enough header data to split them back into a dir structure and check for corruption.

I have presented some sample code above. Please experiment with it and follow your own suggestion. Please learn from it as you clearly have NFI.

As noted you will get >>>>>ZERO COMPRESSION<<<<< if you encrypt first with any decent algorithm. By design an encryption algorithm will turn an infinite stream of zeros into an equally infinite stream of (pseudo)random noise. This can not, by definition, be compressed. This is not a bug. This is by design :-)

If you can compress your encrypted files I suggest you have a problem with your encryption algorithm.

Replies are listed 'Best First'.
Re^3: Compressing and Encrypting files on Windows
by halley (Prior) on Nov 01, 2004 at 18:55 UTC
    Geez, tachyon, why don't you tell us what you really feel?

    It's one thing to say, "sorry, I think you have that backwards, read my post to understand why;" and a completely different thing to use a caustic, abusive tone in every sentence. We've been without Abigail-II for months now, and I like the change in average tone in the community. Let's not blow it.

    --
    [ e d @ h a l l e y . c c ]

      , why don't you tell us what you really feel?

      Because I thought it would get reaped ;-) The OPs post obviously annoyed me. I have no problem with people being wrong. Like most people I spout rubbish from time to time, but I typically have the good grace to add an AFAIK, IMHO, perhaps, maybe or whatever. It was the authoratative presentation of absolutely incorrect information that set me off.

      cheers

      tachyon

        Just a point - if you compress and then encrypt, you are encrypting known pieces of data (block headers, dictionaries, etc). Depending on the compression algorithm, this may give a large enough chunk of data to assist an attack against the encrypted data stream.

        All of this is IIRC, of course ;)

        --MidLifeXis