Cannot encrypt/decrypt zip-Files correctly (Andreas)

David T-G davidtg-gnupg@justpickone.org
Tue Jun 4 23:26:01 2002


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

Andreas --

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

Hello, and welcome back!


%=20
% 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=
o.=20

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 :-)


%=20
% 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.


=2E..
% 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.


%=20
% 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 ...


%=20
% 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.


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

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).


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

HTH & HAND


%=20
% Andreas


:-D
--=20
David T-G                      * It's easier to fight for one's principles
(play) davidtg@justpickone.org * than to live up to them. -- fortune cookie
(work) davidtgwork@justpickone.org
http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE8/TCcGb7uCXufRwARAgCrAJ4oexFQyuTfy+es107kdLzTkOYNTQCgzU0G
Mx47a1+AlIt4U8ZQ30EAG5s=
=Le51
-----END PGP SIGNATURE-----

--oYAXToTM8kn9Ra/9--