Is it possible to cross check password of zip file without opening it. Actually i am working on a project where a password protected zip file will be uploaded with a separate field where password will be given. after uploading of that file the password given in the form field will be cross checked with the password of the zip file.
So if there is any help it will be highly appreciated.
Cross checking password of zip file
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
it should be possible.. how to do it, I have no idea. The Zip classes (2 links) posted in the Code Snippets forum may give some leads.. You may want to chat a bit with the author: redmonkey
You need to open the zip file in order to check the password is correct.
You need to get some info from within the file in order to check the password is correct.
Standard PKware encryption stores a 12byte encryption header with each file within the archive so you need to extract that. Once you have the header decrypted the last 1 (or 2) byte(s) is the high-order byte of the CRC checksum for the file (which you also need to extract) and you can use that to confirm the password is correct.
You need to get some info from within the file in order to check the password is correct.
Standard PKware encryption stores a 12byte encryption header with each file within the archive so you need to extract that. Once you have the header decrypted the last 1 (or 2) byte(s) is the high-order byte of the CRC checksum for the file (which you also need to extract) and you can use that to confirm the password is correct.