<?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>Light Blue Touchpaper &#187; Cryptology</title>
	<atom:link href="http://www.lightbluetouchpaper.org/category/security-engineering/cryptology/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lightbluetouchpaper.org</link>
	<description>Security Research, Computer Laboratory, University of Cambridge</description>
	<lastBuildDate>Mon, 30 Jan 2012 10:06:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Romantic cryptography</title>
		<link>http://www.lightbluetouchpaper.org/2010/02/10/romantic-cryptography/</link>
		<comments>http://www.lightbluetouchpaper.org/2010/02/10/romantic-cryptography/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 11:47:30 +0000</pubDate>
		<dc:creator>Frank Stajano</dc:creator>
				<category><![CDATA[Academic papers]]></category>
		<category><![CDATA[Cryptology]]></category>
		<category><![CDATA[Privacy technology]]></category>
		<category><![CDATA[Protocols]]></category>

		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=1714</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Romantic+cryptography&amp;rft.aulast=Stajano&amp;rft.aufirst=Frank&amp;rft.subject=Academic+papers&amp;rft.subject=Cryptology&amp;rft.subject=Privacy+technology&amp;rft.subject=Protocols&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2010-02-10&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2010/02/10/romantic-cryptography/&amp;rft.language=English"></span>
The aptly-named Journal of Craptology (est. 1998) has just published a special Valentine Day issue. It contains a silly piece on Romantic Cryptography that we originally discussed in 1999 in our Friday meetings.
]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Romantic+cryptography&amp;rft.aulast=Stajano&amp;rft.aufirst=Frank&amp;rft.subject=Academic+papers&amp;rft.subject=Cryptology&amp;rft.subject=Privacy+technology&amp;rft.subject=Protocols&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2010-02-10&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2010/02/10/romantic-cryptography/&amp;rft.language=English"></span>
<p>The aptly-named <a href="http://www.anagram.com/~jcrap/">Journal of Craptology</a> (est. 1998) has just published a special <a href="http://www.anagram.com/~jcrap/Volume_7/">Valentine Day</a> issue. It contains a silly piece on <a href="http://www.cl.cam.ac.uk/~fms27/papers/2000-StajanoHar-romantic.pdf">Romantic Cryptography</a> that we <a href="http://www.cl.cam.ac.uk/research/security/meetings/past-presentations.html">originally discussed in 1999</a> in our Friday meetings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lightbluetouchpaper.org/2010/02/10/romantic-cryptography/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>New attacks on HMQV</title>
		<link>http://www.lightbluetouchpaper.org/2010/02/09/new-attacks-on-hmqv/</link>
		<comments>http://www.lightbluetouchpaper.org/2010/02/09/new-attacks-on-hmqv/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 00:02:40 +0000</pubDate>
		<dc:creator>Feng Hao</dc:creator>
				<category><![CDATA[Academic papers]]></category>
		<category><![CDATA[Cryptology]]></category>
		<category><![CDATA[Protocols]]></category>

		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=1703</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=New+attacks+on+HMQV&amp;rft.aulast=Hao&amp;rft.aufirst=Feng&amp;rft.subject=Academic+papers&amp;rft.subject=Cryptology&amp;rft.subject=Protocols&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2010-02-09&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2010/02/09/new-attacks-on-hmqv/&amp;rft.language=English"></span>
Many people may still remember the debates a few years ago about the HMQV protocol, a modification of MQV with the primary aim of provable security. Various attacks were later discovered for the original HMQV. In the subsequent submission to the IEEE P1363 standards, the HMQV protocol has been revised to address the reported weaknesses.
However, the revised HMQV protocol is [...]]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=New+attacks+on+HMQV&amp;rft.aulast=Hao&amp;rft.aufirst=Feng&amp;rft.subject=Academic+papers&amp;rft.subject=Cryptology&amp;rft.subject=Protocols&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2010-02-09&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2010/02/09/new-attacks-on-hmqv/&amp;rft.language=English"></span>
<p>Many people may still remember the debates a few years ago about the <a href="http://eprint.iacr.org/2005/176">HMQV</a> protocol, a modification of <a href="http://en.wikipedia.org/wiki/MQV">MQV</a> with the primary aim of provable security. <a href="http://eprint.iacr.org/2005/205">Various attacks</a> were later discovered for the original HMQV. In the subsequent <a href="http://grouper.ieee.org/groups/1363/P1363-Reaffirm/submissions/krawczyk-hmqv-spec.pdf">submission</a> to the <a href="http://grouper.ieee.org/groups/1363/">IEEE P1363 standards</a>, the HMQV protocol has been revised to address the reported weaknesses.</p>
<p>However, the revised HMQV protocol is still vulnerable. In a <a href="http://sites.google.com/site/haofeng662/YAK-short-final.pdf">paper</a> that I presented at Financial Cryptography &#8216;10, I described two new attacks. The first presents a counterexample to invalidate the basic authentication feature in the protocol. The second is generally applicable to other key exchange protocols, despite that many have formal security proofs.</p>
<p>The first attack is particularly concerning since the formal security proofs failed to detect this basic flaw. The HMQV protocol explicitly specifies that the Certificate Authority (CA) does not need to validate the public key except checking it is not zero. (This is one reason why HMQV claims to be more efficient than MQV). So, the protocol allows the CA to certify a small subgroup element as the user&#8217;s &#8220;public key&#8221;. Then, anyone who knows this &#8220;public key&#8221; can successfully pass authentication using HMQV (see the paper for details). Note, in this case, a private key doesn&#8217;t exit, but the authentication is successful. What is the &#8220;authentication&#8221; in HMQV based on?</p>
<p>The HMQV author acknowledges this attack, but states it has no bad effects. Although I disagree, this will be up to the reader to decide.</p>
<p><strong>Updates:</strong></p>
<ul>
<li>2010-03-11: Full version of the paper available <a href="http://eprint.iacr.org/2010/136">here</a></li>
<li>2010-04-04: My <a href="http://www.lightbluetouchpaper.org/2010/02/09/new-attacks-on-hmqv/#comment-54239">comments</a> on Tang&#8217;s <a href="http://eprint.iacr.org/2010/174">paper</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lightbluetouchpaper.org/2010/02/09/new-attacks-on-hmqv/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>How to vote anonymously under ubiquitous surveillance</title>
		<link>http://www.lightbluetouchpaper.org/2009/11/30/open-vote-networ/</link>
		<comments>http://www.lightbluetouchpaper.org/2009/11/30/open-vote-networ/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 18:38:42 +0000</pubDate>
		<dc:creator>Feng Hao</dc:creator>
				<category><![CDATA[Academic papers]]></category>
		<category><![CDATA[Cryptology]]></category>
		<category><![CDATA[Electronic voting]]></category>
		<category><![CDATA[Privacy technology]]></category>
		<category><![CDATA[Security engineering]]></category>

		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=1344</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=How+to+vote+anonymously+under+ubiquitous+surveillance&amp;rft.aulast=Hao&amp;rft.aufirst=Feng&amp;rft.subject=Academic+papers&amp;rft.subject=Cryptology&amp;rft.subject=Electronic+voting&amp;rft.subject=Privacy+technology&amp;rft.subject=Security+engineering&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2009-11-30&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2009/11/30/open-vote-networ/&amp;rft.language=English"></span>
In 2006, the Chancellor proposed to invade an enemy planet, but his motion was anonymously vetoed. Three years on, he still cannot find out who did it.
This time, the Chancellor is seeking re-election in the Galactic Senate. Some delegates don&#8217;t want to vote for him, but worry about his revenge. How to arrange an election [...]]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=How+to+vote+anonymously+under+ubiquitous+surveillance&amp;rft.aulast=Hao&amp;rft.aufirst=Feng&amp;rft.subject=Academic+papers&amp;rft.subject=Cryptology&amp;rft.subject=Electronic+voting&amp;rft.subject=Privacy+technology&amp;rft.subject=Security+engineering&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2009-11-30&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2009/11/30/open-vote-networ/&amp;rft.language=English"></span>
<p><a href="http://www.lightbluetouchpaper.org/2006/04/05/av-net-a-new-solution-to-the-dining-cryptographers-problem/">In 2006</a>, the Chancellor proposed to invade an enemy planet, but his motion was anonymously vetoed. Three years on, he still cannot find out who did it.</p>
<p>This time, the Chancellor is seeking re-election in the Galactic Senate. Some delegates don&#8217;t want to vote for him, but worry about his revenge. How to arrange an election such that the voter&#8217;s privacy will be best protected?</p>
<p>The environment is extremely adverse. Surveillance is everywhere. Anything you say will be recorded and traceable to you. All communication is essentially public. In addition, you have no one to trust but yourself.</p>
<p>It may seem mind-boggling that this problem is solvable in the first place. With cryptography, anything is possible. In a forthcoming paper to be published by IET Information Security, we (joint work with Peter Ryan and Piotr Zielinski) described a decentralized voting protocol called &#8220;Open Vote Network&#8221;.</p>
<p>In the Open Vote Network protocol, all communication data is open, and publicly verifiable. The protocol provides the maximum protection of the voter&#8217;s privacy; only a full collusion can break the privacy. In addition, the protocol is exceptionally efficient. It compares favorably to past solutions in terms of the round efficiency, computation load and bandwidth usage, and has been close to the best possible in each of these aspects.</p>
<p>With the same security properties, it seems unlikely to have a decentralized voting scheme that is significantly more efficient than ours. However, in cryptography, nothing is ever optimal, so we keep this question open.</p>
<p>A preprint of the paper is available <a href="http://sites.google.com/site/haofeng662/OpenVote_final.pdf">here</a>, and the slides <a href="http://sites.google.com/site/haofeng662/OpenVote_talk.pdf">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lightbluetouchpaper.org/2009/11/30/open-vote-networ/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Defending against wedge attacks in Chip &amp; PIN</title>
		<link>http://www.lightbluetouchpaper.org/2009/08/25/defending-against-wedge-attacks/</link>
		<comments>http://www.lightbluetouchpaper.org/2009/08/25/defending-against-wedge-attacks/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 13:00:57 +0000</pubDate>
		<dc:creator>Steven J. Murdoch</dc:creator>
				<category><![CDATA[Banking security]]></category>
		<category><![CDATA[Cryptology]]></category>

		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=1196</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Defending+against+wedge+attacks+in+Chip+%26%23038%3B+PIN&amp;rft.aulast=Murdoch&amp;rft.aufirst=Steven+J.&amp;rft.subject=Banking+security&amp;rft.subject=Cryptology&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2009-08-25&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2009/08/25/defending-against-wedge-attacks/&amp;rft.language=English"></span>
