<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Using OpenSSL for license keys</title>
	<atom:link href="http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-keys/feed/" rel="self" type="application/rss+xml" />
	<link>http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-keys/</link>
	<description>Programming and using OS X</description>
	<lastBuildDate>Sun, 24 Jan 2010 01:03:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Allan Odgaard</title>
		<link>http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-keys/#comment-25622</link>
		<dc:creator>Allan Odgaard</dc:creator>
		<pubDate>Wed, 24 Jun 2009 21:29:27 +0000</pubDate>
		<guid isPermaLink="false">http://macromates.com/sigpipe/archives/2004/09/05/using-openssl-for-license-keys/#comment-25622</guid>
		<description>&lt;p&gt;Frederik: Have a look at &lt;a href=&quot;http://github.com/dchest/ellipticlicense/tree/master&quot; rel=&quot;nofollow&quot;&gt;this project&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Alex: The SHA-1 is just an example payload here, not very essential, i.e. I would suggest (also) including a serial number (32 bit integer) to uniquely identify the key rather than rely on the hash to be the only unique identifier (as people/companies/IT departments do request name changes).&lt;/p&gt;

&lt;p&gt;Which is something those of you wanting a short key should consider, simply providing an encrypted hash is not ideal as at least I include the following info in the license key: Serial number, date issued, number of seats (for site licenses), type of license (academic license, evaluation/NFR, gift, etc.), and maybe a few other things.&lt;/p&gt;

&lt;p&gt;But ECDSA can still work for this requirement e.g. by prefixing the signature with this info (compacted into a long integer) but remember to also have the actual signature be on this data, so that altering this prefix invalidates the key.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Frederik: Have a look at <a href="http://github.com/dchest/ellipticlicense/tree/master" rel="nofollow">this project</a>.</p>

<p>Alex: The SHA-1 is just an example payload here, not very essential, i.e. I would suggest (also) including a serial number (32 bit integer) to uniquely identify the key rather than rely on the hash to be the only unique identifier (as people/companies/IT departments do request name changes).</p>

<p>Which is something those of you wanting a short key should consider, simply providing an encrypted hash is not ideal as at least I include the following info in the license key: Serial number, date issued, number of seats (for site licenses), type of license (academic license, evaluation/NFR, gift, etc.), and maybe a few other things.</p>

<p>But ECDSA can still work for this requirement e.g. by prefixing the signature with this info (compacted into a long integer) but remember to also have the actual signature be on this data, so that altering this prefix invalidates the key.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Ross</title>
		<link>http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-keys/#comment-25621</link>
		<dc:creator>Alex Ross</dc:creator>
		<pubDate>Wed, 03 Jun 2009 23:35:58 +0000</pubDate>
		<guid isPermaLink="false">http://macromates.com/sigpipe/archives/2004/09/05/using-openssl-for-license-keys/#comment-25621</guid>
		<description>&lt;p&gt;Researchers have used collision attacks on MD5 to produced forged SSL certificates [1]. 
Research on SHA-1 has advanced to the point where collisions can be found in about 2^52 operations, and it is reasonable to think that this number will continue to drop. Thus, it may soon be possible to forge license-keys generated by the scheme discussed in this article as well.
If you have the option, I would suggest using the “whirlpool” hash function (to be included in openssl 1.0), until the SHA-3 hash function becomes available.&lt;/p&gt;

