Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Test to see if zip file is encrypted without knowing the contents in the archive (zippedfile.encrypted doesn’t cut it, here’s why)

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20324 |

    I need a way to test to see if a zip archive is encrypted (ex. object.IsEncrypted), ziparchive doesn’t have a property or method that does this; however zippedfile does. The problem with this is that when I create a zippedfile object, you have to explicitly state a file within the encrypted file (zippedfile constructor overload list doesn’t have a method that only requires an AbstractFile object and nothing else) which cannot be known if the zip file is encrypted, is there a workaround to this problem, and if so, what is it. Thanks in advance

    Imported from legacy forums. Posted by Danny (had 1785 views)

    Xceed Support
    Member
    Post count: 5658

    Hi Danny,

     

    Unfortunately, it is not possible to check whether a zip file is encrypted without retrieving the contents in the archive. In the Zip format, each item is encrypted (or not) individually. One item may be encrypted, and the next one may not be. Thus, there is no global encryption flag or other such concepts.

    Imported from legacy forums. Posted by Mohamed [Xceed] (had 1473 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.