<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>things &#38; stuff &#187; Cryptography</title>
	<atom:link href="http://www.curlybrace.com/words/category/technology/cryptography/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.curlybrace.com/words</link>
	<description>Pictures.  Now with more words!</description>
	<lastBuildDate>Mon, 05 Jul 2010 21:47:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>The Demise of CAPICOM</title>
		<link>http://www.curlybrace.com/words/2008/10/15/the-demise-of-capicom/</link>
		<comments>http://www.curlybrace.com/words/2008/10/15/the-demise-of-capicom/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 06:43:01 +0000</pubDate>
		<dc:creator>Jeff Fitzsimons</dc:creator>
				<category><![CDATA[Authenticode]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[CAPICOM]]></category>
		<category><![CDATA[code signing]]></category>

		<guid isPermaLink="false">http://www.curlybrace.com/words/?p=266</guid>
		<description><![CDATA[CAPICOM, a COM-based wrapper for the CryptoAPI library, is deprecated and on its way out. However, Microsoft has no time line for phasing it out, nor have they provided sufficient documentation of alternatives. Many CAPICOM pages contain a confusing, bright-red header along the lines of: [The SignedCode object is available for use in the operating [...]]]></description>
			<content:encoded><![CDATA[<p>CAPICOM, a COM-based wrapper for the CryptoAPI library, is deprecated and on its way out.  However, Microsoft has no time line for phasing it out, nor have they provided sufficient documentation of alternatives.</p>
<p>Many CAPICOM pages contain a confusing, bright-red header along the lines of:</p>
<blockquote><p><span style="color:#FF0000">[The SignedCode object is available for use in the operating systems listed in the Requirements section. Instead, use Platform Invocation Services (PInvoke) to call the Win32 API SignerSignEx, SignerTimeStampEx, and WinVerifyTrust functions to sign content with an Authenticode digital signature. For information about PInvoke, see Platform Invoke Tutorial. The .NET and CryptoAPI via P/Invoke: Part 1 and .NET and CryptoAPI via P/Invoke: Part 2 subsections of Extending .NET Cryptography with CAPICOM and P/Invoke may also be helpful.]</span></p></blockquote>
<p>Note that this alarming paragraph seems to begin by simply telling you that this API is supported on the operating systems listed later.  It does <b>not</b> state that the API will not be available on later OSes, but <i>why</i> place this here otherwise?  The next sentence, beginning with, &#8220;Instead, &#8230;&#8221; seems to be contrasting with something, yet makes absolutely no sense in this context.</p>
<p>Finally, this paragraph instructs us to investigate <a href="http://msdn.microsoft.com/en-us/library/aa387734(VS.85).aspx">SignerSignEx</a>, and <a href="http://msdn.microsoft.com/en-us/library/cc300159(VS.85).aspx">SignerTimeStampEx</a>, which are supplied by the mssign32.dll, have no header file, and absolutely no example code.  This is what I find most irksome, they document each and every function and structure, yet each page says, &#8220;there is no header file, so copy and paste the declaration given here.&#8221;  Well, why not simply provide an mssign.h file on blogs.msdn, or similar?  And why, oh why, is there not a single line of sample code?</p>
<h3>Follow-up</h3>
<p>I have provided a basic header file for mssign32.dll, <a href="http://www.curlybrace.com/words/?p=271">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.curlybrace.com/words/2008/10/15/the-demise-of-capicom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GnuPG Plugin for vim Under Cygwin</title>
		<link>http://www.curlybrace.com/words/2008/10/04/gnupg-plugin-for-vim-under-cygwin/</link>
		<comments>http://www.curlybrace.com/words/2008/10/04/gnupg-plugin-for-vim-under-cygwin/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 18:50:57 +0000</pubDate>
		<dc:creator>Jeff Fitzsimons</dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Win32]]></category>

		<guid isPermaLink="false">http://www.curlybrace.com/words/?p=137</guid>
		<description><![CDATA[GnuPG, GNU Privacy Guard, is a free system for encrypting files, emails, etc. The GnuPG plugin for vim provides automatic encryption and decryption of files within vim. If you attempt to edit a GnuPG-encrypted file with vim, it will prompt you for the password, and re-encrypt the file when you&#8217;re done editing. Download the gnupg [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gnupg.org/">GnuPG, GNU Privacy Guard</a>, is a free system for encrypting files, emails, etc.  The <a href="http://vim.sourceforge.net/scripts/script.php?script_id=661">GnuPG plugin for vim</a> provides automatic encryption and decryption of files within vim.  If you attempt to edit a GnuPG-encrypted file with vim, it will prompt you for the password, and re-encrypt the file when you&#8217;re done editing.</p>
<p>Download the gnupg plugin for vim from <a href="http://vim.sourceforge.net/scripts/script.php?script_id=661">here</a> and copy it into your user directory directory under <tt>.vim/plugin</tt>.  From the Cygwin bash prompt:</p>
<blockquote><pre>mkdir ~/.vim/plugin
copy gnupg.vim ~/.vim/plugin</pre>
</blockquote>
<p>Run <tt>vim</tt>, then use the <tt>:scriptnames</tt> command and verify that <tt>gnupg.vim</tt> appears in the list of sourced scripts:</p>
<blockquote><pre>  1: /cygdrive/c/Users/<i>username</i>/.vim/plugin/gnupg.vim</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.curlybrace.com/words/2008/10/04/gnupg-plugin-for-vim-under-cygwin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Certificates and Signtool</title>
		<link>http://www.curlybrace.com/words/2008/09/12/using-certificates-and-signtool/</link>
		<comments>http://www.curlybrace.com/words/2008/09/12/using-certificates-and-signtool/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 21:24:12 +0000</pubDate>
		<dc:creator>Jeff Fitzsimons</dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.curlybrace.com/words/?p=287</guid>
		<description><![CDATA[Obtain a Software Publisher Certificate Your Certificate Authority will supply one of the following: a Personal Information Exchange (.pfx) file a Software Publisher Certificate (.spc), and a Private Key (.pvk) file a CER-encoded X.509 Certificate (.cer), and a Private Key (.pvk) file For the second and third case, these file must be converted to a [...]]]></description>
			<content:encoded><![CDATA[<h3>Obtain a Software Publisher Certificate</h3>
<p>Your Certificate Authority will supply one of the following:</p>
<ol>
<li />a <a href="http://en.wikipedia.org/wiki/PFX">Personal Information Exchange</a> (.pfx) file
<li />a <a href="http://msdn.microsoft.com/en-us/library/aa906334.aspx">Software Publisher Certificate</a> (.spc), and a <a href="http://www.drh-consultancy.demon.co.uk/pvk.html">Private Key</a> (.pvk) file
<li />a <a href="http://en.wikipedia.org/wiki/Canonical_Encoding_Rules">CER-encoded</a> <a href="http://msdn.microsoft.com/en-us/library/aa906334.aspx">X.509 Certificate</a> (.cer), and a Private Key (.pvk) file
</ol>
<p>For the second and third case, these file must be converted to a <a href="http://www.wireshark.org/docs/dfref/p/pkcs12.html">Personal Information Exchange</a> (.pfx) file.</p>
<h4>Convert SPC or CER to Personal Information Exchange (.pfx)</h4>
<p>Syntax for .spc conversion:</p>
<blockquote><pre>pvk2pfx -pvk filename.pvk -pi password -spc filename.spc -pfx output.pfx</pre>
</blockquote>
<p>The syntax is identical for .cer conversion:</p>
<blockquote><pre>pvk2pfx -pvk filename.pvk -pi password -spc filename.cer -pfx
output.pfx</pre>
</blockquote>
<h3>Sign the Executable</h3>
<p><tt>Signtool.exe</tt> can be used to sign executables (.exe) and Dynamic Link Libraries (.DLL).</p>
<h4>Basic Signature</h4>
<blockquote><p><tt>signtool.exe sign /v /f filename.pvk /p password executable</tt></p></blockquote>
<h4>Signature With Timestamp</h4>
<blockquote><p><tt>signtool.exe sign /v /f filename.pvk /p password /t url executable</tt></p></blockquote>
<p>Where <tt>url</tt> is the URL of your Certificate Authorities timestamp server (e.g. http://timestamp.verisign.com/scripts/timestamp.dll for VeriSign)</p>
<h4>Signature Verification</h4>
<blockquote><p><tt>signtool verify /pa executable</tt></p></blockquote>
<p><tt>/pa</tt> indicates that the &#8220;Default Authenticode&#8221; verification policy is used.  Omitting the switch will cause the verification to fail, which does not necessarily mean that a given file isn&#8217;t Authenticode signed.</p>
<h3>Resources</h3>
<ul>
<li /><a href="http://msdn.microsoft.com/en-us/library/aa906334.aspx">Windows Driver Kit: Device Installation, Software Publisher Certificate</a> (MSDN)
<li /><a href="http://en.wikipedia.org/wiki/PKCS12">PKCS12</a> is the successor to PFX.
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.curlybrace.com/words/2008/09/12/using-certificates-and-signtool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mssign32.dll</title>
		<link>http://www.curlybrace.com/words/2008/09/11/mssign32dll/</link>
		<comments>http://www.curlybrace.com/words/2008/09/11/mssign32dll/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 02:48:19 +0000</pubDate>
		<dc:creator>Jeff Fitzsimons</dc:creator>
				<category><![CDATA[Authenticode]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.curlybrace.com/words/?p=271</guid>
		<description><![CDATA[With CAPICOM deprecated, MSDN suggests using the mssign32.dll functions. There are two fundamental problems with this: No example code whatsoever is provided. No header file is provided. Well, at least I can do something about #2. Here is a minimal version of a header file for mssign32.dll. It includes direct function declarations, as well as [...]]]></description>
			<content:encoded><![CDATA[<p>With CAPICOM deprecated, MSDN suggests using the mssign32.dll functions.  There are two fundamental problems with this:</p>
<ol>
<li />No example code whatsoever is provided.
<li />No header file is provided.
</ol>
<p>Well, at least I can do <b>something</b> about #2.  <a href="http://www.curlybrace.com/projects/Authenticode/mssign32.h">Here is a minimal version of a header file for mssign32.dll</a>.  It includes direct function declarations, as well as function pointer typedefs.</p>
<p>The function pointers can be used with <tt>LoadLibrary</tt>/<tt>GetProcAddress</tt> to dynamically call the functions, as in:</p>
<blockquote><pre>SignerSignPtr pSignerSign =
    (SignerSignPtr)GetProcAddress(hModule, "SignerSign");</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.curlybrace.com/words/2008/09/11/mssign32dll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Key Generation and Conversion With OpenSSH</title>
		<link>http://www.curlybrace.com/words/2008/05/21/ssh-key-manipulation/</link>
		<comments>http://www.curlybrace.com/words/2008/05/21/ssh-key-manipulation/#comments</comments>
		<pubDate>Wed, 21 May 2008 23:40:13 +0000</pubDate>
		<dc:creator>Jeff Fitzsimons</dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.curlybrace.com/words/?p=117</guid>
		<description><![CDATA[Key Generation Generate a DSA key: ssh-keygen -t dsa This will generate an RFC 4716-formatted key file similar to the following: -----BEGIN DSA PRIVATE KEY----- MIIBuwIBAAKBgQDijfpmyXBZpnq8EhEhSxeJz7fNxIlWYD6t7bviDZMARh8mLCr2 bug2J1K+Rl4qoLQJ7zRGlytwQ2krTCmvVahOjy9m/QW5936rCyVS19PRdJMEEMSN vLQaMtpKbnHp0z8Xs/X1CkDmxThOlvRVjiObdd0U9eELLoo5VHauVHmufwIVAO7j l4bxgVXeX09WJcyOXAUauNXHAoGAF20ESXgTvbbdxDECa2tfTi/j1/+emNV/+zuR aq6xms/K0piZhMlkK3BD9PgHhXfqZuRT/Z9b8ja3nR34H2KL3UInCNV6kSq6h+MD MLJnNQG4wADLYw3p5Tzz/hUwtfqpZ/9e7FpBdgfooS274GgPKTG8BFRiudIztPpK 4GueicoCgYEAy8hllDrFzQUqFG0kMe8r3dOFDjMQHf6ITttmAiScwEPg+a5D++Sq bj42vkKSNgaYHc+Z8QPgerPehIkBde6wx0ukq0a8IXy8F86IasXz3wzotPeJsdKi mynQKzhSm9Jzbk/SK/yh5NGhJzz1VmHsg+ir/qReguMHfqDGCI4kSFYCFDJKXQ4h MteJHSlu62RrGwInRBOh -----END DSA PRIVATE KEY----- An accompanying, OpenSSH-formatted public key file should also be generated under the same file name with [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<h3>Key Generation</h3>
<p>Generate a DSA key:</p>
<blockquote><p><tt>ssh-keygen -t dsa</tt></p></blockquote>
<p>This will generate an <a href="http://tools.ietf.org/html/rfc4716">RFC 4716-formatted</a> key file similar to the following:</p>
<blockquote><pre>-----BEGIN DSA PRIVATE KEY-----
MIIBuwIBAAKBgQDijfpmyXBZpnq8EhEhSxeJz7fNxIlWYD6t7bviDZMARh8mLCr2
bug2J1K+Rl4qoLQJ7zRGlytwQ2krTCmvVahOjy9m/QW5936rCyVS19PRdJMEEMSN
vLQaMtpKbnHp0z8Xs/X1CkDmxThOlvRVjiObdd0U9eELLoo5VHauVHmufwIVAO7j
l4bxgVXeX09WJcyOXAUauNXHAoGAF20ESXgTvbbdxDECa2tfTi/j1/+emNV/+zuR
aq6xms/K0piZhMlkK3BD9PgHhXfqZuRT/Z9b8ja3nR34H2KL3UInCNV6kSq6h+MD
MLJnNQG4wADLYw3p5Tzz/hUwtfqpZ/9e7FpBdgfooS274GgPKTG8BFRiudIztPpK
4GueicoCgYEAy8hllDrFzQUqFG0kMe8r3dOFDjMQHf6ITttmAiScwEPg+a5D++Sq
bj42vkKSNgaYHc+Z8QPgerPehIkBde6wx0ukq0a8IXy8F86IasXz3wzotPeJsdKi
mynQKzhSm9Jzbk/SK/yh5NGhJzz1VmHsg+ir/qReguMHfqDGCI4kSFYCFDJKXQ4h
MteJHSlu62RrGwInRBOh
-----END DSA PRIVATE KEY-----</pre>
</blockquote>
<p>An accompanying, OpenSSH-formatted public key file should also be generated under the same file name with a <tt>.pub</tt> suffix.  It should appear similar to the following:</p>
<blockquote><pre>ssh-dss AAAAB3NzaC1kc3MAAACBAOKN+mbJcFmmerwSESFLF4nPt83EiVZgPq3t
u+INkwBGHyYsKvZu6DYnUr5GXiqgtAnvNEaXK3BDaStMKa9VqE6PL2b9Bbn3fqsL
JVLX09F0kwQQxI28tBoy2kpucenTPxez9fUKQObFOE6W9FWOI5t13RT14QsuijlU
dq5Uea5/AAAAFQDu45eG8YFV3l9PViXMjlwFGrjVxwAAAIAXbQRJeBO9tt3EMQJr
a19OL+PX/56Y1X/7O5FqrrGaz8rSmJmEyWQrcEP0+AeFd+pm5FP9n1vyNredHfgf
YovdQicI1XqRKrqH4wMwsmc1AbjAAMtjDenlPPP+FTC1+qln/17sWkF2B+ihLbvg
aA8pMbwEVGK50jO0+krga56JygAAAIEAy8hllDrFzQUqFG0kMe8r3dOFDjMQHf6I
TttmAiScwEPg+a5D++Sqbj42vkKSNgaYHc+Z8QPgerPehIkBde6wx0ukq0a8IXy8
F86IasXz3wzotPeJsdKimynQKzhSm9Jzbk/SK/yh5NGhJzz1VmHsg+ir/qReguMH
fqDGCI4kSFY= user@hostname</pre>
</blockquote>
<h3>Export Public Key in RFC 4716 Format</h3>
<p>Given a private key, export its public key:</p>
<blockquote><p><tt>ssh-keygen -e -f <b><i>private_key</i></b></tt></p></blockquote>
<p>This will generate a RFC 4716 output similar to the following:</p>
<blockquote><pre>---- BEGIN SSH2 PUBLIC KEY ----
Comment: "1024-bit DSA, converted from OpenSSH by user@hostname"
AAAAB3NzaC1kc3MAAACBAOKN+mbJcFmmerwSESFLF4nPt83EiVZgPq3tu+INkwBGHyYsKv
Zu6DYnUr5GXiqgtAnvNEaXK3BDaStMKa9VqE6PL2b9Bbn3fqsLJVLX09F0kwQQxI28tBoy
2kpucenTPxez9fUKQObFOE6W9FWOI5t13RT14QsuijlUdq5Uea5/AAAAFQDu45eG8YFV3l
9PViXMjlwFGrjVxwAAAIAXbQRJeBO9tt3EMQJra19OL+PX/56Y1X/7O5FqrrGaz8rSmJmE
yWQrcEP0+AeFd+pm5FP9n1vyNredHfgfYovdQicI1XqRKrqH4wMwsmc1AbjAAMtjDenlPP
P+FTC1+qln/17sWkF2B+ihLbvgaA8pMbwEVGK50jO0+krga56JygAAAIEAy8hllDrFzQUq
FG0kMe8r3dOFDjMQHf6ITttmAiScwEPg+a5D++Sqbj42vkKSNgaYHc+Z8QPgerPehIkBde
6wx0ukq0a8IXy8F86IasXz3wzotPeJsdKimynQKzhSm9Jzbk/SK/yh5NGhJzz1VmHsg+ir
/qReguMHfqDGCI4kSFY=
---- END SSH2 PUBLIC KEY ----</pre>
</blockquote>
<h3>Convert Public RFC 4716 to Public OpenSSH Format</h3>
<p>Convert the exported public key from RFC 4716 format to OpenSSH format (for use in an <tt>authorized_keys</tt> file, for example):</p>
<blockquote><p><tt>ssh-keygen -i -f <b><i>public_key</i></b></tt></p></blockquote>
<p>This will generate OpenSSH-formatted output similar to the following:</p>
<blockquote><pre>ssh-dss AAAAB3NzaC1kc3MAAACBAOKN+mbJcFmmerwSESFLF4nPt83EiVZgPq3t
u+INkwBGHyYsKvZu6DYnUr5GXiqgtAnvNEaXK3BDaStMKa9VqE6PL2b9Bbn3fqsL
JVLX09F0kwQQxI28tBoy2kpucenTPxez9fUKQObFOE6W9FWOI5t13RT14QsuijlU
dq5Uea5/AAAAFQDu45eG8YFV3l9PViXMjlwFGrjVxwAAAIAXbQRJeBO9tt3EMQJr
a19OL+PX/56Y1X/7O5FqrrGaz8rSmJmEyWQrcEP0+AeFd+pm5FP9n1vyNredHfgf
YovdQicI1XqRKrqH4wMwsmc1AbjAAMtjDenlPPP+FTC1+qln/17sWkF2B+ihLbvg
aA8pMbwEVGK50jO0+krga56JygAAAIEAy8hllDrFzQUqFG0kMe8r3dOFDjMQHf6I
TttmAiScwEPg+a5D++Sqbj42vkKSNgaYHc+Z8QPgerPehIkBde6wx0ukq0a8IXy8
F86IasXz3wzotPeJsdKimynQKzhSm9Jzbk/SK/yh5NGhJzz1VmHsg+ir/qReguMH
fqDGCI4kSFY=</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.curlybrace.com/words/2008/05/21/ssh-key-manipulation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
