is it possible for two files in a rar to have different passwords?

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?


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.


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.