aspose file tools*
The moose likes I/O and Streams and the fly likes Decrypt Zip File with 128bit AES  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Decrypt Zip File with 128bit AES  " Watch "Decrypt Zip File with 128bit AES  " New topic
Author

Decrypt Zip File with 128bit AES

Giorgos Mourtasagas
Greenhorn

Joined: Nov 04, 2009
Posts: 18
Hello my name is George ,
I want to make a program to decrypt a zip file with 128-bit AES Encryption using Brute Force and Dictionary Attack.
Because it is my first time I try to make something with the encrytpion libraries I don't know much.
Because that is an exercise they told us to use this library http://www.javamex.com/arcmexer/ because the java.util.zip is not so good.
So I want to give me some help.
Any help is welcoming.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42649
    
  65
Welcome to JavaRanch.

What do you need help with?

In my opinion, trying to brute-force AES-128 is pointless unless you have a USD $100m supercomputer, and even then it will take months or years.
How do you propose a dictionary attack might work? That's something for cracking passwords, not encryption.

As an aside, java.util.zip works just fine; I've never had any problems with it. And if I needed support for other compression formats, I'd go with http://commons.apache.org/compress/


Ping & DNS - my free Android networking tools app
Giorgos Mourtasagas
Greenhorn

Joined: Nov 04, 2009
Posts: 18
Thank you for the quick response.
Maybe I did not give to understand what I mean.
I want to make a program that will open a zip file with that decryption(128bit AES).
Next I want to choose wich way to use for the decryption (brute force or dictionary attack) , to find out the password form the encryption.Only that.And the other part of program are the exceptions.
And all of that I put it in GUI.
Sorry if I did not give you you occupy in the first post.
If you give me a code for example I would appreciate that.
Thanks again.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42649
    
  65
Next I want to choose wich way to use for the decryption (brute force or dictionary attack) , to find out the password form the encryption.

In my opinion, while both attacks are possible, neither is likely to succeed. You can do the math on how many keys you need to try on average for a brute-force attack (a little hint: you and I will be dead before it's likely to succeed). A dictionary attack may be successful for a spectacularly bad choice of password, of course, but that seems unlikely. So, in my opinion, this project is doomed to fail; what prompted you to take it on?
Giorgos Mourtasagas
Greenhorn

Joined: Nov 04, 2009
Posts: 18
It is another story why I prompt to take it now.
Simply I choose tyhis exercise.When I talked with my professor they told me , I don't care for the result (if I succed to decrypt the zip file in logical time, I deal with the exceprions).
I understand why you sai that project is doomed to fail but I must do it to get my diploma.
So if you get an example of a code to make a start send it to me , if you don't matter.
Thanks for the help.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42649
    
  65
If this is for a school project then you should be writing the code. So: what ideas have you has so far, either for the brute-force or dictionary attacks? Do you know how those work in theory? If so, where are you facing difficulties implementing them?
Giorgos Mourtasagas
Greenhorn

Joined: Nov 04, 2009
Posts: 18
Hi.
I want to make a program to read a zip file with a password(aes encrytpion) and I foun the password.
At first i know the password and I want to do If I write it wright.
I read a zip file but when I try to read it with encryption I take that exception.
That is the program



And the exception is:

java.util.zip.ZipException: invalid CEN header (encrypted entry)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:114)
at java.util.zip.ZipFile.<init>(ZipFile.java:75)
at xer.main(xer.java:8)



Can anyone help me?
The next stage is to find out the password with brute force or dicrionary attack in zip file.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42649
    
  65
Can you verify by some other method that the file is, in fact, a valid zip file? How did it get created?
Giorgos Mourtasagas
Greenhorn

Joined: Nov 04, 2009
Posts: 18
I create the zip file with the WinZip (program) and I make the encryption with that.
When I create the zip file without the encryption I read it but with the encryprtion i have problem.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42649
    
  65
I don't think the java.util.zip classes can deal with WinZip's encryption - that's a proprietary extension, if memory serves.
Giorgos Mourtasagas
Greenhorn

Joined: Nov 04, 2009
Posts: 18
And what class can deal with winzip decryption?
Maybe javax.crypto or something else?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42649
    
  65
There are a couple of commercial libraries that can do that; a quick search will find them.

You could also have a look at http://code.google.com/p/winzipaes/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Decrypt Zip File with 128bit AES