Main menu

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
This is going to be 2 things:

1. A note pad for my notes on implementing PKWARE Zip Encryption in PHP
2. Once I get it working - a note and link to my project page for the work.

So begins the notes:

1. A few twitter responses suggested Chilkat (Thx @hrbrmstr and @jwgoerlich)
2. Base ZIPing of a file can be found here:
3. ZIP format details can be found here:

The following data:

In the file header section there is a "general purpose bit flag: (2 bytes)" - Bit 0 set will be encryption

Encryption details are in the same file as note 3 above - Heading: "VII. Traditional PKWARE Encryption"

Looks like the hardest part to implement will be:
Where crc32(old_crc,char) is a routine that given a CRC value and a
character, returns an updated CRC value after applying the CRC-32
algorithm described elsewhere in this document.


Update (July 15):

Realized that 7-Zip is open source ;) Found the code here: Files: CPP/7Zip/Crypto/ZipCrypto.cpp/.h

One of the hurdles above was the CRC32 stream update used in the PKWARE Crypto algo - A good friend of mine (@ircmaxell) took the code from 7-Zip and made the following:

Next stop - Crypto ;)