Hi Przemek,
1) I did a quick test, but unzip doesn't seem to accept
any passwords for something zipped with myzip.
Please be sure that you are using current SVN code.
I made test with UNZIP in my linux box and PKUNZIP
in DOS emulator and both nicely decompress password
encrypted archives created by myzip.prg
I was using:
UnZip 5.51 of 22 May 2004, by Info-ZIP
UnZip 5.52 of 28 February 2005, by Info-ZIP
PKUNZIP 2.04g
I did these, after doing a complete checkout to an empty dir
and a full rebuild:
del hello.zip
myzip hello.zip myzip.tds --pass abc
unzip hello.zip
pkunzip -sabc hello.zip
It then asks me for the password, I type it it, it says it's invalid,
and asks again. unzip is 5.52, same as yours, but Win32 version,
pkunzip 2.04g DOS version.
What am I doing wrong?
2) I'm not sure I understand hb_zipfilecreate()'s new
parameter. What file's CRC32 should be passed there?
hb_zipfilecreate() is used when you want to store file in
ZIP archive yourself passing the data to this file directly
with all other information like file data and attribute.
In such case if you want to encrypt file using password and
you want that other tools will be able to extract it then
you have to also pass CRC32 calculated for data you will
later write to ZIP file using HB_ZipFileWrite().
If this data is in constant value then use HB_CRC32() function
to calculate it otherwise if it is in file then you can use
HB_zipFileCRC32(). HB_ZipFileCreate() does not know data
you will write so it cannot calculate it itself and because
this CRC32 value is part of encryption key then it's necessary
to know it at the beginning and it cannot be updated later
(at least without yet another pass which will decode and encode
again with new key having valid CRC32).
HB_ZipStoreFile() does not need CRC32 passed by user because
it calculates it from given source file.
Okay, I see now, many thanks.
Brgds,
Viktor
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour