<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Deep in the weeds (Posts about Commentary)</title><link>https://blog.mattice.org/</link><description></description><atom:link href="https://blog.mattice.org/categories/cat_commentary.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Tue, 16 May 2017 01:01:35 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>EMVCo's response</title><link>https://blog.mattice.org/posts/emvcos-response/index.html?utm_source=/categories/cat_commentary.xml&amp;utm_medium=nikola_feed&amp;utm_campaign=rss_feed</link><dc:creator>Mike Mattice</dc:creator><description>&lt;div&gt;&lt;p&gt;A little more than a month later, I got a response from EMVCo to &lt;a class="reference external" href="https://blog.mattice.org/posts/emvco-request/index.html"&gt;my request&lt;/a&gt;.  It's about what I expected.  I'm not sure they've read their own specification.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.mattice.org/posts/emvcos-response/index.html?utm_source=/categories/cat_commentary.xml&amp;amp;utm_medium=nikola_feed&amp;amp;utm_campaign=rss_feed"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>ASN.1</category><category>EMV</category><category>EMVCo</category><category>ISO-8825</category><category>specifications</category><category>tech</category><category>X.690</category><guid>https://blog.mattice.org/posts/emvcos-response/index.html</guid><pubDate>Mon, 02 May 2016 15:13:33 GMT</pubDate></item><item><title>Quick Chip EMV</title><link>https://blog.mattice.org/posts/quick-chip-emv/index.html?utm_source=/categories/cat_commentary.xml&amp;utm_medium=nikola_feed&amp;utm_campaign=rss_feed</link><dc:creator>Mike Mattice</dc:creator><description>&lt;div&gt;&lt;p&gt;So Google Now cards notified me about Visa's "new" Quick Chip EMV spec today.  Apparently I've been profiled as someone interested in EMV.  Go figure.&lt;/p&gt;
&lt;p&gt;From the &lt;a class="reference external" href="https://www.visa.com/chip/merchants/grow-your-business/payment-technologies/credit-card-chip/docs/quick-chip-emv-specification.pdf"&gt;Quick Chip EMV Specification&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;cite&gt;Note: Using Quick Chip, the insertion, reading, and subsequent removal of the card may occur while the sales transaction is being rung up; i.e., before the final amount is known.&lt;/cite&gt;&lt;/blockquote&gt;
&lt;p&gt;That's super cool!  It works much closer to the way a normal mag-stripe transaction would work in our stores.  Our customer service people do their thing while the customer does theirs in preparation for the end of the transaction and then the request happens as soon as the CS person is done and the customer verifies the amount.  This is much better than waiting for a response from the bank before you can pull your card.&lt;/p&gt;
&lt;p&gt;Reading the specification, it seems that the terminal's EMV kernel tells the card "Yep, I can't go online, go ahead and give me stuff for a deferred authentication".  This will only work if the terminal is doing "Online" verification, which I'd guess most, if not all US retailers are doing with magstripe auths.&lt;/p&gt;
&lt;p&gt;I started to wonder why Visa didn't come up with this years ago for everyone else that does EMV in the world. After reading the spec, it dawned on me.  This spec only works for &lt;em&gt;ONLINE&lt;/em&gt; transactions.  The rest of the world used a lot of offline authentications because they've historically had to pay for individual phone calls and those communications were less reliable than the always online terminals the US has used for so many years.&lt;/p&gt;
&lt;p&gt;One of the things that I find interesting is that Visa didn't bother fixing this problem 10 years ago for the UK.  Apparently the US consumer can't have anything get in the way of charging up their credit cards.&lt;/p&gt;
&lt;p&gt;If we're back to a unidirectional communication from card to issuer, why wouldn't private keys loaded into something like &lt;a class="reference external" href="http://onlycoin.com"&gt;Only Coin&lt;/a&gt; work?  With some detection built in, it could rotate its magstripe every time it was swiped to the next rolling code, just like NFC based credit cards have done for a few years now.  The cards would be more expensive, but maybe not extremely so at scale, and we could all go back to "normal" swipes.  Just a thought.&lt;/p&gt;&lt;/div&gt;</description><category>EMV</category><category>tech</category><category>Visa</category><guid>https://blog.mattice.org/posts/quick-chip-emv/index.html</guid><pubDate>Wed, 20 Apr 2016 02:35:51 GMT</pubDate></item><item><title>EMVCo Request</title><link>https://blog.mattice.org/posts/emvco-request/index.html?utm_source=/categories/cat_commentary.xml&amp;utm_medium=nikola_feed&amp;utm_campaign=rss_feed</link><dc:creator>Mike Mattice</dc:creator><description>&lt;div&gt;&lt;p&gt;I sent the following to EMVCo via &lt;a class="reference external" href="https://www.emvco.com/PublicComments.aspx"&gt;https://www.emvco.com/PublicComments.aspx&lt;/a&gt; on March 28th at about 0200UTC.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Table 35 &amp;amp; 36 refer to ISO/IEC 8825 which is also ITU-T Rec. X.690.  The X.690 spec available at &lt;a class="reference external" href="https://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf"&gt;https://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Specifically, the document states "According to ISO/IEC 8825, Table 36 defines the coding rules of the subsequent bytes of a BER-TLV tag when tag numbers ≥ 31 are used (that is, bits b5 - b1 of the first byte equal '11111')."&lt;/p&gt;
&lt;p&gt;Please explain how 9F02 follows this?  The tag number for 9F02 is 2, which is clearly &amp;lt; 31.&lt;/p&gt;
&lt;dl class="docutils"&gt;
&lt;dt&gt;IEC/ISO 8255 states:&lt;/dt&gt;
&lt;dd&gt;8.1.2.2 For tags with a number ranging from zero to 30 (inclusive), the identifier octets shall comprise a single octet encoded as follows:
a) bits 8 and 7 shall be encoded to represent the class of the tag as specified in Table 1;
b) bit 6 shall be a zero or a one according to the rules of 8.1.2.5;
c) bits 5 to 1 shall encode the number of the tag as a binary integer with bit 5 as the most significant bit.&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;That essentially tells me that every EMV tag that's two bytes with the second byte less than 31 is invalid and not capable of being encoded by BER.&lt;/p&gt;
&lt;p&gt;I look forward to your response.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I figure two weeks is plenty of time for them to respond to this simple inquiry.  Unfortunately, I got the only the following in response:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;*****Please do not reply to this email*****&lt;/p&gt;
&lt;p&gt;Dear Mike Mattice,&lt;/p&gt;
&lt;p&gt;Thank you for submitting your comment to EMVCo. EMVCo has received your comment and will review and respond as deemed necessary.&lt;/p&gt;
&lt;p&gt;Please note that EMVCo does not guarantee a response to public comments. EMVCo has implemented a new subscriber program through its website in order to facilitate dialog and interaction between EMVCo and its subscriber community. For more details, please find the service description in the EMVCo website "Contact Us" section.&lt;/p&gt;
&lt;p&gt;For your reference, a copy of your comment is included below.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;The EMVCo Communication Secretariat
Message ID:1001&lt;/p&gt;
&lt;p&gt;&lt;cite&gt;-------------------&lt;/cite&gt;&lt;/p&gt;
&lt;p&gt;Comment ID: 12005&lt;/p&gt;
&lt;p&gt;&lt;cite&gt;-------------------&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Perhaps I should start a gofundme to become an EMVCo subscriber so I can get a guaranteed answer.&lt;/p&gt;
&lt;p&gt;In other news I sent this to &lt;a class="reference external" href="mailto:customerservice@iso.org"&gt;customerservice@iso.org&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Are there repercussions for claiming to follow ISO standards (like 8825) but not actually doing so?&lt;/p&gt;
&lt;p&gt;Thanks,
Mike&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A couple days later I got:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;ISO standards are voluntary, and as such, ISO does not carry out any assessment of conformity, nor does it monitor the implementation of its standards.&lt;/p&gt;
&lt;p&gt;A number of ISO standards - mainly those concerned with health, safety or the environment - have been adopted in some countries as part of their regulatory framework, or are referred to in legislation for which they serve as the technical basis. However, such adoptions are decisions by the regulatory authorities or governments of the countries concerned. ISO itself does not regulate or legislate.&lt;/p&gt;
&lt;p&gt;Cordially,&lt;/p&gt;
&lt;p&gt;joseph martinez&lt;/p&gt;
&lt;p&gt;Information Expert | marketing and sales services | marketing, communication &amp;amp; information | iso central secretariat | phone: +41 22 749 03 17&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So, no repercussions for saying you follow ISO-8825, but not actually doing so.&lt;/p&gt;&lt;/div&gt;</description><category>ASN.1</category><category>EMV</category><category>EMVCo</category><category>ISO-8825</category><category>specifications</category><category>tech</category><category>X.690</category><guid>https://blog.mattice.org/posts/emvco-request/index.html</guid><pubDate>Thu, 14 Apr 2016 04:01:08 GMT</pubDate></item><item><title>ASN.1 and EMV</title><link>https://blog.mattice.org/posts/asn1-and-emv/index.html?utm_source=/categories/cat_commentary.xml&amp;utm_medium=nikola_feed&amp;utm_campaign=rss_feed</link><dc:creator>Mike Mattice</dc:creator><description>&lt;div&gt;&lt;p&gt;I've been tasked with making EMV work for the company I work for and more importantly, for our customers.  As I write python most of the time these days, I looked around for a tool to play with &lt;a class="reference external" href="https://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf"&gt;ASN.1&lt;/a&gt;.  A stupidly quick Google landed me on &lt;a class="reference external" href="http://pyasn1.sf.net"&gt;pyasn1&lt;/a&gt;.  I made a run at using it to manipulate the BER-TLV the &lt;a class="reference external" href="https://www.emvco.com/download_agreement.aspx?id=654"&gt;EMV 4.3 Book 3&lt;/a&gt; requires.  This resulted in some difficulties.  I reported a &lt;a class="reference external" href="https://sourceforge.net/p/pyasn1/mailman/message/34776952/"&gt;bug&lt;/a&gt; via the mailing list.&lt;/p&gt;
&lt;p&gt;Thinks have changed in the past two months.&lt;/p&gt;
&lt;p&gt;pyasn1 moved to &lt;a class="reference external" href="https://github.com/etingof/pyasn1"&gt;github&lt;/a&gt;.  I'd built some work arounds and submitted a &lt;a class="reference external" href="https://github.com/etingof/pyasn1/pull/5"&gt;PR&lt;/a&gt;.  I ended up splitting the PR into &lt;a class="reference external" href="https://github.com/etingof/pyasn1/pull/6"&gt;another&lt;/a&gt; because that one could break extended tags everywhere.  The issues I saw with the EMV tags and how they decoded are in that first PR, and also in &lt;a class="reference external" href="https://github.com/mmattice/emv-asn1"&gt;emv-asn1&lt;/a&gt;, which I wrote with my assumptions I'd codified in &lt;a class="reference external" href="https://github.com/mmattice/pyasn1/tree/bugfix/emv"&gt;bugfix/emv&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I did these things because I was sure EMVCo would surely stick to standards and that they had interpreted the ASN.1 spec correctly.  I now know I was wrong.&lt;/p&gt;
&lt;p&gt;I've built, and am using, an internal version of pyasn1 and that allows me to encode/decode this EMV stuff 'properly'.  I've even made a decoder/encoder pair for our pinpad's odd text based format with these assumptions.&lt;/p&gt;
&lt;p&gt;Now, however, I want to burn it all to the ground.&lt;/p&gt;
&lt;p&gt;Today I found &lt;a class="reference external" href="https://github.com/Shopify/grizzly_ber"&gt;grizzly_ber&lt;/a&gt;, which is the same workaround in Ruby.  I realized it wasn't just me that was having trouble with this.&lt;/p&gt;
&lt;p&gt;From &lt;a class="reference external" href="https://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf"&gt;ASN.1&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;dl class="docutils"&gt;
&lt;dt&gt;8.1.2.2 For tags with a number ranging from zero to 30 (inclusive), the identifier octets shall comprise a single octet encoded as follows:&lt;/dt&gt;
&lt;dd&gt;&lt;ol class="first last loweralpha simple"&gt;
&lt;li&gt;bits 8 and 7 shall be encoded to represent the class of the tag as specified in Table 1;&lt;/li&gt;
&lt;li&gt;bit 6 shall be a zero or a one according to the rules of 8.1.2.5;&lt;/li&gt;
&lt;li&gt;bits 5 to 1 shall encode the number of the tag as a binary integer with bit 5 as the most significant bit.&lt;/li&gt;
&lt;/ol&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;8.1.2.4 For tags with a number greater than or equal to 31, the identifier shall comprise a leading octet followed by one or more subsequent octets.&lt;/p&gt;
&lt;dl class="docutils"&gt;
&lt;dt&gt;8.1.2.4.1 The leading octet shall be encoded as follows:&lt;/dt&gt;
&lt;dd&gt;&lt;ol class="first last loweralpha simple"&gt;
&lt;li&gt;bits 8 and 7 shall be encoded to represent the class of the tag as listed in Table 1;&lt;/li&gt;
&lt;li&gt;bit 6 shall be a zero or a one according to the rules of 8.1.2.5;&lt;/li&gt;
&lt;li&gt;bits 5 to 1 shall be encoded as 11111.&lt;/li&gt;
&lt;/ol&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a class="reference external" href="http://www.emvlab.org/emvtags/show/t82/"&gt;82&lt;/a&gt; and &lt;a class="reference external" href="http://www.emvlab.org/emvtags/show/t9f02"&gt;9F02&lt;/a&gt; are an example of how EMVCo failed.  9F02 decodes to (80 + 1F) with a tag number of (02); 82 decodes to (80) tagno (02).  That 1F is only supposed to be there &lt;strong&gt;For tags with a number greater than or equal to 31&lt;/strong&gt;.  The EMV standard even refers to the ASN.1 spec correctly in Book 3 Annex B1.&lt;/p&gt;
&lt;blockquote&gt;
Table 36 defines the coding rules of the subsequent bytes of a BER-TLV tag when tag numbers ≥ 31 are used (that is, bits b5 - b1 of the first byte equal '11111').&lt;/blockquote&gt;
&lt;p&gt;The EMV standard claims to use BER-TLV encoding.  It does not.  How can we fix this?  Is it fixable?  What's the right approach?&lt;/p&gt;
&lt;p&gt;I personally like to do things "The Right Way".  Doing so would require billions of cards to be replaced and many instances of software to be updated.  I just don't see that happening any time soon.&lt;/p&gt;
&lt;p&gt;I've &lt;a class="reference external" href="https://www.emvco.com/PublicComments.aspx"&gt;asked&lt;/a&gt; EMVCo how 9F** tags (and the rest of the extended tags) follow the standard they claim to follow.  I'm not guaranteed a response without &lt;a class="reference external" href="https://www.emvco.com/about_emvco.aspx?id=161"&gt;subscribing for $2500&lt;/a&gt;.  We'll see if I get a response.&lt;/p&gt;&lt;/div&gt;</description><category>ASN.1</category><category>EMV</category><category>specifications</category><category>tech</category><guid>https://blog.mattice.org/posts/asn1-and-emv/index.html</guid><pubDate>Sun, 27 Mar 2016 23:41:16 GMT</pubDate></item></channel></rss>