<?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: Encoding integers in the EMV protocol</title>
	<atom:link href="http://www.lightbluetouchpaper.org/2010/01/19/encoding-integers-in-the-emv-protocol/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lightbluetouchpaper.org/2010/01/19/encoding-integers-in-the-emv-protocol/</link>
	<description>Security Research, Computer Laboratory, University of Cambridge</description>
	<lastBuildDate>Fri, 10 Feb 2012 17:31:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mike Bond</title>
		<link>http://www.lightbluetouchpaper.org/2010/01/19/encoding-integers-in-the-emv-protocol/comment-page-1/#comment-45858</link>
		<dc:creator>Mike Bond</dc:creator>
		<pubDate>Sat, 23 Jan 2010 12:48:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=1532#comment-45858</guid>
		<description>At the risk of making a &quot;throway comment&quot;, which some finextra commenter already chided Steven for, this is my opinion:

The real problem is not over-complexity in the means of EMV, but over-complexity in the goals. It simply tries to support far too many options and variations. To give an example: a lot of the on-card risk management is just a waste of time imho. A large proportion of our customers simply dont bother with that stuff, they look to use the default values, and I think they&#039;d prefer if it wasnt there at all. And mastercard and visa busy themselves making little changes and deltas to make their spec own version, because they are too proud to agree. Hence we have a raft of super-specifications on top of EMV, and EMV has been explicitly designed to support this diversity. Diversity is bad (well, that throw away comment is a whole argument for another day). So my main gripe is with the aims, not with the means.

Now, it may be that the way EMV has turned out is the best one could possibly hope for a protocol designed and agreed between multiple interested parties with no clear dictator to lay down the way things are. But whilst that can explain problems, it cant annul them.

We are left with a situation where EMV sucks, I&#039;m afraid. It&#039;s true... BUT... it sucks in the same way that &lt;a href=&quot;http://www1.arl.wustl.edu/~jst/reInventTheNet/?p=28&quot; rel=&quot;nofollow&quot;&gt;TCP/IP sucks&lt;/a&gt;. And just like TCP/IP, EMV is very successful, well at least in that it has achieved wide deployment and we rely upon it daily. Perfect, no? Good, debatable? Successful -- yes!