&lt;p&gt;[1][http://www.schneier.com/crypto-gram-0901.html#3]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Researchers have used collision attacks on MD5 to produced forged SSL certificates [1]. 
Research on SHA-1 has advanced to the point where collisions can be found in about 2^52 operations, and it is reasonable to think that this number will continue to drop. Thus, it may soon be possible to forge license-keys generated by the scheme discussed in this article as well.
If you have the option, I would suggest using the “whirlpool” hash function (to be included in openssl 1.0), until the SHA-3 hash function becomes available.</p>

<p>[1][http://www.schneier.com/crypto-gram-0901.html#3]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Frederik</title>
		<link>http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-keys/#comment-25620</link>
		<dc:creator>Frederik</dc:creator>
		<pubDate>Fri, 29 May 2009 06:54:39 +0000</pubDate>
		<guid isPermaLink="false">http://macromates.com/sigpipe/archives/2004/09/05/using-openssl-for-license-keys/#comment-25620</guid>
		<description>&lt;p&gt;Thank you for the great article.&lt;/p&gt;

&lt;p&gt;Did anyone ever try to use Elliptic Curve Cryptography (http://en.wikipedia.org/wiki/Elliptic_curve_cryptography) instead of RSA for this? Supposedly one can use smaller key lengths with similar security, which could result in shorter license keys. Crypto++ (http://www.cryptopp.com) is a crypto-library supporting ECC.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thank you for the great article.</p>

<p>Did anyone ever try to use Elliptic Curve Cryptography (<a href="http://en.wikipedia.org/wiki/Elliptic_curve_cryptography" rel="nofollow">http://en.wikipedia.org/wiki/Elliptic_curve_cryptography</a>) instead of RSA for this? Supposedly one can use smaller key lengths with similar security, which could result in shorter license keys. Crypto++ (<a href="http://www.cryptopp.com" rel="nofollow">http://www.cryptopp.com</a>) is a crypto-library supporting ECC.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Allan Odgaard</title>
		<link>http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-keys/#comment-25619</link>
		<dc:creator>Allan Odgaard</dc:creator>
		<pubDate>Sat, 23 May 2009 08:44:33 +0000</pubDate>
		<guid isPermaLink="false">http://macromates.com/sigpipe/archives/2004/09/05/using-openssl-for-license-keys/#comment-25619</guid>
		<description>&lt;p&gt;As for never freeing &lt;code&gt;dst&lt;/code&gt;, that is because &lt;code&gt;dst&lt;/code&gt; points to the decrypted license key, so we want to further work with that (like validate the license key).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>As for never freeing <code>dst</code>, that is because <code>dst</code> points to the decrypted license key, so we want to further work with that (like validate the license key).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Allan Odgaard</title>
		<link>http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-keys/#comment-25618</link>
		<dc:creator>Allan Odgaard</dc:creator>
		<pubDate>Sat, 23 May 2009 08:41:20 +0000</pubDate>
		<guid isPermaLink="false">http://macromates.com/sigpipe/archives/2004/09/05/using-openssl-for-license-keys/#comment-25618</guid>
		<description>&lt;p&gt;Marc: I removed the ‘+11’ from the assertion. As for a more complete (working) example, the &lt;a href=&quot;http://www.aquaticmac.com/&quot; rel=&quot;nofollow&quot;&gt;AquaticPrime&lt;/a&gt; framework is a F/OSS implementation of the scheme described in this article — I hope people can settle with that (I probably should make a habit out of providing downloadable source when I post articles :) ).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Marc: I removed the ‘+11’ from the assertion. As for a more complete (working) example, the <a href="http://www.aquaticmac.com/" rel="nofollow">AquaticPrime</a> framework is a F/OSS implementation of the scheme described in this article — I hope people can settle with that (I probably should make a habit out of providing downloadable source when I post articles :) ).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Serial codes vs. license files - Marc Charbonneau&#8217;s Blog</title>
		<link>http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-keys/#comment-25613</link>
		<dc:creator>Serial codes vs. license files - Marc Charbonneau&#8217;s Blog</dc:creator>
		<pubDate>Sun, 22 Mar 2009 20:26:36 +0000</pubDate>
		<guid isPermaLink="false">http://macromates.com/sigpipe/archives/2004/09/05/using-openssl-for-license-keys/#comment-25613</guid>
		<description>&lt;p&gt;[...] updates and blacklists, a serial number generator can be especially damaging. As far as I know, using OpenSSL it’s possible to create a licensing scheme that can not be beat by serial [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] updates and blacklists, a serial number generator can be especially damaging. As far as I know, using OpenSSL it’s possible to create a licensing scheme that can not be beat by serial [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Marc</title>
		<link>http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-keys/#comment-25612</link>
		<dc:creator>Marc</dc:creator>
		<pubDate>Sun, 08 Mar 2009 18:48:59 +0000</pubDate>
		<guid isPermaLink="false">http://macromates.com/sigpipe/archives/2004/09/05/using-openssl-for-license-keys/#comment-25612</guid>
		<description>&lt;p&gt;Thanks for the post Allan.  However, there appears to be an error in your code.  If data_size is supposed to be the length of the encoded message, then the assert statement is &lt;em&gt;incorrect&lt;/em&gt;.   data_size in this case is the same as RSA_size(rsa_key), and the decoded data that dst points to will have length data_size - 11.   So assertion should be:&lt;/p&gt;

&lt;p&gt;assert(data_size == RSA_size(rsa_key));&lt;/p&gt;

&lt;p&gt;If you meant data_size to be the length of the unencoded message, then the assertion is correct, but data_size is not the length of the encoded message, so it is the &lt;em&gt;incorrect&lt;/em&gt; argument to pass to  RSA_public_decrypt.  In this case you would pass data_size + 11 to RSA_public_decrypt.&lt;/p&gt;

&lt;p&gt;I think your post would benefit from a more complete working example because there are a few  things that are not obvious, like this issue with padding, the format of the public key, etc.  Also, you never free the memory pointed to by dst.&lt;/p&gt;

&lt;p&gt;Marc&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for the post Allan.  However, there appears to be an error in your code.  If data_size is supposed to be the length of the encoded message, then the assert statement is <em>incorrect</em>.   data_size in this case is the same as RSA_size(rsa_key), and the decoded data that dst points to will have length data_size &#8211; 11.   So assertion should be:</p>

<p>assert(data_size == RSA_size(rsa_key));</p>

<p>If you meant data_size to be the length of the unencoded message, then the assertion is correct, but data_size is not the length of the encoded message, so it is the <em>incorrect</em> argument to pass to  RSA_public_decrypt.  In this case you would pass data_size + 11 to RSA_public_decrypt.</p>

<p>I think your post would benefit from a more complete working example because there are a few  things that are not obvious, like this issue with padding, the format of the public key, etc.  Also, you never free the memory pointed to by dst.</p>

<p>Marc</p>]]></content:encoded>
	</item>
	<item>
		<title>By: David Schwartz</title>
		<link>http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-keys/#comment-25610</link>
		<dc:creator>David Schwartz</dc:creator>
		<pubDate>Tue, 20 Jan 2009 22:18:13 +0000</pubDate>
		<guid isPermaLink="false">http://macromates.com/sigpipe/archives/2004/09/05/using-openssl-for-license-keys/#comment-25610</guid>
		<description>&lt;p&gt;&quot;As for your analogy, a more apt one would be an article about how to make a car door lock that can’t be picked, and you coming along claiming it is horribly misleading because a robber can still smash the windshield.&quot;&lt;/p&gt;

&lt;p&gt;Exactly. That would be a horribly misleading article if it wasn&#039;t generally understood that no matter how secure a door lock is, a robber can break in the windshield. An article that claimed to provide a car security policy that only talked about secure door locks would be very misleading.&lt;/p&gt;

&lt;p&gt;Specifically, the articles says, &quot;... in a way which should make it difficult for the cracker to generate his own fake license key(s).&quot; This is true in a very technical sense -- they cannot create fake license keys that will be accepted by the unmodified software. It is not, however, true in the more important practical sense, there is no assurance they cannot run the software without a valid license.&lt;/p&gt;

&lt;p&gt;As for a disclaimer clearing up the confusion, I don&#039;t think that&#039;s needed. I think the comments have cleared up the misunderstandings. It might be helpful to put somewhere something like: &quot;Generating licenses that are difficult to forge is only one part in a licensing scheme. No matter how difficult it is to generate a fake license that will be accepted by the unmodified software, one can modify the software to accept an invalid license. Defeating such attempts is outside the scope of the license generation scheme.&quot;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>&#034;As for your analogy, a more apt one would be an article about how to make a car door lock that can’t be picked, and you coming along claiming it is horribly misleading because a robber can still smash the windshield.&#034;</p>

<p>Exactly. That would be a horribly misleading article if it wasn&#039;t generally understood that no matter how secure a door lock is, a robber can break in the windshield. An article that claimed to provide a car security policy that only talked about secure door locks would be very misleading.</p>

<p>Specifically, the articles says, &#034;&#8230; in a way which should make it difficult for the cracker to generate his own fake license key(s).&#034; This is true in a very technical sense &#8212; they cannot create fake license keys that will be accepted by the unmodified software. It is not, however, true in the more important practical sense, there is no assurance they cannot run the software without a valid license.</p>

<p>As for a disclaimer clearing up the confusion, I don&#039;t think that&#039;s needed. I think the comments have cleared up the misunderstandings. It might be helpful to put somewhere something like: &#034;Generating licenses that are difficult to forge is only one part in a licensing scheme. No matter how difficult it is to generate a fake license that will be accepted by the unmodified software, one can modify the software to accept an invalid license. Defeating such attempts is outside the scope of the license generation scheme.&#034;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Allan Odgaard</title>
		<link>http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-keys/#comment-25609</link>
		<dc:creator>Allan Odgaard</dc:creator>
		<pubDate>Tue, 20 Jan 2009 19:56:02 +0000</pubDate>
		<guid isPermaLink="false">http://macromates.com/sigpipe/archives/2004/09/05/using-openssl-for-license-keys/#comment-25609</guid>
		<description>&lt;p&gt;David: I realize that you find it useless to protect against fake serials, but that does not make the article &lt;em&gt;“horribly misleading”&lt;/em&gt; — maybe you should &lt;a href=&quot;http://en.wiktionary.org/wiki/mislead&quot; rel=&quot;nofollow&quot;&gt;lookup the word&lt;/a&gt;. As for your analogy, a more apt one would be an article about how to make a car door lock that can’t be picked, and you coming along claiming it is horribly misleading because a robber can still smash the windshield.&lt;/p&gt;

&lt;p&gt;You didn’t address my suggestion of putting in a disclaimer to help with the confusion you say you have observed, how about being constructive for a change?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>David: I realize that you find it useless to protect against fake serials, but that does not make the article <em>“horribly misleading”</em> — maybe you should <a href="http://en.wiktionary.org/wiki/mislead" rel="nofollow">lookup the word</a>. As for your analogy, a more apt one would be an article about how to make a car door lock that can’t be picked, and you coming along claiming it is horribly misleading because a robber can still smash the windshield.</p>

<p>You didn’t address my suggestion of putting in a disclaimer to help with the confusion you say you have observed, how about being constructive for a change?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: David Schwartz</title>
		<link>http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-keys/#comment-25608</link>
		<dc:creator>David Schwartz</dc:creator>
		<pubDate>Tue, 20 Jan 2009 19:10:08 +0000</pubDate>
		<guid isPermaLink="false">http://macromates.com/sigpipe/archives/2004/09/05/using-openssl-for-license-keys/#comment-25608</guid>
		<description>&lt;p&gt;I don&#039;t want to get into this again. But what&#039;s misleading is that it talks about how difficult it is to create a fake license key, but nobody would ever try to do that to a program that uses asymmetric encryption for the license keys. That&#039;s like talking about how hard your car is to steal because it cannot be concealed in a pocket.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I don&#039;t want to get into this again. But what&#039;s misleading is that it talks about how difficult it is to create a fake license key, but nobody would ever try to do that to a program that uses asymmetric encryption for the license keys. That&#039;s like talking about how hard your car is to steal because it cannot be concealed in a pocket.</p>]]></content:encoded>
	</item>
</channel>
</rss>
