11

I have a password-protected rar file with a few text files in it that are not hidden (you can enter the rar file and see its content), i know the password, I edited one text file and it asked me to enter the password twice to confirm, I pasted it, all seemed in order. Now I can't open this one file (says "incorrect password") but the password still works for all the other files. How come?

2
  • It's hard to disprove the existence of multiple passwords per archive without reading the authoritative RAR specification, but I have never heard of this possibility. What happens if you just try to extract the complete archive? It should just ask for the password once, right? Is it in this case the error message occurs? Apr 7, 2012 at 13:10
  • My lack of hearing about it was as suspected not enough to disprove the existence, as per the answer section below :-) . Apr 7, 2012 at 14:57

2 Answers 2

11

Yes, every entry in a .rar file can be encrypted with a different password.

To prove this, simply create a .rar archive and protect it with a password.
enter image description here
We now have an archive with 1 file that is encrypted:
Now we just drop another file in there...
enter image description here
...chose a different password for this one...
enter image description here

If we now try to extract that second file, using the first password.. enter image description here
...it fails. enter image description here

Additional Notes

This might not be immediately apparent, but the password given when creating the archive, does not protect the archive itself, it protects every single file individually.

For example, setting a password for an archive does not stop you from adding new files to it.

However, this changes when choosing the Encrypt file names option (which you always should when using encryption with file archives). If you also encrypt the file names, this will encrypt the entire stream (not just the individual file streams).
If you want to modify an archive like that at all (like adding new files), you'll need the password that was used to encrypt the entire archive.

3
  • 1
    Great, I did not know that! I just tried it with the *nix version, and apparently it worked there as well (so I have no excuses left :-) ). Apr 7, 2012 at 14:56
  • Thanks for all the answers. That's bad news for me. I won't be able to retrieve the password I lost. To avoid it in future, is it possible to disable it from asking me for password every time I edit an archived file?
    – faer
    Apr 7, 2012 at 15:33
  • @faer As long as the filenames aren't encrypted, you can try one of the many archive password retrieval tools. But I can't recommend any. I would assume it prompts for the password again as a security measure. I haven't checked, but I would assume it can't be disabled. Apr 7, 2012 at 15:41
2

Yes one RAR file can have multiple passwords.

  1. First password when you created the RAR file.
  2. Second password when you add another file in the RAR archive and after you edited the file it will ask for password. It will accept what ever password you give. It is not mandatory that the second password should be same as the first. (You can try with another RAR file too)

Just Recall the second password you might have given.

You must log in to answer this question.

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