|
Post by Marco Cot on Dec 22, 2005 6:15:06 GMT -5
Hello, I am wondering if there's a way to know if the zip got a password before extracting it. I want to ask to enter the password and checking it before I extract it.
Thanks Marco
|
|
|
Post by Kevin on Dec 23, 2005 11:42:10 GMT -5
No there is no way to do that. That is part of the security is that is not is possible. There is a key stored but many passwords will actually match the key but only one password will unzip the file... you don't know whether a password works until AFTER the unzipping process. If the CRC is bad after unzipping then the password is incorrect.
Kevin
|
|
|
Post by pankov on Jan 10, 2006 7:36:56 GMT -5
... reading this I'm still not sure if it's possible to find a solution for the following problem: My application relies on password protected .zip files for transfering data. To be certain that noone can see the data. And this works OK. The problem is that there is no way to my knowlage to prevent someone from making an archive WITHOUT password and the correct data structure and importing it into the application. I thought that I'll get a "OnBadPassword" event fired when I'm expecting the arhive to have a password and it doesn't but I was wrong is there a solution at all for this situation?
|
|
|
Post by Kevin on Jan 11, 2006 19:23:26 GMT -5
I want to be sure I understand. Are you asking if there is a way to make VCLZip throw an OnBadPassword event if a password is entered but there is no password?
Kevin
|
|
|
Post by pankov on Jan 30, 2006 5:03:17 GMT -5
Yes, that's exactly what I want. This way I'll be certain that noone can make false files as long as the password secured
|
|
|
Post by Kevin on Jan 31, 2006 22:07:47 GMT -5
Normally, if the compressed file is not marked as encrypted, then there is no attempt to decrypt the file. However, you can get the behavior you want (if you have the registered version) by opening up KPUNZIPP.PAS and going to about line 600 and find these lines: If (file_info.Encrypted) then begin NewPassword := Password;
and change that first line to: If (file_info.Encrypted) or (Length(Password) > 0) then
I have not tested this, but I believe this should work. Kevin
|
|
|
Post by pankov on Feb 2, 2006 11:40:14 GMT -5
Great! That worked perfectly Thanks a lot
|
|
|
Post by Kevin on Feb 3, 2006 7:39:27 GMT -5
Great! That is good to hear!
|
|