The EMV standard, which is behind Chip &#038; PIN, is not so much a protocol, but a toolkit from which protocols can be built. One component it offers is card authentication, which allows the terminal to discover whether a card is legitimate, without having to go online and contact the bank which issued it. Since [...]]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Defending+against+wedge+attacks+in+Chip+%26%23038%3B+PIN&amp;rft.aulast=Murdoch&amp;rft.aufirst=Steven+J.&amp;rft.subject=Banking+security&amp;rft.subject=Cryptology&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2009-08-25&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2009/08/25/defending-against-wedge-attacks/&amp;rft.language=English"></span>
<p>The <a href="http://en.wikipedia.org/wiki/EMV">EMV standard</a>, which is behind Chip &#038; PIN, is not so much a protocol, but a toolkit from which protocols can be built. One component it offers is card authentication, which allows the terminal to discover whether a card is legitimate, without having to go online and contact the bank which issued it. Since the deployment of Chip &#038; PIN, cards issued in the UK only offer SDA (static data authentication) for card authentication. Here, the card contains a digital signature over a selection of data records (e.g. card number, expiry date, etc). This digital signature is generated by the issuing bank, and the bank&#8217;s public key is, in turn, signed by the payment scheme (e.g. Visa or MasterCard).</p>
<p>The transaction process for an SDA card goes roughly as follows:</p>
<table>
<tr>
<td><em>Card auth.</em></td>
<td>Card &rarr; Terminal:</td>
<td>records, sig<sub>BANK</sub>{records}</td>
</tr>
<tr>
<td><em>Cardholder verif.</em></td>
<td>Terminal &rarr; Card:</td>
<td>PIN entered</td>
</tr>
<tr>
<td></td>
<td>Card &rarr; Terminal:</td>
<td>PIN&nbsp;OK</td>
</tr>
<tr>
<td><em>Transaction auth.</em></td>
<td>Terminal &rarr; Card:</td>
<td>transaction, nonce</td>
</tr>
<tr>
<td></td>
<td>Card &rarr; Terminal:</td>
<td>MAC{transaction, nonce, PIN&nbsp;OK}</td>
</tr>
</table>
<p>Some things to note here:</p>
<ul>
<li>The card contains a static digital signature, which anyone can read and replay</li>
<li>The response to PIN verification is not authenticated</li>
</ul>
<p>This means that anyone who has brief access to the card, can read the digital signature to create a clone which will pass card authentication. Moreover, the fraudster doesn&#8217;t need to know the customer&#8217;s PIN in order to use the clone, because it can simply return &#8220;yes&#8221; to any PIN and the terminal will be satisfied. Such clones (so-called &#8220;yes cards&#8221;) have been <a href="http://www.dailymail.co.uk/news/article-389084/Millions-danger-chip-pin-fraudsters.html">produced by security consultants</a> as a demo, and also <a href="http://digitaldebateblogs.typepad.com/digital_money/2008/10/i-didnt-want-to.html">have been found in the wild</a>.</p>
<p><span id="more-1196"></span>Yes cards can be caught at the transaction authorisation stage, because the card sends a MAC (message authentication code), which includes a nonce (so cannot be replayed) and includes whether the PIN was correct. However, the key necessary to verify this MAC is not known by the terminal: it must connect to the issuing bank in real-time. For offline transactions, the MAC therefore will not be verified, and the fraudster will walk out with the goods before the clone is detected.</p>
<p>The problem of the yes-card is well known, e.g. (<a href="http://www.cl.cam.ac.uk/~sjm217/papers/cl05chipandspin.pdf">Chip &#038; SPIN</a>), so to resist this vulnerability EMV includes another option for card authentication: DDA (Dynamic Data Authentication). This has been used throughout most of Europe since their Chip &#038; PIN deployment and is now starting to be used in the UK (SDA cards used to be cheaper, but now the difference is marginal). This has allowed us to see more about how these cards are being used in practice.</p>
<p>For a DDA transaction, cardholder verification and transaction authorisation proceed the same as for SDA. However, card authentication involves some extra steps, because now the card has a public/private key pair:</p>
<table>
<tr>
<td><em>Card auth.</em></td>
<td>Card &rarr; Terminal:</td>
<td>records, <strong>pubkey<sub>CARD</sub></strong>, sig<sub>BANK</sub>{records, <strong>pubkey<sub>CARD</sub></strong>}</td>
</tr>
<tr>
<td></td>
<td><strong>Terminal &rarr; Card:</strong></td>
<td>nonce</td>
</tr>
<tr>
<td></td>
<td><strong>Card &rarr; Terminal:</strong></td>
<td>sig<sub>CARD</sub>{card nonce, terminal nonce}</td>
</tr>
</table>
<p>This fixes the attack of copying the digital signature. Because the clone doesn&#8217;t have the card&#8217;s private key, it won&#8217;t be able to respond with a valid signature of the nonce.</p>
<p>DDA is clearly a big improvement, but it&#8217;s not perfect. Note that card authentication happens before PIN verification, and its result still remains unauthenticated. This weakness can be exploited with a &#8220;wedge&#8221;: a device which sits between the real card and terminal, which can manipulate the messages flowing between them. One attack, which tampers with the cardholder verification stage, works as follows:</p>
<table>
<tr>
<td><em>Card auth.</em></td>
<td>Card &rarr; Terminal:</td>
<td>records, pubkey<sub>CARD</sub>, sig<sub>BANK</sub>{records, pubkey<sub>CARD</sub>}</td>
</tr>
<tr>
<td></td>
<td>Terminal &rarr; Card:</td>
<td>nonce</td>
</tr>
<tr>
<td></td>
<td>Card &rarr; Terminal:</td>
<td>sig<sub>CARD</sub>{card nonce, terminal nonce}</td>
</tr>
<tr>
<td><em>Cardholder verif.</em></td>
<td><strong>Terminal &rarr; Wedge</strong>:</td>
<td>Wrong PIN entered</td>
</tr>
<tr>
<td></td>
<td><strong>Wedge &rarr; Terminal:</strong></td>
<td>PIN&nbsp;OK</td>
</tr>
<tr>
<td><em>Transaction auth.</em></td>
<td><strong>Terminal &rarr; Wedge</strong>:</td>
<td>transaction, nonce</td>
</tr>
<tr>
<td></td>
<td><strong>Wedge &rarr; Terminal:</strong></td>
<td>Fake MAC</td>
</tr>
</table>
<p>Here, although the fraudster enters the wrong PIN for the card, the wedge responds that the PIN has been verified successfully. It also responds with a fake MAC, which indicates that PIN verification succeeded. In this way, someone who has stolen a card can use it for offline Chip &#038; PIN transactions, without having to know the correct PIN. Like yes-cards, the wedge attack can be detected if the terminal goes online, because the MAC check will fail.</p>
<p>The existence of the wedge attack is an unfortunate protocol flaw, which I think was discovered after EMV was rolled out. I have seen a mention in Chris Mitchell&#8217;s <a href="http://www.isg.rhul.ac.uk/cjm/IY5601/IY5601_B_060205_83-156.pdf">lecture notes</a> (p16) for the Royal Holloway MSc course, but not a full write up anywhere. Later versions of EMV include yet another variant of card authentication &#8212; CDA (Combined DDA/Application Cryptogram Generation) &#8212; which partially resolves this problem. However CDA is new, may not work with old terminals, and has some other disadvantages which make it unpopular, so as far as I know nobody uses it (at least yet).</p>
<p>However, it occurred to me that there might be a way to partially resolve the wedge attack, while still being compliant with DDA, and requiring minimal or no changes to the card or terminals. This is because cards can request that the terminal sends them additional information, as well as the nonce, to sign. One item available is the Cardholder Verification Method Results (CVMR), which holds the terminal&#8217;s view of whether cardholder verification succeeded, and what method was used (e.g. PIN, signature, etc.) to do so. The full protocol would then become:</p>
<table>
<tr>
<td><em>Card auth. 1</em></td>
<td>records, pubkey<sub>CARD</sub>, sig<sub>BANK</sub>{records, pubkey<sub>CARD</sub>}</td>
</tr>
<tr>
<td><em>Cardholder verif.</em></td>
<td>Terminal &rarr; Card:</td>
<td>PIN entered</td>
</tr>
<tr>
<td></td>
<td>Card &rarr; Terminal:</td>
<td>PIN&nbsp;OK</td>
</tr>
<tr>
<td><em>Card auth. 2</em></td>
<td><strong>Terminal &rarr; Card:</strong></td>
<td>nonce, CVMR</td>
</tr>
<tr>
<td></td>
<td><strong>Card &rarr; Terminal:</strong></td>
<td>sig<sub>CARD</sub>{card nonce, terminal nonce, CVMR}</td>
</tr>
<tr>
<td><em>Transaction auth.</em></td>
<td>Terminal &rarr; Card:</td>
<td>transaction, nonce</td>
</tr>
<tr>
<td></td>
<td>Card &rarr; Terminal:</td>
<td>MAC{transaction, nonce, PIN&nbsp;OK}</td>
</tr>
</table>
<p>If the terminal sends the CVMR to the card, the card checks that it matches its perception of reality before signing it, and the terminal verifies that the CVMR comes back properly signed, then the wedge attack will be defeated. This is because during the wedge attack against cardholder verification, the terminal thinks that PIN verification succeeded, whereas the card thinks that PIN verification was not attempted.</p>
<p>Doing this check of the CVMR does require the DDA card authentication to be performed after cardholder verification, so a change to the terminal may be needed. However, this is incentive-compatible, because the terminal is purchased by the merchant and it is the merchant who is being protected. Changes would probably be needed on the card, so that they request and check the CVMR. This is more tricky because the merchants do not have any direct control over issuing banks, but maybe there would still be incentive as reducing fraud would be in the interests of customers.</p>
<p>Whether these change are actually worthwhile depends on why DDA was rolled out in the first place. Reportedly only 10&#8211;20% of transactions are offline, so for most transactions neither the wedge nor yes-card will work reliably. But DDA has been rolled out, so could it be that there is a drive to permit more transactions to be offline? Or maybe DDA is just testing the technology before CDA is rolled out. Here, the card signs the full transaction and so preventing other variants of the wedge attack (e.g. tampering with the transaction so that the terminal thinks the card has authorised a large transaction offline, when it in fact exceeds the card&#8217;s limit).</p>
<p>I&#8217;d be interested in comments on the idea of including the CVMR in the DDA signature. Could this be supported by cards and terminals? There might be some compatibility issues I&#8217;m not aware of, but so far it seems to me that it is a small change which would make it a lot harder to pull off a potentially problematic class of frauds.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lightbluetouchpaper.org/2009/08/25/defending-against-wedge-attacks/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>When Layers of Abstraction Don&#8217;t Get Along: The Difficulty of Fixing Cache Side-Channel Vulnerabilities</title>
		<link>http://www.lightbluetouchpaper.org/2009/02/20/when-layers-of-abstraction-dont-get-along-the-difficulty-of-fixing-cache-side-channel-vulnerabilities/</link>
		<comments>http://www.lightbluetouchpaper.org/2009/02/20/when-layers-of-abstraction-dont-get-along-the-difficulty-of-fixing-cache-side-channel-vulnerabilities/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 06:58:15 +0000</pubDate>
		<dc:creator>Joseph Bonneau</dc:creator>
				<category><![CDATA[Cryptology]]></category>
		<category><![CDATA[Hardware & signals]]></category>
		<category><![CDATA[Operating systems]]></category>
		<category><![CDATA[Security engineering]]></category>

		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=661</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=When+Layers+of+Abstraction+Don%26%238217%3Bt+Get+Along%3A+The+Difficulty+of+Fixing+Cache+Side-Channel+Vulnerabilities&amp;rft.aulast=Bonneau&amp;rft.aufirst=Joseph&amp;rft.subject=Cryptology&amp;rft.subject=Hardware+%26%23038%3B+signals&amp;rft.subject=Operating+systems&amp;rft.subject=Security+engineering&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2009-02-20&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2009/02/20/when-layers-of-abstraction-dont-get-along-the-difficulty-of-fixing-cache-side-channel-vulnerabilities/&amp;rft.language=English"></span>
(co-authored with Robert Watson)
Recently, our group was treated to a presentation by Ruby Lee of Princeton University, who discussed novel cache architectures which can prevent some cache-based side channel attacks against AES and RSA. The new architecture was fascinating, in particular because it may actually increase cache performance (though this point was spiritedly debated by [...]]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=When+Layers+of+Abstraction+Don%26%238217%3Bt+Get+Along%3A+The+Difficulty+of+Fixing+Cache+Side-Channel+Vulnerabilities&amp;rft.aulast=Bonneau&amp;rft.aufirst=Joseph&amp;rft.subject=Cryptology&amp;rft.subject=Hardware+%26%23038%3B+signals&amp;rft.subject=Operating+systems&amp;rft.subject=Security+engineering&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2009-02-20&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2009/02/20/when-layers-of-abstraction-dont-get-along-the-difficulty-of-fixing-cache-side-channel-vulnerabilities/&amp;rft.language=English"></span>
<p>(co-authored with <a href="http://www.watson.org/~robert/">Robert Watson</a>)</p>
<p>Recently, our group was treated to a presentation by <a href="http://www.princeton.edu/~rblee/">Ruby Lee</a> of Princeton University, who discussed novel cache architectures which can prevent some cache-based side channel attacks against AES and RSA. The new architecture was fascinating, in particular because it may actually <em>increase</em> cache performance (though this point was spiritedly debated by several systems researchers in attendance). For the security group, though, it raised two interesting and troubling questions. What is the proper defence against side-channels due to processor cache? And why hasn&#8217;t it been implemented despite these attacks being around for years?</p>
<p><span id="more-661"></span>The history of cached memory being used a side channel goes all the way back to the classic page-fault password attacks against TENEX <a href="http://cwe.mitre.org/documents/sources/RISOSProjectFinalReport.pdf">reported in 1976</a>.  The possibility of using processor cache as a side channel against crypto routines was <a href="http://www.cryptography.net/resources/whitepapers/TimingAttacks.pdf">suggested</a> by Paul Kocher in 1996, and <a href="http://www.schneier.com/paper-side-channel2.pdf">again</a> by John Kelsey et al. in 1998, but largely ignored during AES standardisation. Rijndael was selected despite its heavy reliance on table lookup to achieve good performance in software. Daniel Page described <a href="http://www.compsci.bristol.ac.uk/Publications/Papers/1000625.pdf">theoretical cache attacks against DES</a> in more detail in 2002. Daniel Bernstein finally broke the flood gates open in 2005 with an <a href="http://cr.yp.to/antiforgery/cachetiming-20050414.pdf">experimental statistical timing attack</a> on AES. This was followed over the next year by Colin Percival&#8217;s <a href="http://cr.yp.to/bib/2005/percival-cache.pdf">cache-snooping attacks against RSA on hyperthreaded processors</a>,  Dag Osvik et al.&#8217;s <a href="http://mirror.cr.yp.to/eprint.iacr.org/2005/271.pdf">cache-preloading-and-inspection attacks</a>, Guido Bertoni et al.&#8217;s <a href="http://home.dei.polimi.it/gpalermo/papers/ITCC05.pdf">cache power-consumption attacks</a>, and my own <a href="http://www.jbonneau.com/AES_timing_full.pdf">cache-collision timing attacks</a>.</p>
<p>All of the AES attacks have a common structure and cause: AES performs table lookups at indexes dependent on individual bytes of the key. Cache being a shared resource, attackers can potentially see the side-effects of these lookups, such as eviction of the attacker&#8217;s data from cache, or increased time and power consumption due to the ratio of hits to misses. This is an excellent example of how security vulnerabilities get overlooked: a bizarre interaction of algorithmic optimisations of AES and the architecture of processor caches. Both of these are messy details which were designed to be abstracted away from the majority of their users.</p>
<p>Here we are in 2009, and the vulnerability still exists. Interestingly, the problem hasn&#8217;t seen a lack of proposed solutions (there have been dozens), but too many solutions at different levels of abstraction, each with its own drawbacks:</p>
<ul>
<li><strong>Algorithmic level:</strong> AES could be de-certified for situations where an attacker may have access to side-channel information. AES runner-up <a href="http://www.cl.cam.ac.uk/~rja14/Papers/serpent.pdf">Serpent</a> avoided table-lookups, as do most candidates in the current <a href="http://www.ecrypt.eu.org/stream/">eSTREAM</a> and <a href="http://csrc.nist.gov/groups/ST/hash/sha-3/index.html">SHA-3</a> competitions. Of course, this relies on millions of implementers to determine if side-channel attacks may apply and then choose an appropriate alternative to AES. For the future, we can chalk up the use of table-lookups in cryptographic software as a one-time mistake and move on, but for now we&#8217;re stuck with AES for decades.</li>
<li><strong>Software level: </strong>Many neat implementation tricks have been proposed to protect AES, from <a href="http://eprint.iacr.org/2006/052.pdf">altering or randomising</a> the use of caches to <a href="http://www.springerlink.com/index/950m081267502000.pdf">bitslicing the encryption</a> and eliminating caches. A software patch worked for RSA, where re-shuffling the pre-computed values of the message <a href="http://cvs.openssl.org/chngview?cn=13344">has been deployed</a> to mitigate Percival&#8217;s hyperthreading attacks against bit-windowed exponentiation. Unfortunately, the cost of this approach is prohibitive for AES as re-shuffling the AES lookup tables between encryptions is many times more costly than encrypting with no tables at all, an approach whose performance got us into the reliance on table-lookup in the first place. Even worse, randomisation doesn&#8217;t prevent collision attacks.</li>
<li><strong>OS level:</strong> The operating system, possibly with the assistance of new hardware-instructions, could close the cache side-channel by partitioning the cache between processes, locking critical sections of cache, or simply disabling shared cache or hyperthreading during sections of code marked as &#8220;security critical&#8221; by application programmers. The downsides here are multifold: this adds a lot of complexity for OS programmers, and the very transparency of caching becomes a problem-will the OS scheduling policy have to be changed for each minor cache design change in hardware, and will OS developer misunderstandings of hardware-specific cache behavior progress from edge-case performance loss to crypto vulnerability? Requiring a large number of people to understand the intricacies of caching behavior is almost certainly unrealistic (try giving <a href="download.intel.com/design/processor/manuals/253668.pdf">section 10</a> of Intel&#8217;s manual a read). We think there&#8217;s a nice analogy to the number of bugs introduced by concurrent execution-if each one of these were potentially a security vulnerability, it would be trouble.</li>
<li><strong>Cache implementation level:</strong> This is where Ruby Lee and her colleague&#8217;s proposal comes in. Perhaps we can exploit the fact that caches are just a performance optimisation which software shouldn&#8217;t rely on in detail, silently changing the caching behaviour to be randomised. This is nice in that action is required of relatively few people, but even assuming there is no performance penalty it is unsettling in that it makes caches even more complex, raising the possibility of future side-channels being found. The proposal also does nothing to prevent collision attacks.</li>
<li><strong>Instruction set level: </strong>Intel has finally announced dedicated AES support with its <a href="http://softwarecommunity.intel.com/isn/downloads/intelavx/Intel-AVX-Programming-Reference-31943302.pdf">AVX extensions</a>, due out in 2010. To most people&#8217;s satisfaction, a hardware AES implementation eliminates cache vulnerabilities, but servers purchased today will likely be running for decades.</li>
</ul>
<p>So, in the end we are left with many options and few good ones. We advocate in general that we should aim for a fix which requires the smallest number of people to make changes, and one which reduces complexity so as to prevent future vulnerabilities. By this metric the first and last options seem the best, but they also take the longest to implement, meaning for the short-term we&#8217;ll need to rely on hacks at the software and OS level, which means a lot of pain for crypto and operating system implementers. And while crypto algorithms are clear targets for cache attacks due to their iterated implementation which facilitates statistical attacks, we can&#8217;t rule out more general attacks in the future against other security-sensitive code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lightbluetouchpaper.org/2009/02/20/when-layers-of-abstraction-dont-get-along-the-difficulty-of-fixing-cache-side-channel-vulnerabilities/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Variable Length Fields in Cryptographic Protocols</title>
		<link>http://www.lightbluetouchpaper.org/2009/02/04/variable-length-fields-in-cryptographic-protocols/</link>
		<comments>http://www.lightbluetouchpaper.org/2009/02/04/variable-length-fields-in-cryptographic-protocols/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 22:46:13 +0000</pubDate>
		<dc:creator>Michael Roe</dc:creator>
				<category><![CDATA[Cryptology]]></category>

		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=659</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Variable+Length+Fields+in+Cryptographic+Protocols&amp;rft.aulast=Roe&amp;rft.aufirst=Michael&amp;rft.subject=Cryptology&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2009-02-04&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2009/02/04/variable-length-fields-in-cryptographic-protocols/&amp;rft.language=English"></span>
Many crypto protocols contain variable length fields: the names of the participants, different sizes of public key, and so on.
In my previous post, I mentioned how Liqun Chen has (re)discovered the attack that many protocols are broken if you don&#8217;t include the field lengths in MAC or signature computations (and, more to the point, a [...]]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Variable+Length+Fields+in+Cryptographic+Protocols&amp;rft.aulast=Roe&amp;rft.aufirst=Michael&amp;rft.subject=Cryptology&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2009-02-04&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2009/02/04/variable-length-fields-in-cryptographic-protocols/&amp;rft.language=English"></span>
<p>Many crypto protocols contain variable length fields: the names of the participants, different sizes of public key, and so on.</p>
<p>In my previous post, I mentioned how Liqun Chen has (re)discovered the attack that many protocols are broken if you don&#8217;t include the field lengths in MAC or signature computations (and, more to the point, a bunch of ISO standards fail to warn the implementor about this issue).</p>
<p>The problem applies to confidentiality, as well as integrity.</p>
<p>Many protocol verification tools (ProVerif, for example) will assume that the attacker is unable to distinguish enc(m1, k, iv) from enc(m2, k, iv) if they don&#8217;t know k.</p>
<p>If m1 and m2 are of different lengths, this may not be true: the length of the ciphertext leaks information about the length of the plaintext. With Cipher Block Chaining, you can tell the length of the plaintext to the nearest block, and with stream ciphers you can tell the exact length. So you can have protocols that are &#8220;proved&#8221; correct but are still broken, because the idealized protocol doesn&#8217;t properly represent what the implementation is really doing.</p>
<p>If you want different plaintexts to be observationally equivalent to the attacker, you can pad the variable-length fields to a fixed length before encrypting. But if there is a great deal of variation in length, this may be a very wasteful thing to do.</p>
<p>The alternative approach is to change your idealization of the protocol to reflect the reality of your encryption primitive. If your implementation sends m encrypted under a stream cipher, you can idealize it as sending an encrypted version of m together with L_m (the length of m) in the clear. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.lightbluetouchpaper.org/2009/02/04/variable-length-fields-in-cryptographic-protocols/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hidden Assumptions in Cryptographic Protocols</title>
		<link>http://www.lightbluetouchpaper.org/2009/02/02/hidden-assumptions-in-cryptographic-protocols/</link>
		<comments>http://www.lightbluetouchpaper.org/2009/02/02/hidden-assumptions-in-cryptographic-protocols/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 20:14:05 +0000</pubDate>
		<dc:creator>Michael Roe</dc:creator>
				<category><![CDATA[Cryptology]]></category>

		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=657</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Hidden+Assumptions+in+Cryptographic+Protocols&amp;rft.aulast=Roe&amp;rft.aufirst=Michael&amp;rft.subject=Cryptology&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2009-02-02&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2009/02/02/hidden-assumptions-in-cryptographic-protocols/&amp;rft.language=English"></span>
At the end of last week, Microsoft Research hosted a meeting of &#8220;Cryptoforma&#8221;, a proposed new project (a so-called &#8220;network of excellence&#8221;) to bring together researchers working on applying formal methods to security. They don&#8217;t yet know whether or not this project will get funding from the EPSRC, but I wish them good luck.
There were [...]]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Hidden+Assumptions+in+Cryptographic+Protocols&amp;rft.aulast=Roe&amp;rft.aufirst=Michael&amp;rft.subject=Cryptology&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2009-02-02&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2009/02/02/hidden-assumptions-in-cryptographic-protocols/&amp;rft.language=English"></span>
<p>At the end of last week, Microsoft Research hosted a meeting of &#8220;Cryptoforma&#8221;, a proposed new project (a so-called &#8220;network of excellence&#8221;) to bring together researchers working on applying formal methods to security. They don&#8217;t yet know whether or not this project will get funding from the EPSRC, but I wish them good luck.</p>
<p>There were several very interesting papers presented at the meeting, but today I want to talk about the one by Liqun Chen, &#8220;Parsing ambiguities in authentication and key establishment protocols&#8221;.</p>
<p>Some of the protocol specifications published by ISO specify how the protocol should be encoded on the wire, in sufficient detail to enable different implementations to interoperate. An example of a standard of this type is the one for the public key certificates that are used in SSL authentication of web sites (and many other applications).</p>
<p>The security standards produced by one group within ISO (SC27) aren&#8217;t like that. They specify the abstract protocols, but give the implementor considerable leeway in how they are encoded. This means that you can have different implementations that don&#8217;t interoperate. If these implementations are in different application domains, the lack of interoperability doesn&#8217;t matter. For example, Tuomas Aura and I recently wrote a paper in which we presented a protocol for privacy-preserving wireless LAN authentication, which we rather boldly claim to be based on the abstract protocol from ISO 9798-4.</p>
<p>You could think of these standards as separating concerns: the SC27 folks get the abstract crypto protocol correct, and then someone else standardises how to encode it in a particular application. But does the choice of concrete encoding affect the protocol&#8217;s correctness? </p>
<p>Liqun Chen points out one case where it clearly does. In the abstract protocols in ISO 9798-4 and others, data fields are joined by a double vertical bar operator. If you want to find out what that double vertical bar really means, you have to spend another 66 Swiss Francs and get a copy of ISO 9798-1, which tells you that Y || Z means &#8220;the result of the concatenation of the data items Y and Z in that order&#8221;.</p>
<p>Oops.</p>
<p>When we specify abstract protocols, it&#8217;s generally understood that the concrete encoding that gets signed or MAC&#8217;d contains enough information to unambigously identify the field boundaries: it contains length fields, a closing XML tag, or whatever. A signed message {Payee, Amount} K_A should not allow a payment of $3 to Bob12 to be mutated by the attacker into a payment of $23 to Bob1. But ISO 9798 (and a bunch of others) don&#8217;t say that. There&#8217;s nothing that says a conforming implementation can&#8217;t send the length field without authentication.</p>
<p>No of course, an implementor probably wouldn&#8217;t do that. But they <i>might</i>.</p>
<p>More generally: do these abstract protocols make a bunch of implicit, undocumented assumptions about the underlying crypto primitives and encodings that might turn out not to be true?</p>
<p>See also: Boyd, C. Hidden assumptions in cryptographic protocols. Computers and Digital Techniques, volume 137, issue 6, November <strong>1990</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lightbluetouchpaper.org/2009/02/02/hidden-assumptions-in-cryptographic-protocols/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>J-PAKE: From Dining Cryptographers to Jugglers</title>
		<link>http://www.lightbluetouchpaper.org/2008/05/29/j-pake/</link>
		<comments>http://www.lightbluetouchpaper.org/2008/05/29/j-pake/#comments</comments>
		<pubDate>Thu, 29 May 2008 20:31:05 +0000</pubDate>
		<dc:creator>Feng Hao</dc:creator>
				<category><![CDATA[Academic papers]]></category>
		<category><![CDATA[Cryptology]]></category>

		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=333</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=J-PAKE%3A+From+Dining+Cryptographers+to+Jugglers&amp;rft.aulast=Hao&amp;rft.aufirst=Feng&amp;rft.subject=Academic+papers&amp;rft.subject=Cryptology&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2008-05-29&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2008/05/29/j-pake/&amp;rft.language=English"></span>
