I'm find a way of compressing and encrypted large files without using too much memory.

To do this I'm planning on reading in the file data 4MB at a time, compressing it, and encrypting it before writing to another file.

The problem is the lack of a suitable compression algorithm. Is there one that will compress these 4MB chunks, but still consider them to be sections of a larger file?

Hmmmm... Hope you know what I mean.