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?
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With