Password Authenticated Key Exchange (PAKE) is one of the central topics in cryptography. It aims to address a practical security problem: how to establish secure communication between two parties solely based on their shared password without requiring a Public Key Infrastructure (PKI).
The solution to the above problem is very useful in practice &#8212; in fact, [...]]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=J-PAKE%3A+From+Dining+Cryptographers+to+Jugglers&amp;rft.aulast=Hao&amp;rft.aufirst=Feng&amp;rft.subject=Academic+papers&amp;rft.subject=Cryptology&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2008-05-29&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2008/05/29/j-pake/&amp;rft.language=English"></span>
<p>Password Authenticated Key Exchange (PAKE) is one of the central topics in cryptography. It aims to address a practical security problem: how to establish secure communication between two parties solely based on their shared password without requiring a Public Key Infrastructure (PKI).</p>
<p>The solution to the above problem is very useful in practice &#8212; in fact, so useful that it spawns a lot &#8220;fights&#8221; over patents. Many techniques were patented, including the well-known Encrypted Key Exchange (EKE) and Simple Password Exponential Key Exchange (SPEKE). A secondary problem is technical; both the EKE and SPEKE protocols have subtle but worrying technical limitations (see the <a href="http://grouper.ieee.org/groups/1363/Research/contributions/hao-ryan-2008.pdf">paper</a> for details).</p>
<p>At the 16th Workshop on Security Protocols held in April 2008, Cambridge, UK, I presented a new solution (joint work with Peter Ryan) called Password Authenticated Key Exchange by Juggling (or J-PAKE). The essence of the protocol design inherits from the earlier work on <a href="http://www.lightbluetouchpaper.org/2006/04/05/av-net-a-new-solution-to-the-dining-cryptographers-problem/">solving the Dining Cryptographers problem</a>; we adapted the same juggling technique to the two-party case to solve the PAKE problem. To our best knowledge, this design is significantly different from all past PAKE solutions.</p>
<p>Intuitively, the J-PAKE protocol works like a juggling game between two people &#8212; if we regard a public key as a &#8220;ball&#8221;. In round one, each person throws two ephemeral public keys (&#8220;balls&#8221;) to each other. In round 2, each person combines the available public keys and the password to form a new public key, and throws the new &#8220;ball&#8221; to each other.</p>
<p>After round 2, the two parties can securely compute a common session key, if they supplied the same passwords. Otherwise, the protocol leaks nothing more than: &#8220;the supplied passwords at two sides are not the same&#8221;. In other words, one can prove his knowledge of the password without revealing it. A Java implementation of the protocol on a MacBook Pro laptop shows that the total computation time at each side is merely 75 ms.</p>
<p>We hope this protocol is of usefulness to security engineers. For example, compared with SSL/TLS, J-PAKE is potentially much more resistant against phishing attacks, not to mention that it is PKI-free. Since this protocol is the result of an academic research project, we didn&#8217;t &#8212; and have no intention to &#8212; patent it. As explained in the <a href="http://grouper.ieee.org/groups/1363/Research/contributions/hao-ryan-2008.pdf">paper</a>, J-PAKE even has technical advantages over the patented EKE and SPEKE in terms of security, with comparable efficiency. It has been submitted as a follow-up to the <a href="http://grouper.ieee.org/groups/1363/Research/Schemes.html#HR08">possible future extension of IEEE P1363.2</a>.</p>
<p>We believe the PAKE research is important and has strong practical relevance. This post is to facilitate discussions on this subject. The paper can be viewed <a href="http://grouper.ieee.org/groups/1363/Research/contributions/hao-ryan-2008.pdf">here</a>. Any comments or questions are welcome.</p>
<p><strong><strong>Update</strong></strong></p>
<ul>
<li><strong>2008-06-28</strong>: a crude J-PAKE demo <span style="text-decoration: line-through"><a href="http://www.cl.cam.ac.uk/~fh240/software/JPAKE2.java">source code</a></span> (.java) by me. (link broken)</li>
<li><strong>2008-11-04</strong>: a more refined <a href="http://www.links.org/?p=393">J-PAKE in C</a> and <a href="http://www.links.org/?p=404">OpenSSL</a> by Ben Laurie.</li>
<li><strong>2008-11-11</strong>: possible applications of J-PAKE in <a href="http://jim.com/security/how_to_do_VPNs.html">VPN</a> and <a href="http://jim.com/security/how_browser_security_should_be_done.html">browser</a> by James.</li>
<li><strong>2009-02-08</strong>: public group parameters for 112-bit and 128-bit security can be found in the <a href="http://www.lightbluetouchpaper.org/2008/05/29/j-pake/#comment-30583">comments</a>.</li>
<li><strong>2009-03-15</strong>: fixed the broken link to the old Java file. Here is the link to the <a href="http://haofeng66.googlepages.com/JPAKEDemo.java">Java demo code</a>.</li>
<li><strong>2010-04-17</strong>: a journal version of the paper available on <a href="http://eprint.iacr.org/2010/190">IACR</a>. No technical change to the protocol.</li>
<li><strong>2010-10-25</strong>: the journal version of the paper is accepted to publish on the TCS journal &#8211; Springer Transactions on Computational Science, the special issue on &#8220;Security in Computing&#8221;, 2011.</li>
<li><strong>2010-11-25</strong>: Sebastien Martini reported an <a href="https://github.com/seb-m/jpake">implementation issue</a> of J-PAKE in OpenSSL and OpenSSH. The issue is not applicable to the <a href="http://haofeng66.googlepages.com/JPAKEDemo.java">Java demo code</a> that I wrote. As stated in the last paragraph of p. 11 in the <a href="http://eprint.iacr.org/2010/190.pdf">paper</a>, one shall check the element lies within the specified group. Stefan Arentz implemented <a href="https://github.com/st3fan/openssl/commit/f42f15741d28c16a64cf53ec0b0780c7c5eb8e3a">a fix</a> in OpenSSL. Official OpenSSL and OpenSSH patches can be found <a href="http://cvs.openssl.org/chngview?cn=20078">here</a> and <a href="http://lists.mindrot.org/pipermail/openssh-commits/2010-September/003115.html">here</a>.</li>
<li><strong>2011-01-11</strong>: Mozilla built J-PAKE into the base product of <a href="http://www.mozilla.com/en-GB/firefox/beta/">Firefox 4</a> ( beta 8 and later ). More details <a href="http://philikon.wordpress.com/2010/12/18/status-report-for-the-holiday-season/">here</a>.</li>
<li><strong>2012-01-18</strong>: Today, Mohsen Toorani uploaded<em> </em>a paper on <a href="http://eprint.iacr.org/2012/021">IACR eprint</a> to claim several attacks on J-PAKE. My response can be found <a href="http://www.lightbluetouchpaper.org/2008/05/29/j-pake/comment-page-2/#comment-235094">here</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lightbluetouchpaper.org/2008/05/29/j-pake/feed/</wfw:commentRss>
		<slash:comments>69</slash:comments>
		</item>
		<item>
		<title>Hardened stateless session cookies</title>
		<link>http://www.lightbluetouchpaper.org/2008/05/16/hardened-stateless-session-cookies/</link>
		<comments>http://www.lightbluetouchpaper.org/2008/05/16/hardened-stateless-session-cookies/#comments</comments>
		<pubDate>Fri, 16 May 2008 12:40:30 +0000</pubDate>
		<dc:creator>Steven J. Murdoch</dc:creator>
				<category><![CDATA[Academic papers]]></category>
		<category><![CDATA[Cryptology]]></category>
		<category><![CDATA[Meta]]></category>
		<category><![CDATA[Security engineering]]></category>

		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=323</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Hardened+stateless+session+cookies&amp;rft.aulast=Murdoch&amp;rft.aufirst=Steven+J.&amp;rft.subject=Academic+papers&amp;rft.subject=Cryptology&amp;rft.subject=Meta&amp;rft.subject=Security+engineering&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2008-05-16&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2008/05/16/hardened-stateless-session-cookies/&amp;rft.language=English"></span>
