--- Elaine -HFB- Ashton <[EMAIL PROTECTED]> wrote:
> Curtis Poe [[EMAIL PROTECTED]] quoth:
> *>
> *>This probably is not the most helpful comment, but one way to tell 
> *>if something is encrypted is to compress the data using Archive::Zip
> *>or something similar.  I don't know, offhand, what the threshhold is,
> *>but if a file significantly compresses then either it is unencrypted 
> *>or has a lousy encryption algorithm.  This is because encrypted data 
> *>should look more or less random and not present patterns which allow 
> *>compression.
> 
> Rot13 is considered a form of encryption yet merely shifts the 
> frequency of certain letters. One can also compress the data
> before encypting it. There are also a wide range of encyption algorithms
> as well as compression tools these days that render that statement untrue.
> 
> e.

Hi Elaine,

You are correct, but note where I said "or has a lousy encryption algorithm".  
Cryptologists,
amongst other things, look for patterns in data.  If a pattern is spotted, that's a 
good place to
start attacking the cipher and suggests a weakness in the encryption algorithm used.  
Strong
encryption should create an apparently random sequence of characters and thus be very 
difficult to
significantly compress.

As for compression tools, if a pattern is spotted, compression algorithms substitute 
out that
pattern with a smaller piece of text.  This substitution keeps occuring until no more 
patterns are
spotted (well, sort of).  If a compression tool leaves large patterns in the data, 
it's a poor
compression tool.  You can read more about this here: 
http://perl.plover.com/Huffman/huffman.html.

I should also add that http://www.perlmonks.org/index.pl?node_id=126891 has an 
interesting
discussion of detecting encrypted data.  It should be noted that using compression as 
a means of
detecting encrypted data will not tell you whether the data has been encrypted or 
compressed.

Cheers,
Curtis "Ovid" Poe

=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to