rkoch / winzipaes

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

Decryption Issue #21

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have dowloaded the windiff.zip from  Yizhuan.Yu, post(Issue # 8), but my 
problem is different, i have downloaded the latest source you have provided i.e 
http://code.google.com/p/winzipaes/downloads/detail?name=winzipaes_src_20100806.
zip&can=2&q=

1. m creating encrypted zip file using 

AesZipFileEncrypter enc = new AesZipFileEncrypter( "c:/test_encrypted1.zip" );
      enc.add(new File("c:/windiff.zip"), "abcdef");

its creating but when m trying to open that file it says "Cant open file it 
does not appear to be a vaild arichive". is code not creating the valid 
encrypted zip file? and the code u have provided for AesZipFileEncrypter class 
i am using its add(new File("c:/windiff.zip"), "abcdef");
 method like mentioned above but Yizhuan.Yu, post(Issue # 8) he's using addEncrypted(new File("c:/windiff.zip"), "abcdef");
 method of AesZipFileEncrypter class but the source i have downloaded there is no such addEncrypted(new File("c:/windiff.zip"), "abcdef");
 method, m i using the correct version of your project?

2. And when m decrpting encrypted zipfile using AesZipFileDecrypter 

it gives exception: " Exception in thread "main" java.util.zip.ZipException: 
expected CENSIC not found at entry no 1 in central directory at end of zip file 
at 132586812
"

Pls tell whats an issue? i m also attaching source i am using , Thanks!

Regards,

AB

Original issue reported on code.google.com by adilsa...@gmail.com on 16 Aug 2010 at 3:34

Attachments:

GoogleCodeExporter commented 8 years ago
Some hints should solve your problem:
1. If you want to add all entries of the input (zip) file, you have to use 
enc.addAll("windiff.zip") instead of enc.add("windiff.zip"). When using the 
latter, your simply add the windiff.zip file to the new archive and encrypt it.
2. When using the instance methods of AesZipFileEncrypter you have to call 
close() when you've added files you wanted to add to close the new archive.
3. If you only want to zip+encrypt one file, you can use the following static 
method:
AesZipFileEncrypter.zipAndEncrypt( inFile, encFile, "abcdef" );
But coming back to 1.: If you want to encrypt the contents of an existing zip 
file (encrypt all of the files it contains): use enc.addAll() + close()

Original comment by olaf.merkert on 16 Aug 2010 at 6:13

GoogleCodeExporter commented 8 years ago
Thanks Olaf that was really helpful!! its working now 

i have two questions:

1. does it support files placed in folders for e.g: src/code/somefile.java

2. is it encrypting the content of each file or each file is just password 
protected?

Thanks

Regards,

AB

Original comment by adilsa...@gmail.com on 17 Aug 2010 at 7:33

GoogleCodeExporter commented 8 years ago
getting this Exception  "Exception in thread "main" 
java.io.FileNotFoundException: 
C:\adil\windiffziptest\winzipaes_src_20100806\WEB-INF\web.xml_TMP.zip (The 
system cannot find the path specified)
        at java.io.FileOutputStream.open(Native Method)
" when decrypting zipfile which holds files in directories, one file is placed 
in root and other in subdirectory i.e :winzipaes_src_20100806\WEB-INF\web.xml

also attaching encrypted zip file. Thnaks!!

Original comment by adilsa...@gmail.com on 17 Aug 2010 at 9:10

Attachments: