James Fenn <jfenn / uklinux.net> wrote: > >On Wed, 24 Jan 2001 14:23:19 -0500 (EST) >Mathieu Bouchard <matju / cam.org> wrote: [...] > > (b) tar archive, not gzipped, but containing only .gz files > >isn't that what a tar.gz is anyway? No. These translations are non-commutative. If you put on your pants before your underwear you get a different outcome than if you put on your underwear before your pants... :-) To get a tar.gz file you tar, and then gzip. What is being talked about here is gzip and then tar. If you have many small similar files then taring and gzipping will give substantially better compression. But if you gzip and then tar, then the outside world has a tar file and you can extract any individual file by itself. Think of gzip as a type of encryption for a second (*). If you tar and then encrypt, you canot even tell that you have a tar file until you decrypt. Whereas if you encrypt then tar you can see that you have a tar file, but you cannot read the files in it without decrypting. [...] Cheers, Ben PS Though encryption and compression are very dissimilar operations, there is a connection. Perceived randomness of data is connected to information density. White noise has a density of 1. Compression carries the same information in less data, so the density of compressed data moves towards 1. Encryption scrambles data so that without all of it and a secret key you cannot tell that its density is not 1. This leads to several basic facts of information theory: 1. White noise, compressed data, and encrypted data look pretty much the same. Therefore if you need a large sample of fairly good random data, grab a large volatile data file, compress, encrypt, and then sample from there. (Avoid headers.) 2. White noise and encrypted data are not compressible. Don't even try. 3. While there is no point in encrypting and then compressing data, if you compress and then encrypt you usually get a much better encryption. For instance the classical Unix crypt utility can be trivially decrypted if you use it on straight text. But if you compress and then encrypt it poses (somewhat) more of a challenge. (Of course far, far better encryptions are widely available. But even they will be better if you compress first.) _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com