piping data stream through GPG

robert no-spam at no-spam-no-spam.invalid
Sat Jun 9 10:18:08 EDT 2007


robert wrote:
> I played around trying to encrypt/decrypt data through GPG on the fly 
> (or worse - by using a file) (on Windows first - later to try on Linux too)
> 
> Using os.popen3 like
> 
>  >>> i,o,e=os.popen3('gpg -e -r Robert')
>  >>> # i.write('y\n')
>  >>> i.write('wefwef')
>  >>> i.close()
>  >>> # e.read(1)
>  >>> o.read(1)
> 
> hangs on o.read or e.read.
> 
> So its quite dark. Just a totally non-existing userid (-r) will result 
> significantly different like
> 
>  >>> i.write('wefwef')
> Traceback (most recent call last):
>   File "<interactive input>", line 1, in ?
> IOError: [Errno 22] Invalid argument
> 
> 
> GPG asks confirmation stuff (and pwd upon -d or -c) on the command line.
> How to get all this the right way?
> 
> 

now tryed around like

 >>> i,o,e=os.popen3('gpg  --status-fd 2 --passphrase-fd 0 -e -r 
Robert','b')
 >>> i.write('y\r')
 >>> i.write('wefwef')
 >>> i.close()
 >>> # e.read(1)
 >>> o.read(1)


still just hanging... never any output (status or honey)

Robert



More information about the Python-list mailing list