The root cause behind the last-but-one Wordpress cookie debacle was that the authors invented their own password hashing and cookie generation scheme. This is generally a bad idea, since it&#8217;s hard even for experts to get these right. Instead, whenever possible, a well-studied proposal should be chosen. It is for this reason that I suggested [...]]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Hardened+stateless+session+cookies&amp;rft.aulast=Murdoch&amp;rft.aufirst=Steven+J.&amp;rft.subject=Academic+papers&amp;rft.subject=Cryptology&amp;rft.subject=Meta&amp;rft.subject=Security+engineering&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2008-05-16&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2008/05/16/hardened-stateless-session-cookies/&amp;rft.language=English"></span>
<p>The root cause behind the <a href="http://www.lightbluetouchpaper.org/2007/11/20/wordpress-cookie-authentication-vulnerability/">last-but-one Wordpress cookie debacle</a> was that the authors invented their own password hashing and cookie generation scheme. This is generally a bad idea, since it&#8217;s hard even for experts to get these right. Instead, whenever possible, a well-studied proposal should be chosen. It is for this reason that I suggested the <a href="http://www.openwall.com/phpass/">phpass</a> library for password hashing, and the <a href="http://prisms.cs.umass.edu/~kevinfu/papers/webauth_tr.pdf">Fu et al.</a> stateless session cookie proposal.</p>
<p>These choices would be a substantial improvement on the previous custom design (had they been <a href="http://www.lightbluetouchpaper.org/2008/04/25/wordpress-25-cookie-integrity-protection-vulnerability/">implemented correctly</a>), but I still was not quite satisfied. The Fu et al. scheme has the property that an attacker who can read the cryptographic key stored in the database can create spoofed cookies. Given the history of Wordpress security, it seems likely that there will eventually be a vulnerability discovered which allows the key, which authenticates cookies, to be leaked.</p>
<p>It&#8217;s good practice in security engineering to design systems with the widest possible range of attacker capabilities in mind. I therefore designed a cookie scheme which would do all that the Fu et al. design did, but also maintained some of its security properties if the attacker has read-access to the authentication database and knows the cookie authentication key. I published a paper on this topic &#8212; <a href="http://www.cl.cam.ac.uk/~sjm217/papers/protocols08cookies.pdf">Hardened stateless session cookies</a> &#8212; at the 2008 <a href="http://spw.feis.herts.ac.uk/">Security Protocols Workshop</a>.</p>
<p>The trick behind my scheme is to store the hash of the user&#8217;s password in the cookie, and the hash of that in the authentication database. This means that it&#8217;s possible for the server to verify cookies, but the authentication database doesn&#8217;t contain enough information to create a fake cookie. Thus an attacker with read-access to the database still needs to know the user&#8217;s password to log in, and that isn&#8217;t stored. There are some additional subtleties to resist different attacks, and those are described in the <a href="http://www.cl.cam.ac.uk/~sjm217/papers/protocols08cookies.pdf">paper</a>.</p>
<p>I hope this proposal will trigger discussion over this important problem and lead to improved cookie authentication schemes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lightbluetouchpaper.org/2008/05/16/hardened-stateless-session-cookies/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Wordpress 2.5 cookie integrity protection vulnerability</title>
		<link>http://www.lightbluetouchpaper.org/2008/04/25/wordpress-25-cookie-integrity-protection-vulnerability/</link>
		<comments>http://www.lightbluetouchpaper.org/2008/04/25/wordpress-25-cookie-integrity-protection-vulnerability/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 16:03:19 +0000</pubDate>
		<dc:creator>Steven J. Murdoch</dc:creator>
				<category><![CDATA[Academic papers]]></category>
		<category><![CDATA[Cryptology]]></category>
		<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://www.lightbluetouchpaper.org/?p=320</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Wordpress+2.5+cookie+integrity+protection+vulnerability&amp;rft.aulast=Murdoch&amp;rft.aufirst=Steven+J.&amp;rft.subject=Academic+papers&amp;rft.subject=Cryptology&amp;rft.subject=Meta&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2008-04-25&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2008/04/25/wordpress-25-cookie-integrity-protection-vulnerability/&amp;rft.language=English"></span>
