Back | Reverse | Quick Reply | Post Reply |

JAVA: ZIP file protected with password (I know it)
Link | by YoGa on 2006-01-11 12:30:47 (edited 2006-01-11 12:38:15)
Hi,
How to open a ZIP file for reading/writting protected with password (I know the password for that file)?
Should I use java.util.zip?HOW?
Should I use java.security.KeyStore?HOW?

Please Help,..as fast as possible
THANKS

YoGa

Re: JAVA: ZIP file protected with password (I know it)
Link | by gendou on 2006-01-11 14:29:22
instead of java, you could use the unix command line tool zip.
the -e command line argument allows you to encrypt with a password.


Re: JAVA: ZIP file protected with password (I know it)
Link | by psoplayer on 2006-01-11 14:45:27
If you're using Windows, whatever gave you the idea for using the Java utility set? Just download a zip utility like WinRAR. It should ask you for the password when you open the file and then you can treat it like any other zip file.


Re: JAVA: ZIP file protected with password (I know it)
Link | by Sheep on 2006-01-11 15:17:04 (edited 2006-01-11 15:20:15)
If you are programming an application using Java that would have to be able to input/output password protected ZIP files you are out of luck.
The java.util.zip package doesn't support passwords.
Although there seems to be a workaround.
Look around on Google, maybe there is some other non sun package that has a password feature.
As for java.util.KeyStore I dunno...
Maybe if you use a combination of the two packages you could make a zip file password protected but it will probably not be compliant with other unzip software.

Or indeed just make unix command calls from your Java code using java.lang.Runtime, this is only if you run some kind of UNIX flavored OS though.

[Quiet dogs know when to be silent]
Sheep & Tiojar's Anime Episodes

Re: JAVA: ZIP file protected with password (I know it)
Link | by psoplayer on 2006-01-11 21:53:22
*Smacks self for being stupid*
Ah, or perhaps there is another language that does support encryped compression that you could use to make a helper exe for your program. (Surely there's a name for that, I'm just not familiar with the real programming community)


Back | Reverse | Quick Reply | Post Reply |

Copyright 2000-2024 Gendou | Terms of Use | Page loaded in 0.0024 seconds at 2024-04-25 01:12:22