36

You have a zip file that you created with 7z to password-protect it with AES 128. Can a smart adversary extract the data only through brute force, or is the file vulnerable to other attacks - such as, I don't know, being able to bypass the password and extract the data?

1

4 Answers 4

25

ZIP files are encrypted with AES-256, and the key is derived using a slow key-derivation function (KDF), which makes bruteforce and dictionary attacks generally infeasible. There are no currently known ways to bypass the encryption.

6
  • 1
    ZIP files can be encrypted with AES less stronger than AES-256! 7-Zip offers only AES-256 (or old CryptoZip), but Total Commander for example can encrypt ZIPs with AES-192 and AES-128 as well. So your correction to OP is wrong.
    – trejder
    May 13, 2013 at 8:08
  • 3
    @trejder Except that the current best known attack against AES-128 will still finish about the same time as the heat death of the universe, even if we factor Moore's law in. And that's assuming zero cost for the KDF, which will actually be the largest computational factor.
    – Polynomial
    Nov 7, 2013 at 22:47
  • 1
    I totally agree with you, of course. I just wanted to point out, that (what I get as) correction, that ZIPs are encrypted with AES-256 is (may be) a little bit misleading. Nothing else, no offence.
    – trejder
    Nov 8, 2013 at 6:55
  • No, OP was talking about 7zip, not TC or other weaker means of encryption.
    – Overmind
    Oct 6, 2016 at 4:53
  • @Overmind 7zip uses AES.
    – Polynomial
    Oct 7, 2016 at 19:13
24

In direct meaning, you mentioned (extracting data), no. But keep in mind, however, that any program (or user), in any password-protected ZIP archive, can (without knowing the password):

  • browse list of files,
  • check file types1.

ZIP files can also be "broken" in the meaning, that you can overwrite exisiting, password-protected file, stored inside ZIP file, with another file, named the same, without knowing the password.

All these mentioned operations does not give attacker access to contents (he or she is still unable to extract data), only list it or destroy it. So I'm mentioning this only as a possible side effects, you may be not aware of. Some people treats this as security leaks, stating that for this reasons, ZIP files are insecure, but other my assume that security is not violated, even with these mentioned "additions".

Since contents of ZIP file can be changed, without knowing the password, by replacing a password-protected file with another one, we can speak about complete insecurity in psychological terms (social engineering, hacking etc.). The attacker can alter contents of ZIP file, without knowing the password and claim to its victim that it is unchanged. Victim, without knowing above mentioned side-effects, may incorrectly assume, that archive hasn't been changed or its contents aren't altered, since he or she (the victim) is the only person, that knows the password.

Here you have my simple question about security of ZIP files, which turned out to be a very good readout, with a lot of useful answers and comments.

1Try to send encrypted, password-protected ZIP containing EXE file via Gmail to see this "in action". Gmail will be able to detect, that you're sending an executable file (and prevent you from doing so) even though, it does not know password, your ZIP is protected with. Side note: It is also both funny and surprising, that renaming the very same file, by giving it different extension (i.e. file.not-zip) can completely disarm this "protection" mechanism and allow you to send archive containing executable file. Funny, because Gmail is able to "break" encrypted, password-protected ZIP to "save" user from sending executable files, but "dies" completely on file rename.

4
  • 2
    Browsing and checking file types can also be denied. Both Winrar an 7Z can encrypt also the file names, so no opening of anything until you use the correct password.
    – Overmind
    Oct 6, 2016 at 4:54
  • 2
    @Overmind Does that actually work for zip archives, or just more advanced formats like rar and 7z? Aug 20, 2018 at 1:23
  • If I wrote the encryption, it would encrypt the complete file. It would never occur to me to do it any other way. Set of files -> zip archive -> encrypted archive.
    – gnasher729
    Mar 19 at 12:58
  • @gnasher729 Depends on your actions or functionalities offered by software that you use. If you i.e. check Encrypt checkbox in Total Commander then -- as you say -- entire file, including file list will be encrypted and such file can be safely sent through Gmail (with "file is encrypted" warning) even if it includes executable file or otherwise file type not permitted by Google as Gmail attachment. But other software can offer encryption at file level only and such file will be encrypted while its contents file list still remain plain.
    – trejder
    Mar 20 at 13:24
4

No, as far as I'm aware, there are no current viable attack vectors other than brute forcing the password.

1

If you know the plaintext of some of the files in the archive, then pkcrack will do significantly better than brute force.

https://www.unix-ag.uni-kl.de/~conrad/krypto/pkcrack.html

You might also want to search the internet for "pkzip known plaintext" attack to find more resources.

1
  • Only for zip files using the original pkzip encryption, which 7zip does not, so this answers the title but not the actual question. Mar 20 at 1:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .