echandragrg / winzipaes

Automatically exported from code.google.com/p/winzipaes
0 stars 0 forks source link

Invalid entry CRC when decrpted a file with only 17 char or less #41

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. using 7 zip to compress a text file with only 17 word or less and with 
following parameters
   - Archive format : ZIP
   - Compression level: Normal
   - Compression method: Deflate
   - Dictionary size: 32KB
   - Word size: 8
   - Encryption method: AES-256

2. Debug at the CentralDirectoryEntry 
   - this.actualCompressionMethod = raFile.readShort( getExtraFieldOffset() + 9 );
   - the actualCompressionMethod return 0 instead of 8

3. Exception found when reading the zipInputStream.read(buffer) at 
AesZipFileDecrypter.java

SEVERE: java.util.zip.ZipException: invalid entry CRC (expected 0xffffffff but 
got 0x83dcefb7)
Exception in thread "Main Thread" java.util.zip.ZipException: invalid entry CRC 
(expected 0xffffffff but got 0x83dcefb7)
    at java.util.zip.ZipInputStream.read(ZipInputStream.java:179)
    at java.io.FilterInputStream.read(FilterInputStream.java:90)
    at de.idyl.winzipaes.AesZipFileDecrypter.extractEntry(AesZipFileDecrypter.java:367)
    at de.idyl.winzipaes.AesZipFileDecrypter.extractEntry(AesZipFileDecrypter.java:405)

Expected actualCompressionMethod is 8, but even hardcode 8, there is another 
exception happened.

Expected output is the file can unzip without problem

The winzupaes is the latest version updated at Jan 2012 and OS is win7 64 bits

the attached is the problem file, the password for this testing file is abcd1234

Original issue reported on code.google.com by calvin....@gmail.com on 19 Mar 2012 at 5:10

Attachments:

GoogleCodeExporter commented 8 years ago
until it's fixed, you could use AesZipFileDecrypter.extractEntryWithTmpFile()

Original comment by olaf.merkert on 19 Mar 2012 at 6:39

GoogleCodeExporter commented 8 years ago
test case ok now - the CRC was only added after the buffer was filled for the 
first time

Original comment by olaf.merkert on 19 Mar 2012 at 7:55

GoogleCodeExporter commented 8 years ago
Thanks for the quick respond, the fix tested and confirmed solved. The case 
closed. 

Original comment by calvin....@gmail.com on 20 Mar 2012 at 1:36

GoogleCodeExporter commented 8 years ago

Original comment by olaf.merkert on 16 Apr 2012 at 8:46