Open ciriousjoker opened 7 years ago
I was about to say "sharpcompress doesn't support encrypted 7zip files" but honestly I can't remember.
However, the error you got is fixable because it's using a stream that doesn't support seeking though 7zip requires seeking.
But if the library requires seekable streams (which totally makes sense the way 7z works), why did it work with unencrypted files? I mean they'd have to be seekable too, right?
Woops
It must be that the decryption code just needs to know the length for some reason and it's using a different stream class.
The class with the error is one I wrote for the purpose of ensuring no seekable stream was used in other parts of the code.
I haven't done much with the 7zip code personally. I really hate the 7zip archive format.
Can you point me in the right direction please? I tried using your API examples, but they only seem to work with zip archives ..
(Aka replacing var archive = ...; with var archive = ArchiveFactory.Open(...); doesn't work either)
SevenZipArchive.Open(new FileStream(...)); also didn't work
It's not going to work without a code change. You're going to get the exception you posted always with that encrypted 7zip file
So I'd have to fix your library? Or are you saying that my encrypted 7zip file is broken?
By the way, no matter what 7zip file I use (encrypted or not doesn't matter), I get this weird thing in the locals tab:
https://gyazo.com/363d6b37b9dd0ff79df69d602d04fa52
Not sure if it has something to do with this error, but it always throws that error. However, with unencrypted 7z files it still extracts the whole thing
I have a feeling encrypted 7zip just isn't supported. I don't recall putting that in the supported formats matrix
Ye, I just assumed that encrypted 7zips wouldn't make a difference to the 7z.dll ...
Anyway, I "fixed" it now by encrypting the final 7z with AES. For my purposes that's acceptable
This code doesn't used the 7z dll. That's why he behavior is different than other libraries as others do use the native dll.
I have an encrypted 7zip archive (linked below) encrypted with the password "dontgoout", but whenever I try to extract it, it throws an error at MoveToNextEntry.
Here's a screenshot of the stack trace: https://gyazo.com/6fb0b0c0731d6e23d04a26e301cc2dbe
I created the archive using the 7zip client for Windows using these settings: https://gyazo.com/ca4e67e6a259d79cdf0675dc42fd8268
Original name was 0.tmp, but Github only allows zip files. 0.tmp.encrypted.zip
Extracting the same archive without any password works perfectly fine and I can extract the encrypted 7z archive using the 7zip desktop client, so this has to be a bug in the library (Or I'm just too dumb for life and I missed something I should have done)
Here's the code I used to extract that archive: