•7-Zip version and type (32-bit / vers 7z920 )
•Windows version and type Windows 7 Ultimate SP1 (32-bit)
•CPU type Genuine Intel (R) CPU U7300 @ 1.30 GHz
•RAM size 2.00 GB (1.87 GB usable)
Created a database of 7zips and deleted originals. New to data archiving and idiotic I know. Thanksfully most archives that were burnt to disc were good. Except for two archives. They were all password protected and with default 7zip settings on compression, up to date 7zip (7z920)version. When opening the archives I was able to extract certain folders that decompressed so that there are only a couple of folders remaining that would not decompress in these archives.
Everything else has been squared away and the removable files have been salvaged from these archives, however the remainder is sizeable, the archives created and the files inside are fairly important and mostly irreplaceable, I know, I put myself in this situation. The error that shows up upon extract or test is as the title suggests "Data error in encrypted file 'file.7z' Wrong Password?" "File.7z" has been placed instead of the file name.
The password worked fine on the rest of the archive and from what I have gathered online it appears that these remaining files may be corrupt. Is there anything I can do to recover these files? Any advice is greatly appreciated. I apologise if this topic is covered else where.
There two possible reasons:
1) Wrong password
2) Corrupted data
You can call
7z t a.7z > test.txt
7z l a.7z > list.txt
if there is some "OK" file in "BAD" solid block, then it's "Corrupted data" case. In that case it's difficult to recover data.
How to recover corrupted data.
You must find exact place of corrupted data. Then you must find another copy of file that was compressed in that place. Create another copy of .7z arechive with same solid block including that "GOOD" copy of "bad" file with same settings. And replace "BAD" data with new "GOOD" data.
Hello! I found this thread having experienced the same problem. I create an archive with a command
7za u -m0=LZMA2 -p -mhe=on -x!xcf/. myarc.7z myfiles/
...key in a password, let's say, '111' and get a normal archive that I can extract and test without any problems. The next steps corrupt data in the myarc.7z:
Then, if I test the resulting archive with 7za t myarc.7z , I get the following:
Testing myfiles/18.TXT Data Error in encrypted file. Wrong password?
Testing myfiles/19.TXT Data Error in encrypted file. Wrong password?
Where the files marked with "error" were packed with the password '111' , and "non-error" files are those packed with '222'. Then, if I update the archive with no files added to or removed from myfiles/ dir, but with the password '111' again, I get vice versa:
Testing myfiles/2.TXT Data Error in encrypted file. Wrong password?
Testing myfiles/20.TXT Data Error in encrypted file. Wrong password?
If I just update the initial archive with a new password ('222' instead of '111') without any files changed, all of them get marked 'Data error...'.
Therefore, updating an archive with a new password causes the initially packed data unavailable, while the names of the lost files could still be retrieved.
it's old version of 7-zip.
Use latest version of 7-zip instead.
Thank you for the prompt reply, Igor.
I've just tried the same procedure on lubuntu 16.04 (64-bit) with a manually installed p7zip-full & p7zip of 16.02  version (as lubuntu 16.04 still comes with 9.20) and obtained the same result: files packed the first time become unavailable after updating an archive with a new password.
Describe all steps again with new version 16.02.
Use simple commands.
OK, here is my experiment with 16.02 version:
7za u -p -mhe=on myarc.7z myfiles/ using a password '111'
7za u -p -mhe=on myarc.7z myfiles/
When it asks for a password for the 1st time, type '111'. When it asks for a password for the 2nd and the 3d time, type '222'. The compession ends with "Everything is OK" string.
7-Zip (a)  16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=ru_UA.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU Intel(R) Pentium(R) CPU G3220 @ 3.00GHz (306C3),ASM)
Scanning the drive for archives:
1 file, 1031 bytes (2 KiB)
Testing archive: myarc.7z
Enter password (will not be echoed):
Path = myarc.7z
Type = 7z
Physical Size = 1031
Headers Size = 263
Method = LZMA2:21 7zAES
Solid = +
Blocks = 2
ERROR: Data Error in encrypted file. Wrong password? : myfiles/1.TXT
ERROR: Data Error in encrypted file. Wrong password? : myfiles/2.TXT
Sub items Errors: 2
Archives with Errors: 1
After this, the files 1.TXT and 2.TXT could not be unpacked, the files 3.TXT and 4.TXT (added on update) are retrieved normally.
As I understand, the reason is the changed password. If type '111' on update, no problems arise. The mere ability to key in a different pass on update misleads, 7zip either should not allow to do this at all, or do that without a corruption of data.
If invoke the above command without -p option, it asks for a password only once, but the headers get visible after such an update.
At least, I found a solution how to retrieve unavailable files if the archive was updated with a new password:
Yes, two requests for password are possible in some cases.
Later I'll look the code.
Now you can use "u" without "-p" switch.
So it will request password only one time.
Yes, using "u" command without "-p" switch was the first thing I tried out, and it worked. However, "-mhe=on" switch didn't work in that case; all file names became visible. Will appreciate yuor code revision. Please, tell here if you fix it. Thanks!
New version 16.02 keeps header encryption even without -mhe.
7z u a.7z file.txt
Log in to post a comment.