6

I have a text file (.txt) compressed in ZIP format protected by a password. I think it has only one line of text and I want to see the contents of this file.

I tried fcrackzip but I think the password is more complicated than I imagine, so the question is: is it possible to see the content without needing to have the password of the file?

I am not an expert in computer security but a somewhat absurd idea that comes to mind quickly is something like seeing the hexadecimal code of the file and trying to decipher it.

Monty Harder
  • 476
  • 3
  • 6
Julián
  • 249
  • 1
  • 4
  • 10
  • 5
    If you could see the "hexadecimal code of the file" then so could the computer and then why wouldn't the computer display it as text for you? – user253751 Jan 02 '18 at 12:16
  • Be aware that https://softwarerecs.stackexchange.com/ is the correct place to ask for an app - but I am not sure if they would allow asking for what look like hacking tools (best phrase it as "lost password recovery" ;-) – Mawg says reinstate Monica Jan 02 '18 at 13:49
  • 9
    _see the content without needing to have the password_ I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. – John Gordon Jan 02 '18 at 16:01
  • 2
    @JohnGordon nor *comprehend* it... :) – RonJohn Jan 02 '18 at 16:27
  • No, not without an unrealistically large resource investment (assuming the the password was chosen in a way that makes it hard to guess). Otherwise it would defeat the entire point of having a password in the first place. – David Foerster Jan 02 '18 at 17:36
  • It may be possible to protect some files with a password, and some files not, all in the same archive. In that case the unprotected files can be extracted by skipping the protected ones. – Cœur Jan 03 '18 at 02:49

3 Answers3

24

No. There are two ways of zip encryption, a classic one, which is weaker, and a newer one based on AES.

In both cases the password is needed in order to decrypt the contents (i.e. it's not just UI, where you could be asked for a password without the program actually requiring it to read the file). So the process would involve breaking the password (which would be more or less complex depending on the algorithm used and how the password was used).

At most, you would be able to obtain without decrypting, in addition to the filename, the CRC32 of the plain file. But although that would help if you already suspected what the content was, it probably won't be helpful here, even if it is just a line of text.

Luke Sawczak
  • 625
  • 5
  • 7
Ángel
  • 17,578
  • 3
  • 25
  • 60
  • 8
    Seems like poor design if the encrypted format actually leaks a CRC of the plaintext. – kasperd Jan 02 '18 at 10:08
  • @Julián bruteforcing would only really be a help if the password isn't too complex. Anything longer than roughly 10 alphanumeric characters is pretty much unbreakable by modern standards – Nzall Jan 02 '18 at 16:23
  • 3
    @kasperd the conspiracy theorist me would say it's by design; you keep an encrypted version of a file you're not meant to have, three letter agency arrests you for possession of said file with CRC32 – Hayko Koryun Jan 02 '18 at 16:28
  • 5
    @HaykoKoryun: There are many files which share a CRC32, necessarily. – MSalters Jan 02 '18 at 16:48
  • 4
    What are you trying to say is "not asked by the UI but not actually required"? The password? You just said the password *is* needed, so that doesn't seem to make sense. – user2357112 Jan 02 '18 at 17:27
  • @user2357112 The phrase could stand to be cleaned up, but it means, "The UI is not acting as an artificial and easily bypassed barrier when prompting for the password; the password is actually needed for reading the zip file." As written, try mentally inserting some grouping symbols: "ie. it's not `(`asked by the UI but not actually required`)`" – jpmc26 Jan 02 '18 at 18:22
  • 4
    @kasperd The whole original design of [ZIP encryption](https://link.springer.com/content/pdf/10.1007%2F3-540-60590-8_12.pdf) was flawed, and it's generally considered to be insecure. WinZip-defined AES-256 encryption, on the other hand, will produce a CRC of all zeros, and therefore leaks no data about the original file (other than the original size, timestamp, and name). – Christopher Schultz Jan 02 '18 at 20:21
11

No, nowadays zip files are protected by AES. This will hide all of the plaintext in a way that you can only recover it when you have the key. The only other thing you can see is the size of the plaintext as that is as good as identical to the size of the ciphertext.

Hexadecimals are just a readable representation of the bytes that make up the ciphertext. However, as the ciphertext will consist of byte values indistinguishable from random, that will not help you one iota.

Maarten Bodewes
  • 4,562
  • 15
  • 29
9

Unfortunately, not really.

What you must understand here is that we are not speaking of a file that "is there", access to the original contents is not actively being blocked by the zip software you are using. That would make password protection essentially useless, as another software could just show the file without asking for the password, right?

Instead, the file content itself is cryptographically encrypted, and the password you are being asked for is the actual decryption key itself, which is required to transform the encrypted contents to their original form.

In theory, it is possible to brute-force the key, but this is only possible in practice if you have a finite (and "not too long") list of possible keys, or if the key is considerably short (which, according to your question, does not seem to be the case).

John Weisz
  • 191
  • 5