• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Decrypt Zip File with 128bit AES

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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/
 
Giorgos Mourtasagas
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And what class can deal with winzip decryption?
Maybe javax.crypto or something else?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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/
 
Mo-om! You're embarassing me! Can you just read a tiny ad like a normal person?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic