This behavior is really unfortunate. I thought I can use a password-protected zip-file (or 7zip) to store some sensetive data which I need regularly. But now everytime I want to update the zip-file I have to unpack it, delete it (the old one), archive it again and delete the unpacked files. Too many steps for just adding something.
Have just the same problems like all others before since this discussion has been started.
I update my encrypted files often and to do so I have to unpack and repack it to be encrypted again. That takes long time every time since the other files in the archive are very large. The updated file is small, but anyway I have to do the prozess with all files, even the unchanged large ones.
Please think about this quite small change to the almost perfect 7zip.
I confirm the behavior exactly as described by Pesala: when updating an encrypted file in an archive using the context menu, the encryption is silently dropped without a warning. I don't know why people keep saying that the context menu action works as expected. I'd at least give a message box confirmation in such a case.
I discovered the problem when using a simple drag and drop into an existing protected archive. The files already in the archive retained their encryption while the new files dropped into the archive were unprotected. I really wasn't expecting this, bit of a shame as the software is great to use!
I do a workaround solution for automatic password removal. By drag and drop of a folder or file(s), password shall be removed without notification. But, then from file manager, select any file, and right click to invoke "Add to Archive" > select the same archive and then protect with password. Then after opening the archive with password, remove the unwanted file.
This is cumbersome...but works.
OS: XP SP3 but in VirtualBox, Linux host.
7z ver 9.20
1. Single file is created with password from explorer/context menu or from 7z file manager: foo.7z (password, non-encrypted filenames, contains foo.txt)
2. In same folder, a selection of files (foo.txt is not one of them), right-click->7-zip->Add to archive-> (or Add to 'foo.7z', I renamed folder to 'foo' to try that)
3. Result: Old file is password protected, new files are not.
I can't reproduce what you have done i.e. make all files unprotected by updating the archive, because that is what I understood at least from some replies. If I am mistaken, correct me on that.
VARIATION: If in the selection of files you include foo.txt, then the resulting 7z archive has all files non-protected. If you have multiple files archived with password then all of these, together with the new selection must be added in order for the password to be removed. This should not happen either, it should ask for password and without one it should not let you add files in the first place.
BUT: I can't reproduce a behavior where the password is removed from files whithin the archive if none of the original archived files are used.
It only gives password protection for the first time adding folder(s) and file(s). To make life my easier if I want to add new files/folders into an existing protested 7z file, I add them first (of course no protection on the new ones), then extract all and add to a new pwd protected 7z file. Awkward huh but works for me.