Size of encrypted files

David Shaw dshaw@jabberwocky.com
Tue Mar 4 15:39:01 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Mar 04, 2003 at 02:51:59PM +0100, Preben Mikael Bohn wrote:
> Dear all, I'm trying to use gpg to encrypt files using only symmetric ciphers.
> I'm using the following:
> 
> gpg --symmetric --batch --no-tty -z 0 --cipher-algo 3DES --passphrase-fd 0
> plain.txt < passwd.txt
> 
> Can anyone explain the following:
> 
> 1) How is passwd.txt being used in the encryption algorithms when used as the
> above (as the key directly, padded with something, stripped off the 8'th bit,
> etc)?

By default, it is mangled as specified in RFC-2440, section 3.6.
Basically, it is salted and then hashed multiple times.

As the key directly.

> 2) How come the encrypted file size is significantly larger than the plain
> file? I would have expected it to be only slightly larger due to padding of
> the plain-text.

- --symmetric doesn't do a straight encryption of plaintext into
ciphertext.  There are headers, a session key (yes, even for symmetric
encryption), and so on.

David
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2rc1 (GNU/Linux)
Comment: http://www.jabberwocky.com/david/keys.asc

iD8DBQE+ZLqa4mZch0nhy8kRAmDtAJ44LqnZLy0EXajk4CAV6GfN0tX+YACcCyde
JyYbj9+Wq0h32Qq7PihADoE=
=hmRd
-----END PGP SIGNATURE-----