echo "abcd" >foo.txt
./mcrypt foo.txt
Enter the passphrase (maximum of 512 characters)
Please use a combination of upper and lower case letters and numbers.
Enter passphrase:
Enter passphrase:
File foo.txt was encrypted.
russtopia@drek ~/pkgs/mcrypt-2.6.8/src $ ls -la foo.txt.nc
-rw------- 1 russtopia russtopia 48 Feb 20 22:09 foo.txt.nc
### NOTE foo.txt.nc is 48 bytes
russtopia@drek ~/pkgs/mcrypt-2.6.8/src $ ./mcrypt -z foo.txt
Enter the passphrase (maximum of 512 characters)
Please use a combination of upper and lower case letters and numbers.
Enter passphrase:
Enter passphrase:
File foo.txt was encrypted.
russtopia@drek ~/pkgs/mcrypt-2.6.8/src $ mcrypt -dz foo.txt.gz.nc
Enter passphrase:
File foo.txt.gz.nc was decrypted.
russtopia@drek ~/pkgs/mcrypt-2.6.8/src $ file foo.txt.gz
foo.txt.gz: ASCII text
russtopia@drek ~/pkgs/mcrypt-2.6.8/src $ ls -la foo.txt.gz.nc
-rw------- 1 russtopia russtopia 48 Feb 20 22:09 foo.txt.gz.nc
### NOTE output file foo.txt.gz.nc is *also* 48 bytes, no gzip was applied.
russtopia@drek ~/pkgs/mcrypt-2.6.8/src $ mcrypt -dz foo.txt.gz.nc
Enter passphrase:
File foo.txt.gz.nc was decrypted.
russtopia@drek ~/pkgs/mcrypt-2.6.8/src $ file foo.txt.gz
foo.txt.gz: ASCII text
### NOTE the decrypted file should have been named foo.txt, not foo.txt.gz, as no gzip was originally applied.
russtopia@drek ~/pkgs/mcrypt-2.6.8/src $ rm foo.txt.gz.nc
russtopia@drek ~/pkgs/mcrypt-2.6.8/src $ ./mcrypt -z --no-openpgp foo.txt
Enter the passphrase (maximum of 512 characters)
Please use a combination of upper and lower case letters and numbers.
Enter passphrase:
Enter passphrase:
File foo.txt was encrypted.
russtopia@drek ~/pkgs/mcrypt-2.6.8/src $ ls -la foo.txt.gz.nc
-rw------- 1 russtopia russtopia 141 Feb 20 22:09 foo.txt.gz.nc
russtopia@drek ~/pkgs/mcrypt-2.6.8/src $ file foo.txt.gz.nc
foo.txt.gz.nc: mcrypt 2.5 encrypted data, algorithm: rijndael-128, keysize: 32 bytes, mode: cbc,
### turning off RFC2440 mode (--no-openpgp) allows proper operation of -z gzip option.
### I didn't dig into how to demonstrate that the -m option is ignored when outputting RFC2440 PGP message format, but examination of code indicates it is. Users are not told it is inactive for --openpgp rfc2440 operations.