Closed slavkoja closed 6 years ago
Unzip/zip will remain the default for zip archives, but if it's possible to recognize these type of zip archives, it might be possible to switch to 7z for these.
Is it possible to get a sample?
For me it seems as reasonable solution.
I am sorry, i cannot provide original ZIP, it is from my bank with private info. After quick Internet research I generated ZIP sample archive via 7z
with (the 123456 is password):
echo Hello world > test.txt
7z a test.zip test.txt -tzip -mem=AES256 -mx9 -p123456
On both files now file
returns (but i really don't know if it is the same format):
Zip archive data, at least v5.1 to extract
Running unzip
on it provides the same result as with original:
unzip test.zip
Archive: test.zip
skipping: test.txt need PK compat. v5.1 (can do v4.6)
Can you generate own one or i have to attach it?
Thanks, this information is sufficient.
I know now how to recognize compatibility issues with unzip. So if unzip isn't capable, an alternative (7z, unar) could be used instead. (I just have no idea yet how to program it.)
I don't know if this help you (i am not programmer), but see the version line:
7z l -slt test.zip | grep -E "^Method|^Version"
Method = AES-256 Store
Version = 51
IMO, there must be the way, to get this info outside of terminal. Another help can be unzip's return value. For this archive it returns 81 and manpage tells:
81 testing or extraction of one or more files failed due to unsupported compression methods or unsupported decryption.
Then, if unzip returns 81, you can try 7z...
IMO, there must be the way, to get this info outside of terminal.
The problem is not about getting the info, it's about processing the information during the flow of execution.
Thanks for making this change, but I've just built and tried 0.5.4.12 and the "Enter password" menu entry is greyed out and disabled after deselecting unzip as the default zip file handler. The same is true of the password entry box in the extraction dialog. As a result, it's still not possible to extract an AES encrypted zip file using xarchiver.
Your AES encrypted zip file is password protected?
Yup. The "Hello world" example created following @slavkoja's steps above is also password protected. Should just need the password boxes enabling and use of the "-p" parameter of 7z, I'd imagine
I can confirm, that it doesn't work.
When i have checked the "prefer unzip...", the file is marked with the key icon (on the left), and when i try to extract it, i am asked for password (it fails of course).
But when i uncheck the "prefer unzip..." (and close/open xarchiver), the file is not more marked by key icon and when i try to unpack it, i am not asked for password. It fails too, with:
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=sk_SK.utf8,Utf16=on,HugeFiles=on,64 bits,6 CPUs AMD FX(tm)-6100 Six-Core Processor (600F12),ASM,AES-NI)
Scanning the drive for archives:
1 file, 29825 bytes (30 KiB)
Extracting archive: /home/myhome/tmp/4022418342_20170930_9_MSKB.zip
--
Path = /home/myhome/tmp/4022418342_20170930_9_MSKB.zip
Type = zip
Physical Size = 29825
ERROR: Wrong password : 4022418342_20170930_9_MSKB.pdf
Enter password (will not be echoed):
Sub items Errors: 1
Archives with Errors: 1
Sub items Errors: 1
Edit: The "Enter password" menu entry is grayed in both cases.
Should work now.
I recently got AES encrypted ZIP archive, and with the
xarchiver 0.5.4.10
i got:The same result i got with
unzip
, but i have no problem to extract it with7z
. I don't know how it is handled byxarchiver
, but i cannot find any configuration option for this. AFAIK unzip is not AES capable...