MehwishRaza / winzipaes

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

Extract file content in memory #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,
I need to read the content of an AES encrypted file keeping all the content in 
memory.
Something like

new ZipFile().getEntry("xyz").getInputStream()

Can this be done with winzipaes?

I need this for two reasons:
1. I can NOT write on the file system the content of the encrypted file in 
clear, this would mean to actually "break" the encryption (to rely on file 
system access control alone is not ok).
2. zip archives can be VERY big and writing on disk uncompressed content and 
deleting it every time would not be practical

I tried to modify the code in AesZipFileDecrypter.extractEntry to use a 
ZipInputStream instead of a ZipFile around line 220 but this class complains 
about the wrong compressed size

Exception in thread "main" java.util.zip.ZipException: invalid entry compressed 
size (expected 1566 but got 1538 bytes)
    at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:378)
    at java.util.zip.ZipInputStream.read(ZipInputStream.java:141)
    at java.io.FilterInputStream.read(FilterInputStream.java:90)
    at Prova.extractEntry(Prova.java:115)

Original issue reported on code.google.com by l.bolz...@gmail.com on 13 Dec 2010 at 2:22

GoogleCodeExporter commented 9 years ago

I'm working on this. I think the AesZipFileDecrypter.extractEntry method 
generates an invalid intermediate temporary zip file.
If I do not delete this file and try to open it with File Roller 2.32 this 
error is reported: 

error:  invalid compressed data to inflate

Similar to what happens with ZipInputStream. 

Looks like only the Sun ZipFile class is able to open the file.

Original comment by l.bolz...@gmail.com on 15 Dec 2010 at 3:40

GoogleCodeExporter commented 9 years ago
I probably won't work on this in the near future - sorry.

Original comment by olaf.merkert on 17 Dec 2010 at 5:52

GoogleCodeExporter commented 9 years ago
"recorded" with issue 15

Original comment by olaf.merkert on 3 Jan 2011 at 3:14