Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Decompressing password-protected ZIP files with .NET 4.5

Microsoft introduces improvements for ZIP file handling in .NET 4.5 in the System.IO.Compression namespace. Namely the classes ZipArchive and ZipFile. However, I have not yet seen a way to use native .NET ZIP file handling for password protected files. Is there a way to achieve this? (I am aware that there are pretty good 3rd party zip file libraries, that is not the question.)

like image 940
So Many Goblins Avatar asked Oct 31 '12 14:10

So Many Goblins


People also ask

Is it possible to crack Zip password?

However, if you tend to forget the ZIP password by any chance, you can still access the ZIP file by removing the password even without losing the data. Since you don't remember the password, the best way to do this is by downloading a program that can crack the ZIP password for you.

How do I password protect a zip file in C#?

Unfortunately there is no such functionality in the framework. There is a way to make ZIP files, but without password. If you want to create password protected ZIP files in C#, I'd recommend SevenZipSharp. It's basically a managed wrapper for 7-Zip.

Does Windows 10 support encrypted zip files?

Windows 10 provides an encryption feature as well, and you can follow these simple steps to use it: Right-click a file or a folder, and click Properties. Click Advanced and tick the Encrypt contents to secure data box. Click OK, Apply, and then OK.


1 Answers

Unfortunately not. There is no support within the .Net Framework 4.5 for password protected zip files. In this case you have to switch to one of the well known 3rd party libraries.

like image 133
Oliver Avatar answered Sep 21 '22 20:09

Oliver