using --passphrase-fd 0 option with passphrase containing <>
Steve Butler
sbutler@1stchoiceofwa.com
Fri Jul 11 13:49:07 2003
This is a multi-part message in MIME format.
------=_NextPart_000_1812B_01C346F4.230C9EA0
x-gfisavedcharset: iso-8859-1
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
The I/O redirection symbols have to be hidden from Unix/Linux. As an
example:
echo abcd<1> | cat
ksh: syntax error: `> ' unexpected
There are several ways to hide the I/O redirection:
1. embed it in single quotes:
echo 'abcd<1>' | cat
abcd<1>
2. embed it in double quotes:
echo "abcd<1>" | cat
abcd<1>
3. Use the '\' character to hide the "following character" from the shell
process:
echo abcd\<1\> | cat
abcd<1>
Use gpg in place where cat is shown in these examples.
-----Original Message-----
From: Thomas Hoffman [mailto:THoffman@verticalscreen.com]
Sent: Thursday, July 10, 2003 2:06 PM
To: 'gnupg-users@gnupg.org'
Subject: using --passphrase-fd 0 option with passphrase containing <>
Has anyone come across a situation where in a command such as:
prompt> echo 123abc<1>|gpg.exe --passphrase-fd 0 --decrypt file.gpg
Where the < and > in the passphrase cause the command to fail?
<<snip>>
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
------=_NextPart_000_1812B_01C346F4.230C9EA0
x-gfisavedcharset: iso-8859-1
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=979315221-10072003>The
I/O redirection symbols have to be hidden from Unix/Linux. As an
example:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=979315221-10072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=979315221-10072003>echo
abcd<1> | cat<BR>ksh: syntax error: `> ' unexpected</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=979315221-10072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=979315221-10072003>There
are several ways to hide the I/O redirection:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=979315221-10072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=979315221-10072003>1.
embed it in single quotes:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=979315221-10072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=979315221-10072003>echo
'abcd<1>' | cat<BR>abcd<1></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=979315221-10072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=979315221-10072003>2. embed it in double quotes:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=979315221-10072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=979315221-10072003>echo
"abcd<1>" | cat<BR>abcd<1></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=979315221-10072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=979315221-10072003>3. Use the '\' character to hide the "following
character" from the shell process:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=979315221-10072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=979315221-10072003>echo
abcd\<1\> | cat<BR>abcd<1></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=979315221-10072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=979315221-10072003>Use
gpg in place where cat is shown in these examples.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=979315221-10072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=979315221-10072003></SPAN></FONT> </DIV>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Thomas Hoffman
[mailto:THoffman@verticalscreen.com]<BR><B>Sent:</B> Thursday, July 10, 2003
2:06 PM<BR><B>To:</B> 'gnupg-users@gnupg.org'<BR><B>Subject:</B> using
--passphrase-fd 0 option with passphrase containing
<><BR><BR></FONT></DIV>
<DIV><SPAN class=536230021-10072003><FONT face=Arial size=2>Has anyone come
across a situation where in a command such as:</FONT></SPAN></DIV>
<DIV><SPAN class=536230021-10072003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=536230021-10072003><FONT face=Arial size=2>prompt> echo
123abc<1>|gpg.exe --passphrase-fd 0 --decrypt file.gpg</FONT></SPAN></DIV>
<DIV><SPAN class=536230021-10072003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=536230021-10072003><FONT face=Arial size=2>Where the < and
> in the passphrase cause the command to fail?</FONT></SPAN></DIV>
<DIV><SPAN class=536230021-10072003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=536230021-10072003><FONT face=Arial color=#0000ff size=2><SPAN
class=979315221-10072003><<snip>> </SPAN></FONT></SPAN></DIV></BODY></HTML>
<HTML><BODY><P><FONT color=#000000 face="Arial" size=2>CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.<BR></FONT></BODY></HTML>
------=_NextPart_000_1812B_01C346F4.230C9EA0--