<?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>Benlog &#187; crypto</title>
	<atom:link href="http://benlog.com/articles/category/crypto/feed/" rel="self" type="application/rss+xml" />
	<link>http://benlog.com</link>
	<description>security, privacy, transparency.</description>
	<lastBuildDate>Thu, 22 Dec 2011 22:46:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>encryption is (mostly) not magic</title>
		<link>http://benlog.com/articles/2011/12/21/encryption-is-mostly-not-magic/</link>
		<comments>http://benlog.com/articles/2011/12/21/encryption-is-mostly-not-magic/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 20:17:08 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://benlog.com/?p=1878</guid>
		<description><![CDATA[A few months ago, Sony&#8217;s Playstation Network got hacked. Millions of accounts were breached, leaking physical addresses and passwords. Sony admitted that their data was &#8220;not encrypted.&#8221; Around the same time, researchers discovered that Dropbox stores user files &#8220;unencrypted.&#8221; Dozens (hundreds?) closed their accounts in protest. They&#8217;re my confidential files, they cried, why couldn&#8217;t you [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago, <a href="http://en.wikipedia.org/wiki/PlayStation_Network_outage">Sony&#8217;s Playstation Network got hacked</a>. Millions of accounts were breached, leaking physical addresses and passwords. Sony admitted that their data was &#8220;not encrypted.&#8221;</p>
<p>Around the same time, researchers discovered that <a href="http://en.wikipedia.org/wiki/Dropbox_%28service%29#Criticism">Dropbox stores user files &#8220;unencrypted.&#8221;</a> Dozens (hundreds?) closed their accounts in protest. They&#8217;re my confidential files, they cried, why couldn&#8217;t you at least encrypt them?</p>
<p>Many, including some quite tech-savvy folks, were quick to indicate that it would have been so easy to encrypt the data. Not encrypting the data proved Sony and Dropbox&#8217;s incompetence, they said.</p>
<p>In my opinion, it&#8217;s not quite that simple.</p>
<p>Encryption is easy, it&#8217;s true. You can download code that implements military-grade encryption in any programming language in a matter of seconds. So why can&#8217;t companies just encrypt the data they host and protect us from hackers?</p>
<p>The core problem is that, to be consumable by human users, data has to be decrypted. So the decryption key has to live somewhere between the data-store and the user&#8217;s eyeballs. For security purposes, you&#8217;d like the decryption key to be very far from the data-store and very close to the user&#8217;s eyeballs. Heck you&#8217;d like the decryption key to be *inside* the user&#8217;s brain. That&#8217;s not (yet) possible. And, in fact, in most cases, it isn&#8217;t even practical to have the key all that far from the data-store.</p>
<h4>encryption relocates the problem</h4>
<p>Sony needs to be able to charge your credit card, which requires your billing address. They probably need to do that whether or not you&#8217;re online, since you&#8217;re not likely to appreciate being involved in your monthly renewal, each and every month. So, even if they encrypt your credit card number and address, they also need to store the decryption key somewhere on their servers. And since they probably want to serve you an &#8220;update your account&#8221; page with address pre-filled, that decryption key has to be available to decrypt the data as soon as you click &#8220;update my account.&#8221; So, if Sony&#8217;s web servers need to be able to decrypt your data, and hackers break into Sony&#8217;s servers, there&#8217;s only so much protection encryption provides.</p>
<p>Meanwhile, Dropbox wants to give you access to your files everywhere. Maybe they could keep your files encrypted on their servers, with encryption keys stored only on your desktop machine? Yes&#8230; until you want to access your files over the Web using a friend&#8217;s computer. And what if you want to share a file with a friend while they&#8217;re not online? Somehow you have to send them the decryption key. Dropbox must now ask its users to manage the sharing of these decryption keys (good luck explaining that to them), or must hold on to the decryption key and manage who gets the key&#8230;. which means storing the decryption keys on their servers. If you walk down the usability path far enough – in fact not all that far – it becomes clear that Dropbox probably needs to store the decryption key not too far from the encrypted files themselves. Encryption can&#8217;t protect you once you actually mean to decrypt the data.</p>
<p>The features users need often dictate where the decryption key is stored. The more useful the product, the closer the decryption key has to be to the encrypted data. Don&#8217;t think of encryption as a magic shield that miraculously distinguishes between good and bad guys. Instead, think of encryption as a mechanism for shrinking the size of the secret (one small encryption key can secure gigabytes of data), thus allowing the easy relocation of the secret to another location. That&#8217;s still quite useful, but it&#8217;s not nearly as magical as many imply it to be.</p>
<h4>what about Firefox Sync, Apple TimeMachine, SpiderOak, Helios, etc.</h4>
<p>But but but, you might be thinking, there <em>are</em> systems that store encrypted data and don&#8217;t store the decryption key. <a href="http://www.mozilla.org/en-US/mobile/sync/">Firefox Sync</a>. Apple&#8217;s <a href="http://www.apple.com/timecapsule/">TimeMachine backup system</a>. The <a href="http://spideroak.com">SpiderOak</a> online backup system. Heck, even my own <a href="http://heliosvoting.org">Helios Voting System</a> encrypts user votes in the browser with no decryption keys stored anywhere except the trustees&#8217; own machines.</p>
<p>It&#8217;s true, in some very specific cases, you can build systems where the decryption key is stored only on a user&#8217;s desktop machine. Sometimes, you can even build a system where the key is stored nowhere durably; instead it is derived on the fly from the user&#8217;s password, used to encrypt/decrypt, then forgotten.</p>
<p>But all of these systems have significant usability downsides (yes, even my voting system). If you only have one machine connected to Firefox Sync, and you lose it, you cannot get your bookmarks and web history back. If you forget your Time Machine or SpiderOak password, and your main hard drive crashes, you cannot recover your data from backup. If you lose your Helios Voting decryption key, you cannot tally your election.</p>
<p>And when I say &#8220;you cannot get your data back,&#8221; I mean you would need a mathematical breakthrough of significant proportions to get your data back. It&#8217;s not happening. Your data is lost. Keep in mind: that&#8217;s the whole point of not storing the decryption key. It&#8217;s not a bug, it&#8217;s a feature.</p>
<h4>and then there&#8217;s sharing</h4>
<p>I alluded to this issue in the Dropbox description above: what happens when users want to share data with others? If the servers don&#8217;t have the decryption key, that means users have to pass the decryption key to one another. Maybe you&#8217;re thinking you can use public-key encryption, where each user has a keypair, publishes the public encryption key, and keeps secret the private decryption key? Now we&#8217;re back to &#8220;you can&#8217;t get your data back&#8221; if the user loses their private key.</p>
<p>And what about features like Facebook&#8217;s newsfeed, where servers process, massage, aggregate, and filter data for users before they even see it? If the server can&#8217;t decrypt the data, then how can it help you process the data before you see it?</p>
<p>To be clear: if your web site has social features, it&#8217;s very unlikely you can successfully push the decryption keys down to the user. You&#8217;re going to need to read the data on your servers. And if your servers need to read the data, then a hacker who breaks into the servers can read the data, too.</p>
<h4>so the cryptographer is telling me that encryption is useless?</h4>
<p>No, far from it. I&#8217;m only saying that encryption with end-user-controlled keys has far fewer applications than most people think. Those applications need to be well-scoped, and they have to accompanied by big bad disclaimers about what happens when you lose your key.</p>
<p>That said, encryption as a means of partitioning power and access on the server-side remains a very powerful tool. If you have to store credit card numbers, it&#8217;s best if you build a subsystem whose entire role is to store credit-card numbers encrypted, and process transactions from other parts of your system. If your entire system is compromised, then you&#8217;re no better off than if you hadn&#8217;t taken those precautions. But, if only part of your system is compromised, encryption may well stop an attacker from gaining access to the most sensitive parts of the system.</p>
<p>You can take this encryption-as-access-control idea very far. An MIT team just <a href="http://css.csail.mit.edu/cryptdb/">published CryptDB</a>, a modified relational database that uses interesting encryption techniques to strongly enforce access control. Note that, if you have the password to log into the database, this encryption isn&#8217;t going to hide the data from you: the decryption key is on the server. Still, it&#8217;s a very good defense-in-depth approach.</p>
<h4>what about this fully homomorphic encryption thing?</h4>
<p>OK, so I lied a little bit when I talked about pre-processing data. There is a kind of encryption, called homomorphic encryption, that lets you perform operations on data while it remains encrypted. The last few years have seen epic progress in this field, and it&#8217;s quite exciting&#8230;. for a cryptographer. These techniques remain extremely impractical for most use cases today, with an overhead factor in the trillions, both for storage and computation time. And, even when they do become more practical, the central decryption key problem remains: forcing users to manage decryption keys is, for the most part, a usability nightmare.</p>
<p>That said, I must admit: homomorphic encryption <em>is</em> actually almost like magic.</p>
<h4>the special case of passwords</h4>
<p>Passwords are special because, once stored, you never need to read them back out, you only need to check if a password typed by a user matches the one stored on the server. That&#8217;s very different than a credit-card number, which does need to be read after it&#8217;s stored so the card can be charged every month. So for passwords, we have special techniques. It&#8217;s not encryption, because encryption is reversible, and the whole point is that we&#8217;d like the system to strongly disallow extraction of user passwords from the data-store. The special tool is a one-way function, such as <tt>bcrypt</tt>. Take the password, process it using the one-way function, and store only the output. The one-way function is built to be difficult to reverse: you have to try a password to see if it matches. That&#8217;s pretty cool stuff, but really it only applies to passwords.</p>
<p>So, if you&#8217;re storing passwords, you should absolutely be passing them through a one-way function. You could say you&#8217;re &#8220;hashing&#8221; them, that&#8217;s close enough. In fact you probably want to say you&#8217;re salting and hashing them. But whatever you do, you&#8217;re not &#8220;encrypting&#8221; your passwords. That&#8217;s just silly.</p>
<h4>encryption is not a magic bullet</h4>
<p>For the most part, encryption isn&#8217;t magic. Encryption lets you manage secrets more securely, but if users are involved in the key management, that almost certainly comes at the expense of usability and features. Web services should strongly consider encryption where possible to more strictly manage their internal access controls. But think carefully before embarking on a design that forces users to manage their keys. In many cases, users simply don&#8217;t understand that losing the key means losing the data. As my colleague Umesh Shankar says, if you design a car lock so secure that locking yourself out means crushing the car and buying a new one, you&#8217;re probably doing it wrong.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2011/12/21/encryption-is-mostly-not-magic/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Wombat Voting: Open Audit Elections in Israel</title>
		<link>http://benlog.com/articles/2011/06/01/wombat-voting-open-audit-elections-in-israel/</link>
		<comments>http://benlog.com/articles/2011/06/01/wombat-voting-open-audit-elections-in-israel/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 04:00:36 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[voting]]></category>

		<guid isPermaLink="false">http://benlog.com/?p=1704</guid>
		<description><![CDATA[My friend Alon Rosen is leading an effort with colleagues Amon Ta-Shma, Ben Riva, and Yoni Ben-Nun in Israel to implement and deploy in-person open-audit voting. The project is called Wombat Voting. It combines a number of existing cryptographic techniques in a very nice package. Oh, and they&#8217;ve implemented it and used it to run [...]]]></description>
			<content:encoded><![CDATA[<p>My friend <a href="http://www.eecs.harvard.edu/~alon/">Alon Rosen</a> is leading an effort with colleagues Amon Ta-Shma, Ben Riva, and Yoni Ben-Nun in Israel to implement and deploy in-person open-audit voting. The project is called <a href="http://wombat-voting.com/">Wombat Voting</a>. It combines a number of existing cryptographic techniques in a very nice package. Oh, and they&#8217;ve implemented it and used it to run a 2000+ voter election, with apparently a few more elections in the pipeline. There&#8217;s a <a href="http://www.wombat-voting.com/media">ton of press about them</a>.</p>
<p>Here&#8217;s how it works:</p>
<div align="center">
<iframe src="http://player.vimeo.com/video/23433719?title=0&amp;byline=0&amp;portrait=0" width="400" height="290" frameborder="0"></iframe>
</div>
<p>Voters use an intuitive, touch-screen interface, receive a paper ballot they can physically cast in a transparent ballot box, <em>and</em> they get a physical encrypted receipt they can take home to make sure their vote actually counted. It&#8217;s awesome.</p>
<p>I&#8217;m extremely excited to see more truly verifiable voting systems implemented and deployed. Slowly but surely, we will get to a point where voting is truly auditable and democracy is actually verified. Israel, a high-tech democracy with engaged citizens, is a perfect place to get this kind of system going.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2011/06/01/wombat-voting-open-audit-elections-in-israel/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>grab the pitchforks!&#8230; again</title>
		<link>http://benlog.com/articles/2011/04/19/grab-the-pitchforks-again/</link>
		<comments>http://benlog.com/articles/2011/04/19/grab-the-pitchforks-again/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 17:49:30 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://benlog.com/?p=1618</guid>
		<description><![CDATA[I&#8217;m fascinated with how quickly people have reached for the pitchforks recently when the slightest whiff of a privacy/security violation occurs. Last week, a few interesting security tidbits came to light regarding Dropbox, the increasingly popular cloud-based file storage and synchronization service. There&#8217;s some interesting discussion of de-duplication techniques which might lead to Oracle attacks, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m fascinated with how quickly people have reached for the pitchforks recently when the slightest whiff of a privacy/security violation occurs.</p>
<p>Last week, a few interesting security tidbits came to light regarding <a href="http://dropbox.com">Dropbox</a>, the increasingly popular cloud-based file storage and synchronization service. There&#8217;s some interesting discussion of de-duplication techniques which might lead to Oracle attacks, etc., but the most important issue is that, suddenly, everyone&#8217;s realizing that Dropbox <em>could</em>, if needed, access your files. Miguel de Icaza wonders if Dropbox is pitching <a href="http://tirania.org/blog/archive/2011/Apr-19.html">snake oil</a>.</p>
<p>Yes, Dropbox staff can, if needed, access your files. I don&#8217;t mean to harp on my fellow technologists but&#8230; this has been obvious since day 1, because Dropbox offers a web-based interface to download your files, and even with the latest HTML5 technology, you&#8217;d be very hard-pressed to do in-browser file decryption. Let&#8217;s say you still don&#8217;t buy that, you still think that Dropbox might find a way to encrypt files and decrypt them in your browser. Dropbox also offers a password recovery mechanism, which means they can fully simulate you, the user, including, of course, getting at your files.</p>
<p>In other words, unless you&#8217;re ready to lose the convenience of password resets and web-based UI, Dropbox inherently has access to your files. Just like Facebook has access to your entire account, and Google to all of your docs, spreadsheets, etc. The only question is what kinds of internal safeguards do these companies have to prevent abuse by employees. Unless you&#8217;ve worked there, it&#8217;s hard to know. You could ask Dropbox to do third-party auditing, like Miguel proposes, but in my experience that provides little real security, since you have little way to know what that third-party actually did as part of their auditing (was it just &#8220;logic and accuracy&#8221; testing?)</p>
<p>The other thing we could ask is for the law to finally recognize that my files stored on Dropbox are no different than my files stored on a hard drive in my basement, from a legal perspective. They&#8217;re my property. And accessing them should require the same level of judicial oversight as a warrant to my home. That&#8217;s what a group of young MIT techies (myself included) and Harvard lawyers <a href="http://groups.csail.mit.edu/mac/classes/6.805/student-papers/fall98-papers/trespass/final.html">proposed in 1998</a>.</p>
<p>But back to Dropbox. Did they do something wrong? Yes, they did. They exaggerated their security and privacy claims. <em>Just like almost every other cloud data host today</em>. I wish, instead of picking on whichever startup suddenly succeeds, we picked on the industry as a whole. Stop talking about encryption in transit and encryption at rest in the same breath, as if they were the same thing. Stop using &#8220;encryption&#8221; as a synonym for &#8220;secure.&#8221; Stop saying &#8220;military-grade security.&#8221; Start being honest about who can access what.</p>
<p>And we, technologists, should stop with the drama, and not fall prey to the inflated expectations that marketing-heavy security policies have set. The Dropbox weaknesses should have been obvious to technologists from day one. The problem is that <em>all</em> privacy policies and security statements make exaggerated claims using reassuring keywords. Let&#8217;s harp on that.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2011/04/19/grab-the-pitchforks-again/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>intelligently designing trust</title>
		<link>http://benlog.com/articles/2011/03/30/intelligently-designing-trust/</link>
		<comments>http://benlog.com/articles/2011/03/30/intelligently-designing-trust/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 05:44:32 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://benlog.com/?p=1594</guid>
		<description><![CDATA[For the past week, every security expert&#8217;s been talking about Comodo-Gate. I find it fascinating: Comodo-Gate goes to the core of how we handle trust and how web architecture evolves. And in the end, this crisis provides a rare opportunity. warning signs Last year, Chris Soghoian and Sid Stamm published a paper, Certified Lies [PDF], [...]]]></description>
			<content:encoded><![CDATA[<p>For the past week, every security expert&#8217;s been talking about <a href="https://blog.torproject.org/blog/detecting-certificate-authority-compromises-and-web-browser-collusion">Comodo-Gate</a>. I find it fascinating: Comodo-Gate goes to the core of how we handle trust and how web architecture evolves. And in the end, this crisis provides a rare opportunity.</p>
<h4>warning signs</h4>
<p>Last year, Chris Soghoian and Sid Stamm published a paper, Certified Lies [<a href="http://files.cloudprivacy.net/ssl-mitm.pdf">PDF</a>], which identified the very issue that is at the center of this week&#8217;s crisis. Matt Blaze provided, as usual, a <a href="http://www.crypto.com/blog/spycerts/">fantastic explanation</a>:</p>
<blockquote><p>
A decade ago, I observed that commercial certificate authorities protect you from anyone from whom they are unwilling to take money. That turns out to be wrong; they don&#8217;t even do that much.
</p></blockquote>
<p>A <em>Certificate Authority</em> is a company that your web browser trusts to tell it who is who on the Internet. When you go to <tt>https://facebook.com</tt>, a Certificate Authority is vouching that, yes, this is indeed Facebook you&#8217;re talking to directly over a secure channel.</p>
<p>What Chris and Sid highlighted is an interesting detail of how web browsers have chosen to handle trust: any Certificate Authority can certify any web site. That design decision was reasonable in 1994, when there were only two Certificate Authorities and the world was in a rush to secure web transactions. But it&#8217;s not so great now, where a Certificate Authority in Italy can delegate its authority to a small reseller, who can then, in turn, certify any web site, including Facebook and Gmail, using more or less the level of assurance the small reseller sees fit.</p>
<h4>what happened</h4>
<p>It looks like someone from Iran hacked into one of the small resellers three degrees of delegation away from Comodo to issue to some unknown entity (the Iranian government?) certificates for major web sites, including Google and Microsoft. This gave that entity the power to impersonate those web sites, even over secure connections indicated by your browser padlock icon. It&#8217;s important to understand that this is <em>not Google or Microsoft&#8217;s fault</em>. They couldn&#8217;t do anything about it, nor could they detect this kind of attack. When Comodo discovered the situation, they revoked those certificates&#8230; but that didn&#8217;t do much good because the revocation protocol does not fail safely: if your web browser can&#8217;t contact the revocation server, it assumes the certificate is valid.</p>
<h4>a detour via Dawkins, Evolution, and the Giraffe</h4>
<p>Richard Dawkins, the world-famous evolutionary biologist, illustrates the truly contrived effects of evolution on a giraffe. The laryngeal nerve, which runs from the brain to the larynx, takes a detour around the heart. In the giraffe, it&#8217;s a ludicrous detour: down the animal&#8217;s enormous neck, around the heart, and back up the neck again to the larynx, right near where the nerve started to begin with!</p>
<p>If you haven&#8217;t seen this before, you really need to spend the 4 minutes to watch it:</p>
<p><iframe title="YouTube video player" width="640" height="390" src="http://www.youtube.com/embed/cO1a1Ek-HD0" frameborder="0" allowfullscreen></iframe></p>
<p>In Dawkins&#8217;s words:</p>
<blockquote><p>
Over millions of generations, this nerve gradually lengthened, each small step simpler than a major rewiring to a more direct route.
</p></blockquote>
<h4>and we&#8217;re back</h4>
<p>This evolution is, in my opinion, exactly what happened with certificate authorities. At first, with only two certificate authorities, it made sense to keep certificate issuance as simple as possible. With each added certificate authority, it still made no sense to revamp the whole certification process; it made more sense each time to just add a certificate authority to the list. And now we have a giraffe-scale oddity: hundreds of certificate authorities and all of their delegates can certify anyone, and it makes for a very weak system.</p>
<p>This isn&#8217;t, in my mind, a failure of software design. It&#8217;s just the natural course of evolution, be it biology or software systems. We can and should try to predict how certain designs will evolve, so that we can steer clear of obvious problems. But it&#8217;s very unlikely we can predict even a reasonable fraction of these odd evolutions.</p>
<h4>the opportunity</h4>
<p>So now that we&#8217;ve had a crisis, we have an opportunity to do something that Nature simply cannot do: we can explore radically redesigned mechanisms. <em>We can intelligently design trust</em>. But let&#8217;s not be surprised, in 15 years, when the wonderful design we outline today has evolved once again into something barely viable.</p>
<h4>taking further example from nature?</h4>
<p>Nature deals with this problem of evolutionary dead-ends in an interesting way: there isn&#8217;t just one type of animal. There are thousands. All different, all evolving under slightly different selection pressures, all interacting with one another. Some go extinct, others take over.</p>
<p>Should we apply this approach to software system design? I think so. Having a rich ecosystem of different components is better. We shouldn&#8217;t all use the same web browser. We shouldn&#8217;t all use the same trust model. We should allow for niches of feature evolution in this grand ecosystem we call the Web, because we simply don&#8217;t know how the ecosystem will evolve. How do we design software systems and standards that way? Now that&#8217;s an interesting question&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2011/03/30/intelligently-designing-trust/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>everything I know about voting I learned from American Idol</title>
		<link>http://benlog.com/articles/2011/03/02/everything-i-know-about-voting-i-learned-from-american-idol/</link>
		<comments>http://benlog.com/articles/2011/03/02/everything-i-know-about-voting-i-learned-from-american-idol/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 05:54:06 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[voting]]></category>

		<guid isPermaLink="false">http://benlog.com/?p=1528</guid>
		<description><![CDATA[Tonight, American Idol began online voting. Yes, I&#8217;m a fan of American Idol, but don&#8217;t let that fool you: I&#8217;m still a bitchin&#8217; cryptographer. I suspect that American Idol online voting will give rise to many questions such as &#8220;wow, awesome, now when can I vote in US Elections with my Facebook account?&#8221; and &#8220;Why [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight, American Idol began online voting. Yes, I&#8217;m a fan of American Idol, but don&#8217;t let that fool you: I&#8217;m still a bitchin&#8217; cryptographer. I suspect that American Idol online voting will give rise to many questions such as &#8220;wow, awesome, now when can I vote in US Elections with my Facebook account?&#8221; and &#8220;Why is online voting so hard anyways?&#8221; Perhaps I can be of assistance.</p>
<h4>the voting process</h4>
<p><a href="http://benlog.com/wp-content/uploads/2011/03/Screen-shot-2011-03-01-at-9.42.08-PM.png"><img src="http://benlog.com/wp-content/uploads/2011/03/Screen-shot-2011-03-01-at-9.42.08-PM.png" alt="" title="Screen shot 2011-03-01 at 9.42.08 PM" width="679" height="614" class="aligncenter size-full wp-image-1552" /></a></p>
<p>So the process is much like other Facebook-connected sites: using Facebook Connect, you log in and grant the American Idol Voting site some permissions, including reading your profile info (ok), getting your email address (ok I guess), and accessing your Facebook data even if you&#8217;re offline (ummm, why?). Then you select your favorite contestant, solve a CAPTCHA, and click &#8220;vote&#8221;. You&#8217;re prompted to post the vote to your Facebook feed, and told you can vote up to 50 times.</p>
<p>My first question was &#8220;what&#8217;s the CAPTCHA defending against?&#8221; I have some thoughts on that, which I&#8217;ll get back to&#8230;</p>
<h4>&#8220;a secure solution&#8221;</h4>
<p>The news that American Idol would use online voting was <a href="http://www.abcactionnews.com/dpp/news/Technology-you-can-use%3A-Facebook,-the-new-Idol-voting-frontier">reported with enthusiasm</a>:</p>
<blockquote><p>
“We have been wanting to do online voting for several years, and now Facebook has offered us a secure solution and we are ready to go,” said Simon Fuller, Creator and Executive Producer, American Idol.
</p></blockquote>
<p>So what does that mean, exactly? What guarantees do American Idol producers have that the system is &#8220;secure?&#8221; Hard to say. But let&#8217;s explore a few possibilities.</p>
<h4>ballot secrecy and coercion</h4>
<p>American Idol voting is not secret: your vote is posted to your Facebook newsfeed! Of course, unless you&#8217;re a contestant&#8217;s mother, chances are no one&#8217;s going to be upset at you if you don&#8217;t vote &#8220;the right way.&#8221; In political elections, and in fact in many elections where the outcome impacts voters in a material way, ballot secrecy <em>is</em> important, and undue influence of voters <em>is</em> a concern. That&#8217;s what makes things particularly difficult in &#8220;real&#8221; online voting: you should receive some believable proof that your vote was counted properly, but somehow that information can&#8217;t be leaked to others who might try to influence you, waiting to see how you voted to decide whether to pay you or break your kneecaps.</p>
<h4>one user = 50 votes?</h4>
<p>The voting itself is happening on the American Idol site, not on Facebook, so what American Idol is getting from Facebook is mostly the identity layer: to vote, you must have a Facebook account. Between that and the CAPTCHA, it&#8217;s probably fairly difficult for an individual user to have disproportionate influence. I have a feeling that&#8217;s why they allow individual voters to vote up to 50 times and require a CAPTCHA. After all, if <em>any</em> user can vote 50 times, but the process is fairly time-intensive, how worthwhile is it to register more accounts so you can vote more than 50 times? If voters could legitimately vote only once, then it would be very enticing to create a few fake Facebook accounts to easily quintuple your impact. But to just double your impact with 50 legal votes each, you&#8217;re going to have to manually fill out 50 <em>more</em> CAPTCHAs. Eh. Not worth it, right?</p>
<p>In other words, I think the 50 votes per person + CAPTCHA produce the great equalizer: almost no one is going to bother trying to find ways to cast more votes, because the payoff isn&#8217;t worth the pain. Clever!</p>
<h4>verifying the tally</h4>
<p>In typical secret ballot elections, it&#8217;s quite hard to check that the tally was properly computed. After all, once the vote is submitted, via web, SMS, or phone, the tallying process is visible only to the organizers, and the voters must trust that process blindly. Now, physical in-person elections have admittedly only a little bit more auditability: you can kind of watch the ballot box and, if you&#8217;re really motivated, stick around to see the ballots counted. But in the online voting space, unless you&#8217;ve got some fancy solution, the process is <em>totally opaque</em>.</p>
<p>Except&#8230; voting for American Idol isn&#8217;t secret! So, technically, the tally could be recomputed from culling together all of the Facebook newsfeed posts&#8230;. And that&#8217;s actually a key insight into how the fancy truly auditable voting systems work: all of the votes are published for the world to see, in a <em>special encrypted form</em> that doesn&#8217;t reveal individual votes but can be intelligently combined and checked against the claimed tally.  That&#8217;s what systems like <a href="http://heliosvoting.org">Helios</a> do.</p>
<h4>was my vote captured correctly?</h4>
<p>If you post your vote to your Facebook newsfeed, you can verify that it was recorded correctly. But what if something hijacks your browser, waits for you to log into Facebook, casts votes on your behalf (waiting for you to fill out the CAPTCHA or outsourcing it to some CAPTCHA solving farm), and opts not to post the results to Facebook? How can the American Idol producers ever detect this? They probably can&#8217;t.</p>
<p>The simplest way one might hijack your browser is via a technique called clickjacking: by wrapping the voting site in an HTML frame and layering a different user interface on top of it, a malicious site could trick you into voting for a different contestant than you intend. For example, the attacker might wait for you to cast your first vote freely, find out who you like by looking at your Facebook wall, and then switch the order of the candidates (by layering new photos on top of the underlying real site) to trick you into voting for a different candidate the other 49 times. Now, to American Idol&#8217;s credit, my quick-and-dirty attempt to frame their site and implement clickjacking failed: they&#8217;ve got <em>some</em> basic defense against clickjacking that I&#8217;m still investigating. Nice work! But of course, attacks that hijack the user&#8217;s browser can be much more intricate, including deploying and spreading a virus that takes full control of the browser and its display. There&#8217;s absolutely nothing a web site can do to defend against that.</p>
<p>And that, in fact, is the key issue we don&#8217;t know how to address when voting online in elections that have a high material impact. <em>We don&#8217;t know how to make sure that your browser is really working on your behalf and hasn&#8217;t been hijacked by malware</em>. It probably wouldn&#8217;t happen for American Idol (or would it?), but it surely would happen when voting for US President.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2011/03/02/everything-i-know-about-voting-i-learned-from-american-idol/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Facebook, the Control Revolution, and the Failure of Applied Modern Cryptography</title>
		<link>http://benlog.com/articles/2011/01/14/facebook-the-control-revolution-and-the-failure-of-applied-modern-cryptography/</link>
		<comments>http://benlog.com/articles/2011/01/14/facebook-the-control-revolution-and-the-failure-of-applied-modern-cryptography/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 07:40:12 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://benlog.com/?p=1490</guid>
		<description><![CDATA[In the late 1990s and early 2000s, it was widely assumed by most tech writers and thinkers, myself included, that the Internet was a &#8220;Control Revolution&#8221; (to use the words of Andrew Shapiro, author of a book with that very title in 1999). The Internet was going to put people in control, to enable buyers [...]]]></description>
			<content:encoded><![CDATA[<p>In the late 1990s and early 2000s, it was widely assumed by most tech writers and thinkers, myself included, that the Internet was a &#8220;Control Revolution&#8221; (to use the words of Andrew Shapiro, author of a book with that very title in 1999). The Internet was going to put people in control, to enable buyers to work directly with sellers, to cut out the middle man. Why? Because the Internet makes communication and commerce vastly more efficient, obviating the need for a middle man to connect us.</p>
<p>Fast forward to 2011, and the world is vastly more centralized than it ever was. Almost everyone&#8217;s most intimate conversations are held by four companies. And one company knows basically everything about everyone under 25.</p>
<p>How did we get so giddy about the Internet that we didn&#8217;t see this coming? We missed an important detail: communication and commerce became vastly more efficient for <em>everyone</em>, including the would-be middle-men, the would be mediators. The Internet enabled economies of scale never before imagined. So while it is possible to host your own email server, it&#8217;s a lot easier to use gmail. While it&#8217;s possible to host your own web page, post your updates to your blog, subscribe to your friends&#8217; RSS feeds hosted at different blogs, it&#8217;s a heck of a lot easier to use Facebook. The Internet put the 1990s middle-men out of business then enabled a new breed of data mediators that provide incredibly valuable services no individual user can dream of performing on their own: apply massively parallel facial recognition to billions of photos to find that one picture of you and your best friend&#8217;s grandmother, do deep graph analysis to find your long-lost friends and suggest you connect with them, learn how to filter spam messages so efficiently (thanks to training by billions of messages received on behalf of millions of users) that the spam wars are effectively over.</p>
<p>The Internet has been vastly more empowering to mediators than to individuals. And so we have, in fact, a Control Revolution of a very different nature: one company, namely Facebook, is effectively shaping the future of social interactions, what&#8217;s acceptable and what&#8217;s frowned upon, what&#8217;s private and what&#8217;s not.</p>
<p>I say this without any value judgment, purely as an observation. Facebook is making the rules, and when the rules change in Palo Alto, 550 million people follow.</p>
<h4>The Failure of Applied Modern Cryptography</h4>
<p>Cryptography in the 1980s was about secrecy, military codes, etc. I&#8217;m not talking about that.</p>
<p>Modern Cryptography is about individuals achieving a common goal without fully trusting one another. Think of a secret-bid auction. Or an election. Or two people discovering which friends they have in common without revealing the friends they don&#8217;t have in common. In all of these cases, people come together to accomplish a common result, but they cannot fully trust one another since their incentives are not perfectly aligned: I want to win the auction by bidding only one dollar more than you, Alice wants her candidate to beat yours, and Bob would like to find out which movie stars you&#8217;re friends with even though he knows none.</p>
<p>Modern cryptography teaches us how to accomplish these tasks <em>without ever trusting a third party</em>. That&#8217;s hard to imagine if you&#8217;re not steeped in the field. But that&#8217;s what modern cryptography does: take an interaction that is easily imaginable with the help of a trusted third party that deals with each individual, and replace the trusted third-party with a beautiful mathematical dance that achieves the same end-goal. No centralization of data in one big database, no trusted dealer/counter/connector, just individuals exchanging coded messages in a particular order and obtaining a trustworthy result. Cryptographers call this secure multi-party computation.</p>
<p>Modern Cryptography would, if properly implemented, give us all the functionality of Facebook without the aggregation of everyone&#8217;s data in a single data center. And we couldn&#8217;t be further from this world if we tried! We are headed for a world of increased data centralization and increased reliance on trusted third parties. Because they&#8217;re vastly more efficient, have economies of scale that allow them to provide features we didn&#8217;t dream of just a few years ago, and of course because the economic incentives of becoming that trusted third party are staggering.</p>
<p>As a privacy advocate, and again without value judgment, I can&#8217;t imagine a more surprising consequence of a technology that was meant to empower the little guy. It is, in a word, shocking.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2011/01/14/facebook-the-control-revolution-and-the-failure-of-applied-modern-cryptography/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Crisis in the Java Community&#8230; could they have used a secret-ballot election?</title>
		<link>http://benlog.com/articles/2010/12/09/crisis-in-the-java-community-could-they-have-used-a-secret-ballot-election/</link>
		<comments>http://benlog.com/articles/2010/12/09/crisis-in-the-java-community-could-they-have-used-a-secret-ballot-election/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 20:06:40 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[voting]]></category>

		<guid isPermaLink="false">http://benlog.com/?p=1472</guid>
		<description><![CDATA[There is a bit of a crisis in the Java community: the Apache Foundation just resigned its seat on the Java Executive Committee, as did two individual members, Doug Lea and Tim Peierls. From what I understand, the central issue appears to be that Oracle, the new Java &#8220;owner&#8221; since they acquired Sun Microsystems, is [...]]]></description>
			<content:encoded><![CDATA[<p>There is a bit of a crisis in the Java community: <a href="https://blogs.apache.org/foundation/entry/the_asf_resigns_from_the">the Apache Foundation just resigned its seat on the Java Executive Committee</a>, as did two individual members, <a href="http://gee.cs.oswego.edu/dl/html/jcp22oct10.html">Doug Lea</a> and <a href="http://tembrel.blogspot.com/2010/12/resigned-from-ec.html">Tim Peierls</a>. From what I understand, the central issue appears to be that Oracle, the new Java &#8220;owner&#8221; since they acquired Sun Microsystems, is paying lip service to the Java Community while taking the language and, more importantly, its licensing, into the direction they prefer, which doesn&#8217;t appear to be very open-source friendly.</p>
<p>That said, I&#8217;m not a Java Community expert, so I won&#8217;t comment much more on this conflict, other than to say, wait a minute, what&#8217;s this from Tim Peierls&#8217;s resignation note?</p>
<blockquote><p>
Several of the other EC members expressed their own disappointment while voting Yes. I&#8217;m reasonably certain that the bulk of the Yes votes were due to contractual obligations rather than strongly-held principles.
</p></blockquote>
<p>Wait a minute, the Executive Committee votes by public ballot? They&#8217;re influenced by contractual obligations? That&#8217;s fascinating, and that&#8217;s hardly democratic! It means that, even where standards bodies are concerned, the secret ballot might be a very interesting tool.</p>
<p>There are arguments against the secret ballot in this case, of course: maybe the Executive Committee members are representative of the Java Community, and as such they should serve their constituents? Much like legislators, their votes should be public so the community can decide whether or not to reelect them? In that case, contractual obligations to vote a certain way should be strictly disallowed or required to be published along with the vote&#8230; To whom are these Executive Committee members accountable? To themselves as well-intentioned guides of the Java community? To the people who elected them? It&#8217;s difficult to have it both ways, since one requires a secret ballot, and the other a public ballot.</p>
<p>Maybe the right solution is to publish all comments, but keep the ballots secret? There&#8217;s always a chance that a truly hypocritical member would consistently vote differently than their publicly stated opinions, but I&#8217;m not sure that risk is worse than the problems the Java Community just faced with what appears to be anything but a democratic vote. In a tough spot like this one, it seems to me that Executive Committee members should be able to vote their conscience without fear of retribution.</p>
<p>(Oh, and if the Java community is looking for a secure voting system, I might have a <a href="http://heliosvoting.org">suggestion</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2010/12/09/crisis-in-the-java-community-could-they-have-used-a-secret-ballot-election/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>keep your hands off my session cookies</title>
		<link>http://benlog.com/articles/2010/10/25/keep-your-hands-off-my-session-cookies/</link>
		<comments>http://benlog.com/articles/2010/10/25/keep-your-hands-off-my-session-cookies/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 22:05:40 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://benlog.com/?p=1401</guid>
		<description><![CDATA[For years, security folks &#8212; myself included &#8212; have warned about the risk of personalized web sites such as Google, Facebook, Twitter, etc. being served over plain HTTP, as opposed to the more secure HTTPS, especially given the proliferation of open wifi networks. But warnings from security freaks rarely get people&#8217;s attention. A demonstration is [...]]]></description>
			<content:encoded><![CDATA[<p>For years, security folks &#8212; myself included &#8212; have warned about the risk of personalized web sites such as Google, Facebook, Twitter, etc. being served over plain HTTP, as opposed to the more secure HTTPS, especially given the proliferation of open wifi networks. But warnings from security freaks rarely get people&#8217;s attention. A demonstration is worth a lot more, and that&#8217;s exactly what Eric Butler did with <a href="http://codebutler.com/firesheep">FireSheep</a>, a Firefox plugin that lets you instantly see who on your local network is surfing well-known sites, grab their unencrypted cookie, and &#8220;become&#8221; them on the given site. Nice work Eric!</p>
<p>(I must also point out Ben Laurie&#8217;s <a href="http://www.links.org/?p=1019">post on this topic</a> and his always-hilarious take, &#8220;these are not the credentials you&#8217;re looking for!&#8221;)</p>
<p>Some folks are wondering if this will be a watershed event where major sites will suddenly shift to serving everything over SSL. I don&#8217;t think so. The performance implications of serving everything, including static content, over SSL, are staggering. While working on my secure voting system <a href="http://heliosvoting.org">Helios</a>, I noticed that I could easily serve a static image over HTTP about 1500 times per second on a medium-sized server. Add SSL to that, and squeezing out more than 50 images per second becomes a significant challenge. Now, I&#8217;m sure there are folks who can tweak SSL far better than I, but it&#8217;s still going to be a significant amount of overhead, not to mention that caching content over SSL typically doesn&#8217;t happen, which means every graphic, every JavaScript file, is reloaded every time the user navigates to a new page. At the end of the day, a web site served over SSL is a significant amount of extra server-side overhead and, even if you do it right, it just won&#8217;t be as snappy in the browser. Users will complain, and that makes SSL-everywhere very unlikely. I would be happy to be proven wrong, but I just don&#8217;t think SSL everywhere is happening anytime soon.</p>
<p>What sucks is that there is no in-between. It would be nice if a web page could mix and match SSL and non-SSL components, so that images and JavaScript could be loaded without the overhead of SSL. Of course, that&#8217;s not nearly as secure, but it would defend against a passive attacker like FireSheep. Active attackers would still be able to cause damage, but then again active attackers are quite a bit harder to achieve and to defend against, so maybe an in-between defense is good enough. Unfortunately, if you try to mix and match secure and insecure resources, you get some nasty warnings / broken locks on most browsers. For good reason, too, since the browsers are defending against active attackers, but still, too bad there&#8217;s no usable way to achieve in-between security.</p>
<p>It would also be nice if web developers could easily use a more secure approach to authentication, one that doesn&#8217;t simply send over a cookie. Something like HTTP Digest Auth, only of course *not* Digest Auth itself since that doesn&#8217;t fit in nicely with the way web sites like to manage their users&#8217; sessions (timeouts, explicit logout, &#8230;) </p>
<h4>SessionLock Lite</h4>
<p>A couple of years ago, I proposed an in-between solution called SessionLock [<a href="http://www2008.org/papers/pdf/p517-adida.pdf">PDF</a>]. This approach uses a combination of JavaScript and message-passing via the URL fragment identifier to cause every link, every AJAX request, etc. to be signed. Think of this as a more powerful version of HTTP Digest Auth that allows web sites to fully control login/logout procedures. The <em>content</em> of the web sites you visit with SessionLock is not protected. If you look at what your friends are doing on Facebook, someone with FireSheep might be able to see that, too. But, crucially, they wouldn&#8217;t be able to post new status updates, add friends, view data you haven&#8217;t viewed yourself during that session, etc. Is that good enough? I&#8217;m not sure, but I do think it provides a much more intuitive level of protection: when you&#8217;re on a public wifi network, you should always assume someone is casually looking over your shoulder. But you shouldn&#8217;t have to worry that they&#8217;re completely taking over your keyboard (I mean, that&#8217;s just rude!)</p>
<p>Shockingly enough, SessionLock has not caught on, and I often cry myself to sleep at night wondering why&#8230; Maybe it was too complicated? So, for those web sites thinking about what to do to respond to FireSheep, I propose SessionLock Lite. It requires a modern browser, IE8+, FF3+, Safari 4+, or Chrome, and it doesn&#8217;t fully protect against FireSheep, but it makes FireSheep&#8217;s stolen sessions valid only for a very short period of time (a few seconds). Could this be a reasonable compromise?</p>
<p>The idea is this:</p>
<ul>
<li> the web site, say facebook.com, logs you in over SSL the way it currently does, and sets a <em>secure session cookie</em> that is only transmitted over SSL.</li>
<li> when the site redirects you to the plain HTTP site, the way it currently does, the plain HTTP site opens up an invisible IFRAME onto the SSL-protected version of the site.</li>
<li> the SSL IFRAME computes, every few seconds, a new token that is timestamped so it is valid for only a few seconds. This is likely done using HMAC and the secure cookie as the key. HMAC can be computed in JavaScript in a few milliseconds.</li>
<li> the new token is communicated to the containing HTTP frame using <tt>postMessage()</tt>, which is the main reason you need a modern browser.</li>
<li> the containing HTTP frame then uses this token as its unencrypted cookie.</li>
</ul>
<p>Effectively, the SSL channel is used to refresh the session cookie very rapidly, all locally in the browser, without making SSL requests to the server other than the initial request to a very small file when the page loads. This is particularly optimized for AJAX-heavy sites like Facebook and Twitter, where the SSL IFRAME will live on for minutes or hours. While you&#8217;re using the site, someone on FireSheep can use it, too. But the moment you stop using it, they can no longer use it either.</p>
<p>This is not anywhere near a complete solution, but it&#8217;s a very cheap solution that costs almost nothing performance-wise, requires changing very little code, and certainly reduces the damage FireSheep-wielding attackers can cause.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2010/10/25/keep-your-hands-off-my-session-cookies/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Facebook can and should do more to proactively protect users</title>
		<link>http://benlog.com/articles/2010/10/22/facebook-can-and-should-do-more-to-proactively-protect-users/</link>
		<comments>http://benlog.com/articles/2010/10/22/facebook-can-and-should-do-more-to-proactively-protect-users/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 06:14:24 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://benlog.com/?p=1378</guid>
		<description><![CDATA[A few days ago, the Wall Street Journal revealed that Facebook apps were leaking user information to ad networks. Today, Facebook proposed a scheme to address this issue. This is good news, but I&#8217;m concerned that Facebook&#8217;s proposal doesn&#8217;t address the underlying issue fully. Facebook could be doing a lot more to protect its users, [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago, the Wall Street Journal <a href="http://online.wsj.com/article/SB10001424052702304772804575558484075236968.html">revealed that Facebook apps were leaking user information to ad networks</a>. Today, Facebook proposed <a href="http://developers.facebook.com/docs/authentication/canvas/encryption_proposal">a scheme to address this issue</a>. This is good news, but I&#8217;m concerned that Facebook&#8217;s proposal doesn&#8217;t address the underlying issue fully. Facebook could be doing a lot more to protect its users, even without giving up on their highly-targeted advertising business model.</p>
<h4>what, exactly, is going on</h4>
<p>First, let&#8217;s spend one minute describing the problem, because the WSJ&#8217;s description was somewhat inaccurate. Harlan Yu at Freedom To Tinker does <a href="http://www.freedom-to-tinker.com/blog/harlanyu/facebook-apps-leaking-user-identities">a good job describing the situation</a>: Facebook loads some apps in IFRAMEs, which means they embed the web page of the app within their own. The user ID is included in the URL of the IFRAME, so that the app might know who is actually using them. The app might then include another IFRAME with ads, or some JavaScript from an ad network. When your browser fetches that ad IFRAME or JavaScript, it includes, in its request, the URL of the page that referred the browser to the ad network. In this case, it&#8217;s the app&#8217;s URL, which unfortunately includes the user&#8217;s Facebook User ID, which reveals all of the user&#8217;s public information, including their name and possibly more.</p>
<p>So, to be fair to Facebook and the apps: they probably didn&#8217;t do this on purpose. The WSJ&#8217;s specific wording, &#8220;transmitting&#8221;, is misleading, because it assigns intent where there probably wasn&#8217;t. That said, I don&#8217;t think Facebook is off the hook: when you run a 500M user platform, it&#8217;s your responsibility to protect your users&#8217; privacy before the story breaks. To their credit, Facebook is taking this seriously and is proposing a way to remedy this problem that is not cheap for them, as it requires changing the way that they interface with applications.</p>
<h4>encrypting the user ID</h4>
<p>Facebook is proposing <a href="http://developers.facebook.com/docs/authentication/canvas/encryption_proposal">encrypting the user ID before adding it to the app URL</a>. The app&#8217;s backend server then must decrypt the user ID before it can use it to retrieve more information. That way, if that encrypted user ID is leaked, the ad network won&#8217;t be able to make sense of it. Interestingly, the encryption changes every time an app is launched, so the ad network won&#8217;t even be able to correlate two visits by the same user (unless they set a cookie, of course, so maybe that&#8217;s not a very strong defense.)</p>
<p>Now, a couple of points in this proposal worry me, because they might indicate that no trained cryptographer reviewed the proposal (Chris Shogoian asks this very question <a href="http://twitter.com/csoghoian/status/28057853358">on twitter</a>). First, the same key is used for HMAC signing and AES encryption. That&#8217;s bad practice, because AES and HMAC have been analyzed <em>in isolation</em>, not when both are used with the same key. It&#8217;s not that there&#8217;s an obvious attack, but it&#8217;s sloppy because it uses AES and HMAC without following the strict specifications under which we have strong evidence that they are secure. Second, AES-256 is used with a key that is effectively a 128-bit key expanded to 256 bits by hexadecimal encoding. That&#8217;s just ugly. Oh of course it&#8217;s because apps already have a hex-encoded 128-bit key, so it&#8217;s easier that way, but again, AES-256 has not been strictly analyzed for security in the case of a key with only 128 significant bits. Crypto algorithms are not magic black boxes you can use any way you please. It&#8217;s best to use them as prescribed. So that&#8217;s a bit concerning mostly because of what it implies: this proposal has not been seriously reviewed by a cryptographer.</p>
<p>But there&#8217;s something else that bugs me.</p>
<h4>hiding the user ID from apps altogether</h4>
<p>Clearly, Facebook is only addressing the threat of accidental data breach. A malicious app could easily decrypt the user ID and communicate it to the ad network if it wants to. Of course, that violates the Facebook terms of use, but as we&#8217;ve seen already, who&#8217;s going to check? The same privacy expert who missed this problem in the first place?</p>
<p>As long as Facebook is redesigning its API for privacy reasons, why not consider a more complete threat model? Two companies, each with their popular Facebook app, might connect their databases and correlate what users are doing on both sites, thereby learning more about the user than he/she may realize. Encrypting the user ID prevents accidental leakage, but in the end the apps are able to decrypt the package and store the one and only official facebook user ID for each user. Leaking the real user ID, accidentally or because of evil intentions, remains eminently possible.</p>
<p>Instead, Facebook should provide a different user ID <em>alias</em> to each app. The app never receives the real unique ID for each user, only the app-specific alias that cannot be correlated against a different app-specific alias for that same user using a different app. Then, the app can make API calls into Facebook using this alias, and the alias, if leaked, is useless to any other party, since it is only meaningful as part of API calls signed by the original app.</p>
<p>Aliasing of user IDs is not new: OpenID uses it to provide different identifiers to different sites where you log in, and in the specific case of Facebook this aliasing idea was described two years ago by <a href="http://www.cs.berkeley.edu/~afelt/">Adrienne Porter Felt</a>. Now, that alias may be obtained by encryption, but in any case the decryption key is <em>not</em> available to the app. To the app, the alias is the only user ID available.</p>
<h4>proactively protecting users</h4>
<p>With their reach and impact, it&#8217;s just not good enough for Facebook to blame the browsers or the state of the Web for privacy leaks. There is much they can do to ensure that, even if apps screw up or even turn a little evil, the platform is proactively protecting users from potential privacy leaks. Sure, the WSJ article wasn&#8217;t fair in its wording. But users are entrusting Facebook with incredible amounts of data. Facebook can and should do a lot more to stay ahead of potential privacy leaks on their watch.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2010/10/22/facebook-can-and-should-do-more-to-proactively-protect-users/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>For deniability, faking data even the owner can&#8217;t prove is fake</title>
		<link>http://benlog.com/articles/2010/02/26/for-deniability-faking-data-even-the-owner-cant-prove-is-fake/</link>
		<comments>http://benlog.com/articles/2010/02/26/for-deniability-faking-data-even-the-owner-cant-prove-is-fake/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 22:29:30 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[voting]]></category>

		<guid isPermaLink="false">http://benlog.com/?p=1100</guid>
		<description><![CDATA[I was speaking with a colleague yesterday about Loopt, the location-based social network, the rise of location-based services and the incredible privacy challenges they present. I heard the Loopt folks give a talk a few months ago, and I was generally impressed with the measures they&#8217;re taking to protect their users&#8217; data. I particularly enjoyed [...]]]></description>
			<content:encoded><![CDATA[<p>I was speaking with a colleague yesterday about Loopt, the location-based social network, the rise of location-based services and the incredible privacy challenges they present. I heard the Loopt folks <a href="http://benlog.com/articles/2009/09/13/a-partial-report-from-social-network-security-2009-stanford/">give a talk a few months ago</a>, and I was generally impressed with the measures they&#8217;re taking to protect their users&#8217; data.</p>
<p>I particularly enjoyed the problem Loopt faced with respect to abusive spouses: if your spouse is spying on you, it&#8217;s not enough to turn off your location services, because then your abusive spouse will know that you&#8217;re hiding something. You have to actually be able to <em><b>lie</b></em> about your location, in other words Loopt has to let you fake your location data. And they do. And that&#8217;s awesome.</p>
<p>It&#8217;s just like voting: to be free to vote the way you want to vote, you have to be able to claim that you voted a certain way, even if you voted another way, and that claim has to be believable. In fact, when you think about it, because Loopt offers this &#8220;fake my data&#8221; feature, there&#8217;s no way for you to <b>prove</b> to someone else that you really are where you claim to be, at least not via Loopt. Because, if there were a way to say &#8220;okay, really, I&#8217;m here, no faking this time,&#8221; then there would be no deniability since abusive spouses could simply ask for the extra-no-faking version of the location.</p>
<p>In other words, to truly achieve deniability, you have to take away the user&#8217;s ability to certify their own data. That&#8217;s not obvious, and it&#8217;s interesting that location-based services and voting have this point in common.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2010/02/26/for-deniability-faking-data-even-the-owner-cant-prove-is-fake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