End &quot;throwaway comment&quot;.</description>
		<content:encoded><![CDATA[<p>At the risk of making a &#8220;throway comment&#8221;, which some finextra commenter already chided Steven for, this is my opinion:</p>
<p>The real problem is not over-complexity in the means of EMV, but over-complexity in the goals. It simply tries to support far too many options and variations. To give an example: a lot of the on-card risk management is just a waste of time imho. A large proportion of our customers simply dont bother with that stuff, they look to use the default values, and I think they&#8217;d prefer if it wasnt there at all. And mastercard and visa busy themselves making little changes and deltas to make their spec own version, because they are too proud to agree. Hence we have a raft of super-specifications on top of EMV, and EMV has been explicitly designed to support this diversity. Diversity is bad (well, that throw away comment is a whole argument for another day). So my main gripe is with the aims, not with the means.</p>
<p>Now, it may be that the way EMV has turned out is the best one could possibly hope for a protocol designed and agreed between multiple interested parties with no clear dictator to lay down the way things are. But whilst that can explain problems, it cant annul them.</p>
<p>We are left with a situation where EMV sucks, I&#8217;m afraid. It&#8217;s true&#8230; BUT&#8230; it sucks in the same way that <a href="http://www1.arl.wustl.edu/~jst/reInventTheNet/?p=28" rel="nofollow">TCP/IP sucks</a>. And just like TCP/IP, EMV is very successful, well at least in that it has achieved wide deployment and we rely upon it daily. Perfect, no? Good, debatable? Successful &#8212; yes!</p>
<p>End &#8220;throwaway comment&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jony</title>
		<link>http://www.lightbluetouchpaper.org/2010/01/19/encoding-integers-in-the-emv-protocol/comment-page-1/#comment-45620</link>
		<dc:creator>Jony</dc:creator>
		<pubDate>Thu, 21 Jan 2010 11:55:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=1532#comment-45620</guid>
		<description>&quot;If the Lord Almighty had consulted me before embarking on creation thus, I should have recommended something simpler.&quot;
(Alfonso X The Wise).

ASN.1, Track 2 and Track 1 are legacy. EMV just adopyted them as they are.

Compressed numeric items are not really numbers, such as track 2 that contains &#039;D&#039;.

So we are left with two numeric formats, BCD and binary. While two is twice as much as the theoretical minimum,  it is far cry from the nine presented above.</description>
		<content:encoded><![CDATA[<p>&#8220;If the Lord Almighty had consulted me before embarking on creation thus, I should have recommended something simpler.&#8221;<br />
(Alfonso X The Wise).</p>
<p>ASN.1, Track 2 and Track 1 are legacy. EMV just adopyted them as they are.</p>
<p>Compressed numeric items are not really numbers, such as track 2 that contains &#8216;D&#8217;.</p>
<p>So we are left with two numeric formats, BCD and binary. While two is twice as much as the theoretical minimum,  it is far cry from the nine presented above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven J. Murdoch</title>
		<link>http://www.lightbluetouchpaper.org/2010/01/19/encoding-integers-in-the-emv-protocol/comment-page-1/#comment-45521</link>
		<dc:creator>Steven J. Murdoch</dc:creator>
		<pubDate>Wed, 20 Jan 2010 14:01:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=1532#comment-45521</guid>
		<description>@Ian

I agree. Having a programmer make a mistake like this is probably unavoidable, so processes which stop the bug hitting production code are essential. I think software engineering quality would be significantly improved if companies felt able to talk about such failures openly, so that others could learn from their mistakes.</description>
		<content:encoded><![CDATA[<p>@Ian</p>
<p>I agree. Having a programmer make a mistake like this is probably unavoidable, so processes which stop the bug hitting production code are essential. I think software engineering quality would be significantly improved if companies felt able to talk about such failures openly, so that others could learn from their mistakes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven J. Murdoch</title>
		<link>http://www.lightbluetouchpaper.org/2010/01/19/encoding-integers-in-the-emv-protocol/comment-page-1/#comment-45519</link>
		<dc:creator>Steven J. Murdoch</dc:creator>
		<pubDate>Wed, 20 Jan 2010 13:52:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=1532#comment-45519</guid>
		<description>@Fred

Indeed, the first few are from ASN.1 BER. However I would argue that implementing the decoder/encoder is not so trivial. Firstly, the EMV specifications are incomplete (e.g. they do not specify the endianness of multi-byte TLV field lengths). Secondly, unless great care is taken, an implementation will be vulnerable to buffer and/or integer overflows (as the various vulnerabilities in commercial ASN.1 decoders proves).

However, my main point was not so much about ASN.1, but about the huge variety of different encodings. Why is track one encoded differently from track two? Why is it possible to encode the amount of a transaction in either BCD or an unsigned binary integer? I think this complexity could be part of the reason we see implementation problems in EMV.

As for the two-digit years, that also surprised me given that the first version of EMV came out in 1996 when the Y2K bug was fairly well known. I&#039;m not sure if there was any practical impact though, because as far as I know the first large-scale deployments of EMV were post-2000.</description>
		<content:encoded><![CDATA[<p>@Fred</p>
<p>Indeed, the first few are from ASN.1 BER. However I would argue that implementing the decoder/encoder is not so trivial. Firstly, the EMV specifications are incomplete (e.g. they do not specify the endianness of multi-byte TLV field lengths). Secondly, unless great care is taken, an implementation will be vulnerable to buffer and/or integer overflows (as the various vulnerabilities in commercial ASN.1 decoders proves).</p>
<p>However, my main point was not so much about ASN.1, but about the huge variety of different encodings. Why is track one encoded differently from track two? Why is it possible to encode the amount of a transaction in either BCD or an unsigned binary integer? I think this complexity could be part of the reason we see implementation problems in EMV.</p>
<p>As for the two-digit years, that also surprised me given that the first version of EMV came out in 1996 when the Y2K bug was fairly well known. I&#8217;m not sure if there was any practical impact though, because as far as I know the first large-scale deployments of EMV were post-2000.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven J. Murdoch</title>
		<link>http://www.lightbluetouchpaper.org/2010/01/19/encoding-integers-in-the-emv-protocol/comment-page-1/#comment-45517</link>
		<dc:creator>Steven J. Murdoch</dc:creator>
		<pubDate>Wed, 20 Jan 2010 13:41:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=1532#comment-45517</guid>
		<description>@Alessandro

One of the most important characteristics of a good specification is that it should be implementable. The fact that otherwise competent programmers seem to be consistently unable to create secure ASN.1 implementations does point to a problem with the specification, in my opinion. Blaming programmers doesn&#039;t make the problems go away.

This lesson has already been learned in the field of safety critical systems. Previously, when an accident happened, a person would be identified as responsible for the &quot;human error&quot;, and fired or perhaps re-trained. The problem with this &quot;blame and train&quot; attitude is that people kept on dying.

The more modern approach to accident analysis is to accept that to err is human, and design systems around this fact. By looking at the system as a whole, we can help people make fewer mistakes, and design processes to reduce the damage when they do. This is the motivation behind root cause analysis: finding all the ways in which an accident could have been prevented, not just finding a person to blame.

With respect to software, I think that lessons can be learned from this field. If the correctness of a system depends on a super-human ability to not make mistakes, then the design of the system is broken. Correcting this requires changes of many different types, including use of static analysis, safer programming techniques, as well as procedural improvements such as in testing. However, I think an important addition would be to design specifications which do not lend themselves to implementation blunders.</description>
		<content:encoded><![CDATA[<p>@Alessandro</p>
<p>One of the most important characteristics of a good specification is that it should be implementable. The fact that otherwise competent programmers seem to be consistently unable to create secure ASN.1 implementations does point to a problem with the specification, in my opinion. Blaming programmers doesn&#8217;t make the problems go away.</p>
<p>This lesson has already been learned in the field of safety critical systems. Previously, when an accident happened, a person would be identified as responsible for the &#8220;human error&#8221;, and fired or perhaps re-trained. The problem with this &#8220;blame and train&#8221; attitude is that people kept on dying.</p>
<p>The more modern approach to accident analysis is to accept that to err is human, and design systems around this fact. By looking at the system as a whole, we can help people make fewer mistakes, and design processes to reduce the damage when they do. This is the motivation behind root cause analysis: finding all the ways in which an accident could have been prevented, not just finding a person to blame.</p>
<p>With respect to software, I think that lessons can be learned from this field. If the correctness of a system depends on a super-human ability to not make mistakes, then the design of the system is broken. Correcting this requires changes of many different types, including use of static analysis, safer programming techniques, as well as procedural improvements such as in testing. However, I think an important addition would be to design specifications which do not lend themselves to implementation blunders.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://www.lightbluetouchpaper.org/2010/01/19/encoding-integers-in-the-emv-protocol/comment-page-1/#comment-45427</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Tue, 19 Jan 2010 21:10:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=1532#comment-45427</guid>
		<description>It&#039;s interesting to know what the developer did wrong, but the most important question is why the entire German EFT industry didn&#039;t detect this problem before 2010.  Typically, any project involving the deployment or development of hardware or software for ATMs, POS systems or cards goes through pretty rigorous formal testing and certification.  Did EVERY SINGLE German test plan omit a simple &quot;future date&quot; test case? Did someone pick it up and not realise the impact? Did someone pick it up and suppress it??</description>
		<content:encoded><![CDATA[<p>It&#8217;s interesting to know what the developer did wrong, but the most important question is why the entire German EFT industry didn&#8217;t detect this problem before 2010.  Typically, any project involving the deployment or development of hardware or software for ATMs, POS systems or cards goes through pretty rigorous formal testing and certification.  Did EVERY SINGLE German test plan omit a simple &#8220;future date&#8221; test case? Did someone pick it up and not realise the impact? Did someone pick it up and suppress it??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fred</title>
		<link>http://www.lightbluetouchpaper.org/2010/01/19/encoding-integers-in-the-emv-protocol/comment-page-1/#comment-45415</link>
		<dc:creator>Fred</dc:creator>
		<pubDate>Tue, 19 Jan 2010 18:29:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=1532#comment-45415</guid>
		<description>The first several formats you list are all straight out of ASN.1 BER encoding, and as such ought to be part of the repertoire of anyone coding for this kind of thing. None of them is in the least difficult, either to encode or to decode.
That still doesn&#039;t excuse interpreting &quot;101010&quot; as a date in 2016, of course. But what cretin specified 2-digit years in the first place?</description>
		<content:encoded><![CDATA[<p>The first several formats you list are all straight out of ASN.1 BER encoding, and as such ought to be part of the repertoire of anyone coding for this kind of thing. None of them is in the least difficult, either to encode or to decode.<br />
That still doesn&#8217;t excuse interpreting &#8220;101010&#8243; as a date in 2016, of course. But what cretin specified 2-digit years in the first place?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alessandro Triglia</title>
		<link>http://www.lightbluetouchpaper.org/2010/01/19/encoding-integers-in-the-emv-protocol/comment-page-1/#comment-45407</link>
		<dc:creator>Alessandro Triglia</dc:creator>
		<pubDate>Tue, 19 Jan 2010 16:35:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=1532#comment-45407</guid>
		<description>Interesting article, but your mention of ASN.1 as a &quot;particularly bad offender&quot; is totally inappropriate.  None of the vulnerability reports related to ASN.1 encoding/decoding implementations that have appeared over the years have uncovered any defects in the ASN.1 standards themselves.  In each case, the source of reported vulnerability was a defect in this or that implementation.  Perhaps the most frequent defect found in those faulty implementations is buffer overflow.  You will agree that this is a very basic programming mistake, and not something attributable to the ASN.1 standards.</description>
		<content:encoded><![CDATA[<p>Interesting article, but your mention of ASN.1 as a &#8220;particularly bad offender&#8221; is totally inappropriate.  None of the vulnerability reports related to ASN.1 encoding/decoding implementations that have appeared over the years have uncovered any defects in the ASN.1 standards themselves.  In each case, the source of reported vulnerability was a defect in this or that implementation.  Perhaps the most frequent defect found in those faulty implementations is buffer overflow.  You will agree that this is a very basic programming mistake, and not something attributable to the ASN.1 standards.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