Recently, I was preparing to give a talk on web authentication so was looking at the source code of Wordpress, which I had just upgraded to version 2.5. Unfortunately, I found a rather nasty security hole, which has now been disclosed. If a Wordpress installation is configured to permit account creation, the vulnerability allows an [...]]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Wordpress+2.5+cookie+integrity+protection+vulnerability&amp;rft.aulast=Murdoch&amp;rft.aufirst=Steven+J.&amp;rft.subject=Academic+papers&amp;rft.subject=Cryptology&amp;rft.subject=Meta&amp;rft.source=Light+Blue+Touchpaper&amp;rft.date=2008-04-25&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.lightbluetouchpaper.org/2008/04/25/wordpress-25-cookie-integrity-protection-vulnerability/&amp;rft.language=English"></span>
<p>Recently, I was preparing to give a talk on web authentication so was looking at the source code of Wordpress, which I had just upgraded to version 2.5. Unfortunately, I found a rather nasty security hole, which has now been disclosed. If a Wordpress installation is configured to permit account creation, the vulnerability allows an attacker to gain administrator access.</p>
<p>The problem is to do with how cookies are generated. The authentication code was substantially overhauled for Wordpress 2.5, in part to deal with <a href="http://www.lightbluetouchpaper.org/2007/11/20/wordpress-cookie-authentication-vulnerability/">security problems</a>  in the password database. Now, the authentication cookies take the form of:</p>
<p><code>wordpress_.<em>COOKIEHASH</em> = <em>USERNAME</em> . | . <em>EXPIRY_TIME </em>. | . <em>MAC</em></code></p>
<div>Where:</div>
<dl>
<dt><code><em>COOKIEHASH</em></code></dt>
<dd>MD5 hash of the site URL (to maintain cookie uniqueness)</dd>
<dt><code><em>USERNAME</em></code></dt>
<dd>The username for the authenticated user</dd>
<dt><code><em>EXPIRY_TIME</em></code></dt>
<dd>When cookie should expire, in seconds since start of epoch</dd>
<dt><code><em>MAC</em></code></dt>
<dd><code>HMAC-MD5(<em>USERNAME</em> .  <em>EXPIRY_TIME</em>)</code> under a key derived from a secret and <code><em>USERNAME . EXPIRY_TIME</em></code>.</dd>
</dl>
<p>This scheme is based on two papers: <a href="http://pdos.csail.mit.edu/papers/webauth:tr.pdf">Dos and Don&#8217;ts of Client Authentication on the Web</a> by Fu et al. and <a href="http://www.cse.msu.edu/~alexliu/publications/Cookie/cookie.pdf">A Secure Cookie Protocol</a> by Liu et al. However, there is a small difference and, as is common in cryptographic systems, small changes can have big impact.</p>
<p>The problem is that <code><em>USERNAME</em></code> and <code><em>EXPIRY_TIME</em></code> are not delimited when calculating the MAC. This means that a MAC for one cookie is valid for any other, provided that <code><em>USERNAME</em> . <em>EXPIRY_TIME</em></code> is unchanged. So an attacker can register a username starting with &#8220;admin&#8221;, log in as usual, then modify their cookie so it&#8217;s valid for the administrator account. </p>
<p>Fu et al. called this the &#8220;cryptographic splicing&#8221; attack in <a href="http://pdos.csail.mit.edu/papers/webauth:tr.pdf">their paper</a> (Section 3.3), and is one of the many ways they show how people can slip up when implementing web authentication. Unfortunately,  dynamic website frameworks, especially PHP, offer little assistance to programmers trying to implement secure applications.</p>
<p>I will expand on this topic in a future post but in the mean time, if you run Wordpress, you really should <a href="http://wordpress.org/download/">upgrade to 2.5.1</a>. While Wordpress 2.3.3 doesn&#8217;t have the problem described here, it is still <a href="http://www.securityfocus.com/archive/1/490402">not secure</a>.</p>
<p>There is some more detail on the cookie vulnerability in my <a href="http://www.cl.cam.ac.uk/~sjm217/advisories/wordpress-cookie-integrity.txt">disclosure</a> (<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-1930">CVE-2008-1930</a>). Wordpress have mentioned it in their <a href="http://wordpress.org/development/2008/04/wordpress-251/">release announcement</a> and I&#8217;ve also just sent it to the usual <a href="http://www.securityfocus.com/archive/1/491356/30/0/threaded">mailing</a> <a href="http://seclists.org/fulldisclosure/2008/Apr/0699.html">lists</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lightbluetouchpaper.org/2008/04/25/wordpress-25-cookie-integrity-protection-vulnerability/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

