Hi all,
I need to send a file in "standard 2.0 encryption" (not my words). I have no control over this format as it is going to an external company, and this is the format the file must be sent in. Inside the encrypted zip file will be a csv file, possibly growing to several thousand lines a time. I have seen the excellent zip file classes around the forum (and on other places) but none that I have seen support zip encryption. To tell you the truth I'm not even sure what they been by "standard 2.0 encryption".
Has anybody else faced a similar need to send encrypted zip files, and found a suitable solution.
Thanks for all your help
Zip 2.0 Encryption
Moderator: General Moderators
-
mikesmith76
- Forum Commoner
- Posts: 34
- Joined: Fri Aug 25, 2006 7:10 am
- Location: Manchester, UK
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
You don't mention which system you are working on (Linux/Windows).
I would use exec a system command to zip the file before sending. Just google for "zip standard 2.0 encryption" for applications handling it on your platform. Doing this means if you ever need zip standard 3.0 encryption (doesn't exist yet as far as I know), your system just needs to be updated with the relevant application. If both you and your client use the same application you can guarantee you both can unzip each others zip files.
The alternative is to use the PECL Zip utility but I am not sure which encrytion it uses. I would imagine it would be correct but you may want to send a test file first.
I would use exec a system command to zip the file before sending. Just google for "zip standard 2.0 encryption" for applications handling it on your platform. Doing this means if you ever need zip standard 3.0 encryption (doesn't exist yet as far as I know), your system just needs to be updated with the relevant application. If both you and your client use the same application you can guarantee you both can unzip each others zip files.
The alternative is to use the PECL Zip utility but I am not sure which encrytion it uses. I would imagine it would be correct but you may want to send a test file first.
-
mikesmith76
- Forum Commoner
- Posts: 34
- Joined: Fri Aug 25, 2006 7:10 am
- Location: Manchester, UK
-
mikesmith76
- Forum Commoner
- Posts: 34
- Joined: Fri Aug 25, 2006 7:10 am
- Location: Manchester, UK
Sorry to be a moron but i have a problem with the Linux "zip" command
If i run the following command (both on the command line and in php) all is well
zip /test/test.zip /test/test.csv
However to encrypt the contents i need to use the -e flag as in
zip -e /test/test.zip /test/test.csv
Doing this on the command line results in a prompt for a password. I have tried to replicate this functionality in using both proc_open and popen, no luck with either. With proc_open all i get returned is "Command Returned 16". popen is one way to no feedback there, and no zip file either. The code I used for both of the above commands was taken from the php manual examples (as i have never used either of these commands before).
This is to be hosted on a Linux server, running php 4.2 I think. I don't want to upgrade the version of php as a number of other apps are running on this server, and i don't want to check each and every one for bugs after the upgrade.
I'm probably doing something really stupid, if anyone want's to point me in the right direction I would appreciate it
If i run the following command (both on the command line and in php) all is well
zip /test/test.zip /test/test.csv
However to encrypt the contents i need to use the -e flag as in
zip -e /test/test.zip /test/test.csv
Doing this on the command line results in a prompt for a password. I have tried to replicate this functionality in using both proc_open and popen, no luck with either. With proc_open all i get returned is "Command Returned 16". popen is one way to no feedback there, and no zip file either. The code I used for both of the above commands was taken from the php manual examples (as i have never used either of these commands before).
This is to be hosted on a Linux server, running php 4.2 I think. I don't want to upgrade the version of php as a number of other apps are running on this server, and i don't want to check each and every one for bugs after the upgrade.
I'm probably doing something really stupid, if anyone want's to point me in the right direction I would appreciate it
-
mikesmith76
- Forum Commoner
- Posts: 34
- Joined: Fri Aug 25, 2006 7:10 am
- Location: Manchester, UK
If I was just trying to zip up the file that would be great. Reading through the class you mentionned it doesn't appear to support password protection of any kind, and I'm a bit reluctant to resurrect a 6 month old thread to speak to the class author.
After spending the afternoon playing with popen / proc_open i'm not sure I can do what I want with my current php version. Need more digging I suppose...
After spending the afternoon playing with popen / proc_open i'm not sure I can do what I want with my current php version. Need more digging I suppose...
-
mikesmith76
- Forum Commoner
- Posts: 34
- Joined: Fri Aug 25, 2006 7:10 am
- Location: Manchester, UK