Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create zip file in .net with password

I'm working on a project that I need to create zip with password protected from file content in c#.

Before I've use System.IO.Compression.GZipStream for creating gzip content. Does .net have any functionality for create zip or rar password protected file?

like image 200
Hamed_gibago Avatar asked May 04 '16 06:05

Hamed_gibago


People also ask

Can I create ZIP file with password?

If you put the files you'd like to protect in a zip file, you can then apply a password. In Windows Explorer, highlight and right-click on the files you would like to put into a zipped file. Select Send to, then Zip folder (compressed). Double-click the zipped file, then select File and Add Password.

How do I password protect a zip file in CMD?

To password protect a file simply run the zip command and supply the -e flag (which is short for --encrypt ). First pass it the “destination” (e.g. file. zip) and next pass it the source (e.g. file). Per the zip man pages you'll be prompted to input (and verify) the encryption password.


1 Answers

Take a look at DotNetZip (@AFract supplied a new link to GitHub in the comments)

It has got pretty geat documentation and it also allow you to load the dll at runtime as an embeded file.

like image 167
Jan18101997 Avatar answered Sep 20 '22 05:09

Jan18101997