Encrypting / decrypting without importing keys?

Atom 'Smasher' atom at suspicious.org
Mon Oct 4 22:57:11 CEST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

> I'm new to GnuPG and was wondering if it was possible to encrypt and/or 
> decrypt without needing to first import the keys into gpg.  I'm looking 
> to use gpg to encrypt data from a web page, where the user specifies the 
> public key to encrypt data, and then eventually a private key to decrypt 
> it.
>
> Additionally, is there anyway I can specify the keys to use as coming 
> from standard in or standard out instead of being file based?
====================

you can save a key into a file and use something like:

   gpg --no-default-keyring --keyring key-file --trust-model always -ear user

this hack allows an encryption key to be used without importing it. how to 
convert an ascii key into a binary key is an exercise i leave to the 
reader; it isn't that hard to do but an ascii key won't work.

also, see if <http://business-php.com/opensource/gpg_encrypt/> does most 
of what you need. it sounds like you'd have to tweak this, but the major 
work is done.


         ...atom

  _________________________________________
  PGP key - http://atom.smasher.org/pgp.txt
  762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
  -------------------------------------------------

 	"The sum of intelligence on the planet is a constant.
 	 The population is increasing."
 		-- Cole's Axiom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.3.6 (FreeBSD)
Comment: What is this gibberish?
Comment: http://atom.smasher.org/links/#digital_signatures

iQEcBAEBCAAGBQJBYbktAAoJEAx/d+cTpVciVQgIAIL78J59FUKQMp0TORZ8e3NC
N2GGnZpDCX2l4QM5FxUYB1jbc/QSPRAZUAUwFTEX1ysqHa651GpMJqcEvya02T45
zqRLOBlANfu3vgNU9h/1hJXCB0ynZQkldPcr/2RdBDX9vm5Tik/c9od71nNgJcph
GQU29c5ZTG+jcBM7GPkr/MTnns7b/+ttJjO6yOLD7s5iEqbnEmIfp8cKLMbRMcLD
+i7al0wTtN76aH+4vHkZUUyLv8aksGvfx6LtafelyV2syjPGf/a+7g9r9V0wCes5
gr3VLWq9Wo/P4gKriSS25a6HwCoIfiDjc3/6XKbk/1MJcSuxyLOLgjy8E/1Xqm4=
=Y7x3
-----END PGP SIGNATURE-----



More information about the Gnupg-users mailing list