[Python-Dev] Fast Implementation for ZIP decryption (original) (raw)

CJ Kucera pez at apocalyptech.com
Sun Jul 18 23:28:18 CEST 2010


Hello list, resurrecting a rather old thread from here:

http://mail.python.org/pipermail/python-dev/2009-August/091450.html

I've actually come across a use case where faster zipfile decryption would be very helpful to me (though one could certainly argue that it's a frivolous case). I'm writing a map editor for a game whose graphics datafiles are stored inside an encrypted zipfile. I've received the game developer's blessing for my editor to be able to read inside the zipfile, so legality isn't an issue here, but the pure-Python decryption currently available in the 'zipfile' module really is dog-slow.

When I have my app load directly from already-uncompressed files on the HD, it's rare for a map to take more than 1 second to load; when the app has to use the pure-Python decryption routines to load all the graphics images, it can take over a minute (and this is on a 3GHz Core 2 Duo).

Bundling the necessary graphics with my app isn't an option, nor is asking users to crack the zipfile encryption themselves to provide an uncompressed directory to read from.

So anyway, I'd at least love to have a peek at the C code mentioned in the thread; if nothing more, perhaps I could bundle it into something that could be installed optionally by someone who wants it. Does anyone still have this code available somewhere?

Thanks a bunch, CJ

-- WOW: Flemmy | "Happiness isn't good enough for me! I pez at apocalyptech.com | demand euphoria!" 24.24.2.3171 | - Calvin



More information about the Python-Dev mailing list