Everhart, Glenn From: mathog@seqaxp.bio.caltech.edu Sent: Thursday, June 11, 1998 2:22 PM To: Info-VAX@Mvb.Saic.Com Subject: Re: Zip 2.2 Encryption for VMS >In article <01IY2S8F2IJ68YBOO2@VAX.CS.HSCSYR.EDU>, > BINGHAMT@VAX.CS.HSCSYR.EDU writes: >> All, >> >> I have Zip 2.2 (November 3rd 1997) on my VAX. I need to create a batch >> job to zip a file, but it has to be encrypted. The usual command would be: >> >> $ zip -e zipfile.zip datafile.dat >> >> and then zip would ask the user to type in the password twice. >> Unfortunately, I need it to run with no operator intervention. I've tried I modified zip 2.1 to do this, and sent the changes back in to the zip team (and I think to Hunter, did you try ftp.wku.edu?), but they must not have percolated back out again. Since you must already have the crypt stuff, here are the other changes to the zip code you need. in [.VMS] subdirectory $ diff zip_cli.cld .cld_dist ************ File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]ZIP_CLI.CLD;6 19 Qualifier ENCRYPT, VALUE, negatable ****** File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]ZIP_CLI.CLD_DIST;1 19 Qualifier ENCRYPT, Negatable ************ Number of difference sections found: 1 Number of difference records found: 1 DIFFERENCES /IGNORE=()/MERGED=1- PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]ZIP_CLI.CLD;6- PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]ZIP_CLI.CLD_DIST;1 (The line numbers in the next one may not be exact - there were also some that were removed, and I don't want to post anything full of those.) $ diff cmdline.c .c_dist ************ File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C;16 29 ** 02-005 David Mathog 06-OCT-1997 16:05 30 ** Added /ENCRYPT="password" option, VMS specific 31 ** 02-004 Onno van der Linden, ****** File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C_DIST;1 29 ** 02-004 Onno van der Linden, ************ ************ File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C;16 154 #ifdef CRYPT 155 extern char * vmspassword; 156 #endif 157 158 #ifdef TEST ****** File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C_DIST;1 154 #ifdef TEST ************ ************ File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C;16 202 char *ctemp; 203 ****** File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C_DIST;1 199 ************ ************ File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C;16 209 #ifdef CRYPT 210 struct dsc$descriptor_d encrypt_arg; 211 #endif 212 ****** File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C_DIST;1 205 ************ ************ File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C;16 215 #ifdef CRYPT 216 init_dyndesc (encrypt_arg); 217 #endif 218 ****** File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C_DIST;1 208 ************ ************ File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C;16 336 if (status & 1){ 337 *ptr++ = 'e'; 338 status = cli$get_value (&cli_encrypt, &encrypt_arg); 339 if (status & 1){ 340 if(encrypt_arg.dsc$w_length != 0) 341 if((vmspassword=(char *)malloc(encrypt_arg.dsc$w_length)) == NULL) 342 return(SS$_INSFMEM); 343 strncpy(vmspassword, 344 encrypt_arg.dsc$a_pointer, 345 encrypt_arg.dsc$w_length); 346 } 347 } 348 349 350 351 #endif /* CRYPT */ ****** File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C_DIST;1 326 if (status & 1) 327 *ptr++ = 'e'; 328 #endif /* CRYPT */ ************ ************ File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C;16 838 /QUIET,/VERBOSE[=MORE],/[NO]RECURSE,/[NO]DIRNAMES,/JUNK,", 839 " /ENCRYPT[=\"password\"],", 840 #else /* !CRYPT */ ****** File PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C_DIST;1 814 /QUIET,/VERBOSE[=MORE],/[NO]RECURSE,/[NO]DIRNAMES,/JUNK,/ENCRYPT[=VERIFY],", 815 #else /* !CRYPT */ ************ Number of difference sections found: 11 Number of difference records found: 35 DIFFERENCES /IGNORE=()/MERGED=1/OUTPUT=PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]KILLME.TXT;1- PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C;16- PRGDISK:[SHARED.PROGRAMS.ZIP.VMS]CMDLINE.C_DIST;1 In the main directory diff zip.c .c_dist ************ File PRGDISK:[SHARED.PROGRAMS.ZIP]ZIP.C;4 63 #ifdef VMSCLI 64 char *vmspassword; 65 #endif 66 #endif ****** File PRGDISK:[SHARED.PROGRAMS.ZIP]ZIP.C_DIST;1 63 #endif ************ ************ File PRGDISK:[SHARED.PROGRAMS.ZIP]ZIP.C;4 862 #ifdef VMSCLI 863 key = vmspassword; 864 #endif 865 if (key == NULL) { ****** File PRGDISK:[SHARED.PROGRAMS.ZIP]ZIP.C_DIST;1 859 if (key == NULL) { ************ Number of difference sections found: 2 Number of difference records found: 6 DIFFERENCES /IGNORE=()/MERGED=1- PRGDISK:[SHARED.PROGRAMS.ZIP]ZIP.C;4- PRGDISK:[SHARED.PROGRAMS.ZIP]ZIP.C_DIST;1 And, of course, build it VMSCLI defined in descrip.mms. Good luck, David Mathog mathog@seqaxp.bio.caltech.edu Manager, sequence analysis facility, biology division, Caltech ************************************************************************** * Affordable VMS? See: http://seqaxp.bio.caltech.edu/www/pcvms.html * **************************************************************************