title: Password protect .gz folder sent from iPhone
body: <p>I need to protect a file with password when I send it as email attachment from iPhone. I have zipped the file using libz.dylib zlib.h class. Basically I followed the approach discussed in <a href="http://www.cocoadev.com/index.pl?NSDataCategory" rel="nofollow">http://www.cocoadev.com/index.pl?NSDataCategory</a> ie., to create NSDataCategory and calling zlib methods to compress the file. So I have the .gz format file as NSData and I want to protect it with a password. My question is how to protect a .gz file with a password. And I have also a basic question of how the password protection on a file work? Will it encrypt the total file with the given password or will it just act as a gate keeper to open the file? </p>