Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Winzip Encryption via SAS 1

Status
Not open for further replies.

doyleuk

Programmer
Jan 26, 2009
5
0
0
GB
Hi,

I was wondering if anyone can provide some help, I am currently using the X command to zip an output excel file via WinZip. The excel file was created via SAS using ODS markup.

I know that WinZip has the fucntion to add 256Bit AES encryption.

I need to know how i can incorporate that encryption funtion into the X command. Is there a specific option that i need to invoke.

Any help is greatly apprecciated.

Regards

Doyleuk
 
No idea, I think you need to check the Winzip documentation to get the correct command line options.

Chris
Business Analyst, Code Monkey, Data Wrangler.
SAS Guru.
 
I'm not sure if winzip has the command to add password/encryption on command line. If you open a dos wnidow and type winzip -? (or whatever the exe is -?) it will give you all the options you can use with the exe.

We use ZipGenius in work which gives us the option to add a password to the file.

If you choose to use ZipGenius, there is a macro we use (code below) to zip files.

Code:
%macro zip_files(	filename=,
					add_file=*.*,
					password=0,
					working_directory=C:\Program Files\ZipGenius 6\,
					program_name=zg.exe,
					batch_location=C:\zip_batch.bat
				);
	
	option xsync=1;
	filename zip "&batch_location.";

	data _null_;
		file zip;
		x = "&program_name. -add " || '"' || "&filename." || '"' || " C9 F0 P&password. +" || '"' || "&add_file." || '"';
		put x;
	run;

	x "&batch_location.":
	option xsync=0;

%mend;
 
I checked around and I don't see the switch for AES256 encryption using WinZip. They do have a Password switch (-s"YourPassWord") and perhaps they automatically encrypt it with the AES256 method. Try using the pasword switch and see if that is what you need. You can also use 7zip (free) from the command line.

Klaz
 
I can provide correct syntax for this when I get to work Monday. I do this all the time.
 
Keep in mind - you need Winzip command line add-on for this solution:

Code:
%LET ZIP_PGM  = '"C:\PROGRAM FILES\WINZIP\WZZIP.EXE" -A -EX -S"password" -ycAES256';

%LET OUT_FILE  = C:\&start - &end &NAME..xls;
%LET ZIP_LOC   = C:\zip\; 
%LET ZIP_FILE = &ZIP_LOC\&NAME &start - &end..ZIP;



options noxwait xsync; run;
DATA _NULL_;
 	 ZIPIT  = &ZIP_PGM||' "'||"&ZIP_FILE"||'" "'||"&OUT_FILE"||'" ';  
	 PUT ZIPIT=;
	 CALL SYSTEM (ZIPIT);
RUN;
 
Hi,

Can you confirm this encrypts the data as well as putting a password on the zip file.

Password protection and encryption are 2 different things.

Many thanks for all you help
 
Yes, this places AES256 on it as well as a password. Putting -ycAES256 at the end tells Winzip to encrypt it.
 
I cant get this to work, I can get the programme to run, if i exclude the -ycAES256 it works perfectly.

PLease help as this programme would help me so much
 
I only have winzip version 9, this add-on applys to winzip 10 or above.

My organisation only installs version 9. My will try raising an IT job that will allow me to get winzip v10 or later and then i will get the add-on.

Many Thanks for all your help.
 
Just FYI,

I do have the add-on for version 9. "Winzip Command Line Support Add-on 1.1 SR1" It may not be available at this point in time, but keep in mind that this command line utility is not part of the standard winzip bundle. I had to get my IT group to install the standard Winzip and get them to install the add-on separately.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top