K
Kocica
Trying to use gpg to encrypt text without creating an intermediate file.
Tried using pipes two different ways (see code).
Dim wshell, gnupg
Dim PGPTextBodyNotify1
set wshell = server.createobject("wscript.shell")
'First tried to use command level pipe, but asp ignores everything after the |
'set gnupg = wshell.run("D:\directory\printf test |
D:\directory\gpg.exe --homedir D:\directory -t --
always-trust -a -e -r user")
'since that didn't work, tried to program the pipe......
set gnupg = wshell.exec("D:\directory\gpg.exe --homedir D:\directory -t --
always-trust -a -e -r user")
'so here I input the string I want encrypted....
gnupg.StdIn.Write "test"
gnupg.StdIn.Write VbCrLf
' all of the above works when the following portion is commented out....
' when submitting the web based form, the script just hangs, doesn't do
anything,
' and perpetually waits for a response.
If Not gnupg.StdOut.AtEndOfStream Then
PGPTextBodyNotify1 = PGPTextBodyNotify1 & gnupg.StdOut.Read(1)
End If
' also tried to read this way... no luck
'PGPTextBodyNotify1 = gnupg.StdOut.ReadAll
set wshell = nothing
Tried using pipes two different ways (see code).
Dim wshell, gnupg
Dim PGPTextBodyNotify1
set wshell = server.createobject("wscript.shell")
'First tried to use command level pipe, but asp ignores everything after the |
'set gnupg = wshell.run("D:\directory\printf test |
D:\directory\gpg.exe --homedir D:\directory -t --
always-trust -a -e -r user")
'since that didn't work, tried to program the pipe......
set gnupg = wshell.exec("D:\directory\gpg.exe --homedir D:\directory -t --
always-trust -a -e -r user")
'so here I input the string I want encrypted....
gnupg.StdIn.Write "test"
gnupg.StdIn.Write VbCrLf
' all of the above works when the following portion is commented out....
' when submitting the web based form, the script just hangs, doesn't do
anything,
' and perpetually waits for a response.
If Not gnupg.StdOut.AtEndOfStream Then
PGPTextBodyNotify1 = PGPTextBodyNotify1 & gnupg.StdOut.Read(1)
End If
' also tried to read this way... no luck
'PGPTextBodyNotify1 = gnupg.StdOut.ReadAll
set wshell = nothing