Cannot encrypt/decrypt zip-Files correctly (Andreas)

David T-G
Tue Jun 4 23:26:01 2002

Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Andreas --

=2E..and then said...
% [sorry, I used wrong mailadress before - this one is correct]
% Hallo!

Hello, and welcome back!

% First of all sorry, because did not get along with such a mailing-list at=
 once, but with help from David T-G  I think I can manage it now - I hope s=

Happy to be of help :-)

% I=B4ve found the solution to my problem mentioned befor more or less by m=
yself. I tried to decrypt a zip-file with WinPT by clipboard, but I had to =
use the WinPT filemanager. Now it=B4s really easy ;-)

Funny how the proper tool makes things really easy :-)

% But now I=B4ve the next problem, is here someone knowing about a php-func=
tion like system()?=20

While this isn't a php mailing list, you might find some good ideas.  In
particular, I have two.

% For command-line the 2nd part is working correctly in this way:   gzip -c=
 file.htm | gpg -o data.gpg -e --default-recipient andreas

Since you're working with an uncompressed file, skip the gzip step and
let gpg manage the compression for you.  [We've been discussing this a
bit on the list, in fact.]  In fact, I see below that you're spitting out
the mysqldump output, so just hand the stream to gpg for the same reasons.

% That creats the file 'data.gpg', which I can decrypt an my PC. On PHP thi=
s should look something like this:
% <?
% system( "gzip -c file.htm | gpg -o /path/to/file/data.gpg -e --default-re=
cipient andreas");
% ?>

It should, yes, but ...

% But that does nothing. A working example in php would be the 1st part:

=2E.. you've neglected an important part: when the php script is run, it's
run by the web server, and the web server is not you, and so gpg has no
home directory, no keyrings, and no keys.

% <?
% system ("mysqldump -uxxxxx -pxxxxx -hxxxxx database | gzip > /path/to/fil=
% ?>
% That creats a nice dump of the Database, which is compressed with gzip.=

When you try this and then look at the file from the shell, who owns the
file?  I'll bet it's nobody or web or www or anybody except you (well, it
shouldn't be root, either; that would be bad).

% Sorry for my bad english, I hope you undestand what my problem is! Perhap=
s someone can help me!
% Thank you very much!


% Andreas

David T-G                      * It's easier to fight for one's principles
(play) * than to live up to them. -- fortune cookie
(work)    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.0.7 (GNU/Linux)