Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Zip a file with Password encryption

 
Sailekha
Occasional Contributor

Zip a file with Password encryption

Hi,

We are running on Zip version 2.3. In help I dont see options to zip with Password encrypt, but in one of the old forums i saw that zip -p works even though its not documented.

Can anyone help witht the syntax for the same? and if password encrypt is really available on this version?

Regards

2 REPLIES 2
Highlighted
H.Becker
Honored Contributor

Re: Zip a file with Password encryption

For encryption -e and -P are supported in an old 2.nn version, which I tried. The option -p explicitly requests to include relative file paths, which is the default, anyway.

$ zip
Copyright (c) 1990-2006 Info-ZIP - Type 'zip "-L"' for software license.
Zip 2.32 (June 19th 2006). Usage: zip=="$disk:[dir]zip.exe"
zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]
...
$ zip -P your-password x.zip login.com
  adding: LOGIN.COM (deflated 37%)
$ 

For VMS the usual applies: it works this way if you have extended parsing enabled, otherwise you need to quote the uppercase option and the password, if that contains uppercase letters.

 

Steven Schweda
Honored Contributor

Re: Zip a file with Password encryption

> We are running on Zip version 2.3. [...]

   This one?:

ITS $ mcr []zip.IA64_exe -v
[...]
This is Zip 2.3 (November 29th 1999), by Info-ZIP.
[...]

   Many things have happened since 1999, many of them good.  Zip 3.0
would almost certainly be a better choice.  Among other things, its
extended help ("zip -h2") includes:

  -e        use standard (weak) PKZip 2.0 encryption, prompt for password
  -P pswd   use standard encryption, password is pswd

   Before that, "-P" was intentionally not documented because it was
considered such a bad idea to use it (and store the password) in a
script.  (Now we don't care what you do, and we got tired of people
asking for/about the undocumented option.)

   Also, back in 1999, there was a separate "crypt" source kit, which
was required to enable the latent encryption capabilities in both
programs.  If your (fossil) Zip 2.3 was built without it, then you can
expect a result like:

ITS $ mcr []zip.IA64_exe -e -P password enc.zip zip.c

zip error: Invalid command arguments (encryption not supported)

   Note that what we now call Traditional zip encryption is not
considered very good these days.  (No currently released Zip/UnZip
version supports AES encryption, but there's still some hope for beta
3.1/6.1 versions before we're all dead.)

> $ zip
> Copyright (c) 1990-2006 Info-ZIP - Type 'zip "-L"' for software license.
> Zip 2.32 (June 19th 2006). Usage: zip=="$disk:[dir]zip.exe"

   "Zip version 2.3" is even older/worse than "Zip 2.32".

      http://infozip.sourceforge.net/
      ftp://ftp.info-zip.org/pub/infozip/src/