Files can be replace/add/delete from password protected ZIP file when encryption is set to None

0
Application is relying on the commercial product “ComponentPro ZIP” to create the compressed ZIP file and make it password protected. As per analysis, this issue is only occurring when the final ZIP file has few files without password. We had requirement, to keep few files without password protection. It has been observed that, when all the files within compressed ZIP file are password protected and and encryption is set to none then files within ZIP cannot be replaced using any other third-party tool like WinZip or 7zip. And even password protection works fine when user tries to extract the content of ZIP file. However, when any file is added without password protection and encryption is set to none while creating compressed ZIP file then files within ZIP can be replace/add/remove using tools like WinZip or 7zip. User can open the compressed ZIP file with WinZip OR 7zip then they are able to drag the new file in password protected ZIP file and file will get replaced/added. Questions: 1. How can we fix this issue by creating password protected compressed zip file, having few files without password protection in it? 2. What's the relevance of EncryptionAlgorithm property in Ultimate ZIP ? Can we use it to fix the issue ? Reference: Current implementation how application is creating ZIP file var zipDestPath = @"c:\dest"; using (Zip zip = new Zip()) { zip.Create(zipDestPath); zip.EncryptionAlgorithm = EncryptionAlgorithm.None; zip.AddFiles(@"c:\src\testWithoutPwd.doc"); //file without password protection zip.Password = "Password123"; zip.AddFiles(@"c:\src\html", "html"); //directory with password protection zip.AddFiles(@"c:\src\test1.xml", "xml"); //file with password protection if (File.Exists(@"c:\src\test2.doc")) { zip.AddFiles(@"c:\src\test2.doc", ""); //file with password protection } zip.Close(); }
zip
 
asked 6/29/2021 7:22:25 PM
add a comment

2 Answers

0
Hi Belinda, Please attach a link of code **Sln** directory which you are using we can download and check .
edited 7/2/2021 12:50:46 AM
answered 7/2/2021 12:49:21 AM
add a comment
0
Hi, 1. Please check this [Adding files to an archive][1] 2. Please check this [Encrypting and Decrypting][2] [1]: https://doc.componentpro.com/ComponentPro-Zip/Adding-files-to-an-archive. [2]: https://doc.componentpro.com/ComponentPro-Zip/Encrypting-and-Decrypting2 Both the links have sample and details for implementation and description.
 
answered 6/29/2021 8:51:41 PM
  Thank you for the responses however the provided links are not helpful and we are not able to fix the listed issue. Kindly confirm - does ComponentPro UltimateZip provides the feature to create the password protected zip file which has few files without password and no one will be able to replace/add/delete the files from it using any third party tools like WinZip, 7-Zip etc ? Belinda van 6/30/2021 4:01:19 PM
add a comment

Your Answer

Not the answer you're looking for? Browse other questions tagged zip or ask your own question.