473,226 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

piping data stream through GPG

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?
Robert

Jun 9 '07 #1
2 3324
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
Jun 9 '07 #2
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?

I basically can handle it now by a os.popen3 cmd like
'gpg -e -r Robert --batch --always-trust',
'gpg -d -r Robert --batch --always-trust --passphrase-fd 0'

and by using a thread for feeding the child_stdin stream
(necessary for files of significant length / more than buffers)
Robert
Jun 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Csaba Henk | last post by:
For me, one reason for using Python is that with the help of it I can rid of several problems that I faced with during writing scripts in Bourneish shells. Biggest of these problem was the...
0
by: Matt Price | last post by:
Hi folks, I'm writing a python script which I plan to use in a macro for mutt, the mailer. The script is supposed to generate and send an email based on a mailto: url pulled out of an email...
2
by: Apple Grew | last post by:
I want to develope a Winboard like application which will support Winboard protocol. For that I require to know how to handle piping in Python. I seperated out module popen2, but when I use...
1
by: Jason Heyes | last post by:
I would like to have std::cout redirect its output to a std::ostringstream. Can this be done? Help is appreciated.
2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
2
by: moti | last post by:
I am a newbie to MySQL. I'm confused as to the piping syntax of SERVER in the User DSN in ODBC for a client PC. If I use an ip it does not work, probably because of a firewall. So I tried using...
3
by: noob2008 | last post by:
can anyone explain me what is piping in C++ programming? for example invoice.exe < purchase.dat > statement.txt do i replace that where all the cin statements? i created a text file called...
4
by: samit | last post by:
I keen to persue coding like yahoo piping system which will include drag and drop and piping features
0
by: jsimps44 | last post by:
Hi, I'm fairly new to c, and very new to piping and file descriptors and can't seem to get past this problem. The piping is very much not working, and I can't figure out for the life of me why. Any...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.