Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file is not open..password is wrong..please help #1

Open
vaibhavsnap opened this issue May 4, 2019 · 16 comments
Open

file is not open..password is wrong..please help #1

vaibhavsnap opened this issue May 4, 2019 · 16 comments

Comments

@vaibhavsnap
Copy link

No description provided.

@MartinChan3
Copy link
Owner

Can u provide more details ? I had used this code in my project already. So if u can provide more details maybe i can help u.

@vaibhavsnap
Copy link
Author

@MartinChan3
I have use this code and [zip](### **url
Screenshot from 2019-05-08 12-29-53
**) folder is created and file also save in this zip file..and password is also created with all file..but after i open this folder in ubuntu then i put password then its show password is wrong.

@MartinChan3
Copy link
Owner

Ok, I write this on Windows and haven't tested it in ubuntu yet, I will do it soon.

@vaibhavsnap
Copy link
Author

Thank you .i am waiting your reply..

@MartinChan3
Copy link
Owner

@vaibhavsnap I have checked the code on Ubuntu and a little mistake should be metioned is Line132 and 133 in qzlib.cpp:

//    file_str.insert(0,'\\');
//    file_str.replace("/","\\");

You can delete that due to Win and Linux uses different file path seperator.
I succeed in generating a test zip and unzip it in system manager with a code.
If u have more problem , tell the details and I will try it.

@vaibhavsnap
Copy link
Author

Thank you for your reply..But i cannot understand how to do this..because in my code
// file_str.insert(0,'\');
// file_str.replace("/","\");
this line not available.
Can you provide code again?
Thanks..

@MartinChan3
Copy link
Owner

I test the example on Ubuntu 16.06(the .so file was compiled by zlib 1.2.8) and it succeed, u can compare what it different from yours.
Hope this could help u.
test.zip

@vaibhavsnap
Copy link
Author

Thank you for your support.
I have use test.zip code..Zip file is created ..but same error is occure ..When i create zip file using terminal then its open or extract using password.but in our case folder or file is not open/extract by using password..
Screenshot from 2019-05-09 18-23-00
Screenshot from 2019-05-09 18-23-11
Screenshot from 2019-05-09 18-23-26

@MartinChan3
Copy link
Owner

Ok, I will show more details next morning...Its wired

@MartinChan3
Copy link
Owner

My package is ok(both in terminal or gui manager)...So I don't know what's wrong on your linux...U could give some code for me to test.
Ubuntu-2019-05-10-10-35-02
Ubuntu-2019-05-10-10-35-27
Ubuntu-2019-05-10-10-35-52
Ubuntu-2019-05-10-10-42-20

@vaibhavsnap
Copy link
Author

I have use same code ..I am not changing anything on test.zip..I think this is unicode issue while extracting file..I can't understand how to solved it.
test.zip

@MartinChan3
Copy link
Owner

What's your ubuntu version and Qt version (Also which compiler u use)? If I have time this weekend , I will install all the environment and test it.

@vaibhavsnap
Copy link
Author

Ubuntu 18.04.2 LTS
Qt version 4.8.7
qmake
Thank you for your efforts and support.I will try if solution find i will revert you..

@vaibhavsnap
Copy link
Author

I am also try this block,but same error occure..
https://stackoverflow.com/questions/30876659/zip-file-encryption-readable-by-some-zip-clients-not-others

" I'm guessing that the last parameter in your zipOpenNewFileInZip3() call is zero. It is supposed to be the CRC of the file.

When a compressed entry is encrypted it is preceded by a 12-byte encryption header. That header is composed of 10 or 11 random bytes followed by 2 or 1 bytes of the high end of that file's CRC. The header is then encrypted using the password, and encryption continues from there on the compressed data. (1 vs. 2 bytes is determined by the version of the zip format.) This allows the unzipper to check the password by comparing the end of the decrypted encryption header with the CRC stored in the local header that precedes it.

What is happening with BetterZip and 7Zip is that they are simply not checking the end of the encryption header. They then do not notice that the encryption header does not comply with the specification, and continue to correctly decrypt the compressed data. UnZip and WinZip on the other hand detect the bug."

@MartinChan3
Copy link
Owner

Got it, last day I try to complier Qt4.8.7 on Ubuntu 18.04.2 LTS but i can't access to get some essential package due to Internet instability. I will tell u if i find something.

@vaibhavsnap
Copy link
Author

yes thank you..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants