<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Setec Astronomy</title>
    <description>Random rants on politics and discussions on tech.
</description>
    <link>https://blog.setec.io/</link>
    <atom:link href="https://blog.setec.io/feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Sun, 07 Feb 2016 17:54:06 -0500</pubDate>
    <lastBuildDate>Sun, 07 Feb 2016 17:54:06 -0500</lastBuildDate>
    <generator>Jekyll v2.4.0</generator>
    
      <item>
        <title>Writing Software That Can Kill</title>
        <description>&lt;p&gt;Over the last few articles, we&amp;#39;ve discussed whether software engineers have ethical responsibilities over the code that they write.  We&amp;#39;ve talked about how badly written code can lead to harm, how failures &amp;mdash; even lethal ones &amp;mdash; don&amp;#39;t necessarily lead us to write better software.&lt;/p&gt;

&lt;p&gt;Let&amp;#39;s say, for the moment, that you believe that we do have a moral obligation to the public around the software that we build.  I want to discuss a particularly sticky question: should we build software that could kill people?&lt;/p&gt;

&lt;h2&gt;Narrowing the Scope&lt;/h2&gt;

&lt;p&gt;It&amp;#39;s important to be precise in definitions, here, since there are several &lt;em&gt;kinds&lt;/em&gt; of software that can be very dangerous, but that don&amp;#39;t have the same moral question mark.&lt;/p&gt;

&lt;p&gt;First, and most obvious, is software that powers systems directly affecting human life.  Software that runs power plants, powers pacemakers, keeps the electrical grid humming, and lets planes fly on autopilot.  More generically, this is software which can cause life-threatening harm to people if it functions improperly, but should not cause harm when working correctly. (The term of art here is &amp;quot;life-safety critical software&amp;quot;.)&lt;/p&gt;

&lt;p&gt;The next category of lethal software is software whose purpose requires life-threatening harm, but can be more or less harmful depending on its proper function.  Here, we put a lot of software in the defense world; a properly functioning missile guidance system will certainly be lethal, but an improperly functioning one can be far more so.&lt;/p&gt;

&lt;p&gt;The third category is software cannot be directly harmful, either in normal or abnormal behavior, but can indirectly cause life-threatening effects.  Most of the software in the world falls into this category; as previously discussed, even something as innocuous as a hookup app can be lethal if put into the wrong hands without proper precautions in place.  Banking software, for example, can&amp;#39;t directly injure someone, but an abnormally functioning one can certainly cause harm indirectly &amp;mdash; even harm on a global scale.&lt;/p&gt;

&lt;p&gt;The last category is the one I want to discuss further: software which is not intrinsically intended to do harm, like some military software, yet can directly result in harm even when working correctly.  This is software for which the risks and the proper function are inexorably combined with no ability to separate them.  This is the area where much of the controversy both in and outside of the software community lies.&lt;/p&gt;

&lt;h2&gt;The Dangers of Secrecy&lt;/h2&gt;

&lt;p&gt;The most commonly discussed software with these properties is encryption.  If well-implemented and well-designed, it can resist even powerful adversaries attempts to intercept communications.  It has been a well-respected tool used since ancient times, with pen-and-paper ciphers being used for millennia.  But this story can be told from two perspectives, both equally correct.&lt;/p&gt;

&lt;p&gt;Encryption can save lives.  Tor, one of the most famous anonymization tools used in modern times, has been used by members of the media to deliver news into areas where information is heavily censored and controlled, by law enforcement to protect undercover officers from detection, by human rights activists to report on torture and other abuses, by whistleblowers both famous and infamous, and by the military to help field agents and intelligence assets whose lives are at stake. &lt;a href=&quot;https://www.torproject.org/about/torusers.html.en&quot;&gt;[1]&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The same story can be told from a very different perspective, however.  Encryption can be used to protect pedophiles distributing child pornography, as a tool to help hide bot-net command-and-control traffic, and a way for terrorists to coordinate attacks against innocent people.  It can be used to help criminals escape prosecution, and it can be used by governments to hide abuses and human rights violations.  It can be used to distribute information on topics ranging from bomb-making to hate-speech, from money laundering to getting away with murder.&lt;/p&gt;

&lt;p&gt;Encryption can help save lives, and encryption can help end them.&lt;/p&gt;

&lt;h2&gt;Security Through Surveillance&lt;/h2&gt;

&lt;p&gt;Encryption is not the only technology that presents this kind of duality.  Surveillance software, too, can cut in both directions.  Software that monitors internet connections can help prevent the spread of malware, reduce the likelihood of corporate espionage, and protect countless people&amp;#39;s personal information from being leaked by a careless or malicious employee.&lt;/p&gt;

&lt;p&gt;On the other hand, it can also be used as a tool to hunt down whistleblowers, silence protesters, choke off dissent, and intercept people&amp;#39;s most personal conversations and information.&lt;/p&gt;

&lt;p&gt;Used for either of these purposes, it is working &lt;em&gt;as designed&lt;/em&gt;.  It would be neigh-impossible to design a system such that it could both block pornography and report on such and yet could not be able to block and report on people visiting political websites.  Like a firearm, it is as much about who uses it as how it works.&lt;/p&gt;

&lt;h2&gt;Deciding to Build&lt;/h2&gt;

&lt;p&gt;How should we, as software engineers, weigh these potential costs in our mind?  Should we simply forgo the potential civic benefits these kind of software can have because of the potential for use by bad actors?  If not, how can we look ourselves in the mirror when these tools are inevitably used for evil?&lt;/p&gt;

&lt;p&gt;Each circumstance is different, but the following set of questions have been useful to me when I&amp;#39;ve struggled with weighing these questions in the past.&lt;/p&gt;

&lt;h3&gt;Who is meant to use the software?&lt;/h3&gt;

&lt;p&gt;Software which is intended for use by the general public has stronger moral character than those intended for use by a limited set of people, such as corporations, IT departments, or governments.  Software can change the balance of power that already exists; centralizing power in the hands of the few can be dangerous.  Here we would weigh software like PGP, designed to work in a decentralized fashion between individuals, as more moral than software like S/MIME, where power is centralized in the few.  (S/MIME where certificates and keys are generated by a third party, fails this test even more significantly.)&lt;/p&gt;

&lt;h3&gt;How substantial are the resources required to run the software?&lt;/h3&gt;

&lt;p&gt;Software which requires few resources has better moral character than software which requires many.  If the software requires substantial computing resources, it will likely end up centralizing in the hands of the few, even if there is no de jure requirement for it.  Here, though, resources can be non-physical as well; if the software requires network access that is not easily obtained to usefully function, such as the ability to observe all traffic on a link, or be distributed across many points of presence, its moral character is weakened.&lt;/p&gt;

&lt;h3&gt;Does the software have more than one category of users?&lt;/h3&gt;

&lt;p&gt;In general, software that has mixed categories of users require more scrutiny than those which only have one.  An example, here, would be a software that has &amp;quot;administrators&amp;quot; and &amp;quot;users&amp;quot;, or &amp;quot;customers&amp;quot; and &amp;quot;end-users&amp;quot;.  It is especially concerning if one group of users is given privileged access over others.&lt;/p&gt;

&lt;p&gt;As an example, an IDS system which monitors for malware communications and reports infections to an administrator would be considered to have two groups of users -- the IDS administrators, and the end-users who it monitors.  This would be judged less moral than a local installation of a malware detection system which monitored and reported to the same person.&lt;/p&gt;

&lt;h3&gt;Do you, the developer, have a direct financial interest in the software?&lt;/h3&gt;

&lt;p&gt;Software which you, the developer, have a direct financial interest in (whether you are being paid to write it, or are selling it yourself), is less moral than software you have only an indirect, or no, financial interest in.&lt;/p&gt;

&lt;p&gt;This is probably one of the most difficult rules to weigh, and on its surface can be paradoxical.  Why should I hold software that I write for work to a higher moral standard than software I write for free?  Code is code, whether I&amp;#39;m paid for it or not.  All else being equal, what does it matter if I get paid?&lt;/p&gt;

&lt;p&gt;It is a fact of life that those who are responsible for paying our salaries have a measure of control over us.  Whether explicitly (&amp;quot;I order you to...&amp;quot;) or implicitly (&amp;quot;It&amp;#39;s important to the team that...&amp;quot;), this pressure can induce us to weaken our resolve.  We can even do this to ourselves; I, certainly, have done things I wasn&amp;#39;t happy about knowing that my employers would want it done, without them applying any coercion of any form.  Even the self-employed are not exempt from this psychological pressure; the potential for money is a very tempting one in itself.&lt;/p&gt;

&lt;p&gt;This metric is meant to provide push back against those pressures, both internal and external.  The red flags raised in other questions should be considered more severely whenever you are in a context where your personal interests are directly involved.&lt;/p&gt;

&lt;h2&gt;Working An Example&lt;/h2&gt;

&lt;p&gt;For our first example, let&amp;#39;s use Tor.  While it&amp;#39;s a generally respected tool, it has had its controversies; the owner of Freedom Hosting, at the time the largest web host designed for use with Tor, was arrested and called him &amp;quot;the largest facilitator of child porn on the planet.&amp;quot;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Who is meant to use Tor?&lt;/p&gt;

&lt;p&gt;Tor is designed for use by the general public.  Though companies are free to use the Tor network, it is designed to resist any one person from gaining too much control over the network as a whole.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How substantial are the resources required to use Tor?&lt;/p&gt;

&lt;p&gt;Tor requires no substantial or privileged resources to gain the secrecy it controls.  Though it does depend on having a number of high-bandwidth connections to the internet along its backbone, the network can be built from an aggregation of common high-bandwidth contributors.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Does Tor have multiple categories of users?&lt;/p&gt;

&lt;p&gt;Yes, Tor does have different categories of users.  However, no group is in a privileged position over any other group.  (A malicious exit node can intercept unencrypted traffic exiting the Tor network, but this is not particularly a more privileged position as far as Tor itself is concerned.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Does anyone have a direct financial interest in the software?&lt;/p&gt;

&lt;p&gt;Tor is shepherded by the Tor Project, a 501(c)(3) corporation that relies on grants and donations from the general public.  Though they have employees, there is a substantial volunteer base who would be in a good position to detect any malicious behavior.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Getting Advice&lt;/h2&gt;

&lt;p&gt;Struggling with these sort of questions in isolation can be difficult, if not outright draining.  One of the things I&amp;#39;ve found very helpful is talking them out with other people who understand the issues at hand.  Whether it is co-workers, friends, or an advocacy organization like the ACLU or EFF, you should talk to someone if you are weighing a problem like this.  If you have no one else to talk it over with, I&amp;#39;m more than happy to be a sounding board.&lt;/p&gt;

&lt;p&gt;Asking these questions can be difficult, but I have no doubt that you, and the world, will be the better for the asking.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://news.ycombinator.com/item?id=11055317&quot;&gt;Discuss this post on Hacker News&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Thu, 07 Jan 2016 00:00:00 -0500</pubDate>
        <link>https://blog.setec.io/articles/2016/01/07/software-kill.html</link>
        <guid isPermaLink="true">https://blog.setec.io/articles/2016/01/07/software-kill.html</guid>
        
        
        <category>articles</category>
        
      </item>
    
      <item>
        <title>The Price of Progress</title>
        <description>&lt;p&gt;After &lt;a href=&quot;https://blog.setec.io/2015/11/01/ethics.html&quot;&gt;my last article&lt;/a&gt;, I had a lot of interesting conversations with different people on whether software development is a form of engineering, as well fascinating conversations on ethics in general.  Not long after my last post, in fact, The Atlantic did an interesting piece covering some of the same material called &lt;a href=&quot;http://www.theatlantic.com/technology/archive/2015/11/programmers-should-not-call-themselves-engineers/414271/&quot;&gt;Why Computer Programmers Should Stop Calling Themselves Engineers&lt;/a&gt; (I have no delusions that their article is whatsoever related to mine; the timing is coincidental.)  The general comments on the article boiled down into a couple of broad categories:&lt;/p&gt;

&lt;h3&gt;The &lt;s&gt;Goggles&lt;/s&gt;^W Codes; They Do Nothing!&lt;/h3&gt;

&lt;p&gt;One of the most common critiques that I read was that engineers shouldn&amp;#39;t have a code of conduct because they don&amp;#39;t work.  Several people commented that, considering the lack of licensing (and thus the low barrier to entry), as well as the low current penetration of people who would commit themelves to a code of conduct, they would only punish those who would subscribe to them.  Just like vaccines, codes of ethics only work when enough people are willing to commit themselves to it; before then, those who do can simply be dismissed and replaced with minimal disruption.&lt;/p&gt;

&lt;p&gt;That&amp;#39;s very true.  Practically, I think these sorts of refusal would only convince some (maybe even small) set of those pushing for unethical action.  As is commonly said in the physical security world, &amp;quot;locks are on doors only to keep honest people honest.&amp;quot;  I think there is a broader philosophical question about whether or not one should continue to refuse to engage in unethical behavior even when believing that doing so is futile&amp;mdash; but that&amp;#39;s a subject for someone better educated than I to speak on.&lt;/p&gt;

&lt;h3&gt;Programming Isn&amp;#39;t Ready&lt;/h3&gt;

&lt;p&gt;Another one of the common critiques that I heard was that software is too new or underdeveloped of a field to put these kind of standards on yet.  Other forms of engineering work on very well-studied principles with hundreds or thousands of years of study and discipline, but software is a relatively new phenomenon, with radical changes in our understandings and the state-of-art coming on the span of years, rather than decades or even centuries.  The oldest buildings still standing are 4000 years old, while the oldest software application still running is, at most, 60 years old. (In all likelihood, this number is conservative, and the oldest extant software is closer to 50, or even 40 years old.)  Some also argued that the class of problems are different; physical construction has well-defined and understood limitations, with changes after construction has started being relatively expensive to do.  Software, on the other hand, is rapidly iterated on in a very different manner, and the flexibility creates far more potential for ill-defined specifications and mistakes in implementation.&lt;/p&gt;

&lt;p&gt;Again, true.  It&amp;#39;s certainly not in dispute by anyone that software engineering is a newer field than engineering for other disciplines; even those who would argue that &amp;quot;modern&amp;quot; engineering is relatively recent in terms of the span of history certainly wouldn&amp;#39;t argue that it&amp;#39;s &lt;em&gt;as new&lt;/em&gt;.  Still, this seems to me to be a relatively uninteresting argument; just because something is new, does that mean we should not strive for better?&lt;/p&gt;

&lt;p&gt;A good friend of mine, Michael Stone, provided what I believe to be &lt;a href=&quot;http://mstone.info/posts/irrefutability/&quot;&gt;a more compelling variant of this argument&lt;/a&gt;.  With apologies in advance to him for any misstatements of his eloquent point:  Software failures, unlike failures in other disciplines firmly defined as &amp;quot;engineering&amp;quot;, aren&amp;#39;t generalizable.  Unlike in engineering, where failures can often be traced back to a more general category of problem, software system failures don&amp;#39;t share the same kind of fundamental design failure.  At most, the community is able to point to certain kinds of failures which are common &amp;mdash; off-by-one errors, buffer overflows, etc. &amp;mdash; but we don&amp;#39;t respond in the same way.&lt;/p&gt;

&lt;p&gt;Take the case of the Tacoma Narrows bridge collapse as an example.  After the Tacoma Bridge collapsed because of aeroelastic flutter, the state of the art regarding bridge design was fundamentally changed.  One of the authors of the report from the Federal Works Agency Commission that investigated the collapse is telling enough that I think it bears reproducing here wholesale:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Tacoma Narrows bridge failure has given us invaluable information...It has shown [that] every new structure [that] projects into new fields of magnitude involves new problems for the solution of which neither theory nor practical experience furnish an adequate guide. It is then that we must rely largely on judgment and if, as a result, errors, or failures occur, we must accept them as a price for human progress.&lt;/p&gt;

&lt;p&gt;&amp;mdash; &lt;cite&gt;&lt;a href=&quot;http://resolver.caltech.edu/CaltechAUTHORS:20140512-105559175&quot;&gt;Othmar Ammann, The Failure of the Tacoma Narrows Bridge&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I can find no examples of bridge collapse attributed to aerodynamic failure after Tacoma Narrows.  Action was taken to reinforce similar bridges shortly after the collapse, and aerodynamic flutter is considered in structural engineering of everything from buildings to airplanes today.&lt;/p&gt;

&lt;p&gt;As famous as the Taacoma Narrows collapse is in structural engineering, we can find a counterpart in software failure: the case of the Therac-25.  The causes of Therac-25 are interesting enough reading that I suggest reading Professor Nancy Leveson&amp;#39;s report &lt;a href=&quot;http://www.cs.umd.edu/class/spring2003/cmsc838p/Misc/therac.pdf&quot;&gt;in full&lt;/a&gt;, but the fundamental failure was a race condition (with many exacerbating factors).  Therac-25 killed three people and injured three more, while the Tacoma Narrows failure killed no people, and only a single dog.&lt;/p&gt;

&lt;p&gt;Unlike in Tacoma Narrows, however, Therac-25 did nothing to fundamentally change the state of the art in software programming.  Race conditions, certainly, are a known problem -- in some cases, one that programming languages, techniques, and frameworks strive to solve.  Even still, race conditions failures in software programs are still so common that I need not reach past personal knowledge to find examples.  Paying the &amp;quot;price for human progress&amp;quot; doesn&amp;#39;t seem to substantially advance the state of the art in computer programming.  The same class of errors that caused Therac-25 to become lethal in 1987 led to the Northeast Blackout of 2003, affecting over 55 million people and leading to several deaths.  There are countless more examples of financial losses and physical harm that can be attributed to race conditions, yet we still write programs vulnerable to these sets of programs today.&lt;/p&gt;

&lt;h3&gt;Blame is the Enemy of Safety&lt;/h3&gt;

&lt;p&gt;Whether we have codes of conduct or not, whether software programming is an engineering discipline or something else entirely, it seems to me that there are few who would seriously argue that the current state of the programming world is perfect and that we have nothing to improve.  As Professor Leveson would, no doubt, remind us: blame is the enemy of safety.  If we, as an industry and a profession, want to build safer, more reliable systems, we must give up the idea that we can prevent accidents if we only sacrifice enough people who write bad software on the altar of &amp;quot;reasons for outage&amp;quot; and &amp;quot;post-mortem analysis&amp;quot;.  I cannot recommend reading &lt;a href=&quot;https://mitpress.mit.edu/index.php?q=books/engineering-safer-world&quot;&gt;&amp;quot;Engineering a Safer World&amp;quot; by Nancy Leveson&lt;/a&gt; enough.&lt;/p&gt;

&lt;p&gt;If we are not engineers, then perhaps we are craftspeople; if so, I hope we can become proud of our craft and treat it with the respect and care that it deserves.&lt;/p&gt;
</description>
        <pubDate>Sun, 15 Nov 2015 00:00:00 -0500</pubDate>
        <link>https://blog.setec.io/2015/11/15/blame.html</link>
        <guid isPermaLink="true">https://blog.setec.io/2015/11/15/blame.html</guid>
        
        
      </item>
    
      <item>
        <title>Executing Software Engineers for Bugs</title>
        <description>&lt;p&gt;There is an apocryphal tale I&amp;#39;ve heard many times about how, in Ancient Rome (or, in some tellings, Greece), the engineers responsible for the construction of an arch were required to stand underneath it as the final wooden supports were taken out.  In some version of the story, not only was the engineer required to stand underneath it, but so was the engineer&amp;#39;s family.  In the case of the Veresk bridge in Iran, some believe that the Shah forced the chief engineer to stand under the bridge with his family as the first train went over it.  Whether any of these instances actually happened or not, the stories tell us something about the cultural perspective of the obligations that engineers have to society as a whole.&lt;/p&gt;

&lt;p&gt;In 1920s, after the Quebec Bridge disasters, a professor at the University of Toronto convinced the Engineering Institute of Canada to come up with a ceremony and a code of ethics that all its graduating engineers would be required to undergo.  This ceremony became the Ritual of the Calling of an Engineer.  This ritual is similar to a much more ancient tradition of the Hippocratic Oath undertaken by physicians which states their obligations to those under their care above and beyond their obligations to anyone else.  It seems clear, at least to me, that there is a cultural understanding of the obligations of civil engineers and architects to the general public.  Take the case of the Sampoong Department Store Collapse in 1995, the most lethal building collapse since the collapse of the Circus Maximus in 140 CE.  In this instance, not one but two different construction firms refused to complete work that they believed to be unsafe and resigned -- or were fired -- after they did so.  Five years after the building opened to the general public, it collapsed, killing more than 500 people.&lt;/p&gt;

&lt;p&gt;All of the major professional engineering societies have codes of ethics that they require their members to obey which include statements of engineer&amp;#39;s obligations to the general public. &amp;quot;Engineers shall hold paramount the safety, health and welfare of the public and shall strive to comply with the principles of sustainable development in the performance of their professional duties,&amp;quot; from the American Society of Civil Engineers, is one example, but the language is similar between them.&lt;/p&gt;

&lt;p&gt;Even the professional societies for software engineers have such statements; the Association for Computer Machinery: &amp;quot;Software engineers shall act consistently with the public interest... [approving] software only if they have a well-founded belief that it is safe, meets specifications, passes appropriate tests, and does not diminish quality of life, diminish privacy or harm the environment. The ultimate effect of the work should be to the public good.&amp;quot;  The Institute of Electrical and Electronics Engineers: &amp;quot;We, the members of the IEEE... accept responsibility in making decisions consistent with the safety, health, and welfare of the public, and to disclose promptly factors that might endanger the public or the environment.&amp;quot;&lt;/p&gt;

&lt;p&gt;Unlike our brothers and sisters in the other engineering disciplines, though, software engineering does not have the same history of mandatory formal education.  Indeed, many hackers -- myself included -- take pride in the fact that the software community takes in both the self and formally-trained.  Perhaps for that reason, we do not have anywhere near the same level of membership in professional societies as the other engineering disciplines.&lt;/p&gt;

&lt;p&gt;I would wager good money that almost every single person reading this has written code that was deployed into production before they were happy with how it was written and confident that it had no bugs in it.  For that matter, I would wager the same amount that most of us have had code deployed to production which we &lt;em&gt;knew&lt;/em&gt; had bugs in it, but were pressed to do so anyway.&lt;/p&gt;

&lt;p&gt;I can see the objections many of you are writing me right now:  &amp;quot;But, it&amp;#39;s not the same!  Sure, people who program code that go into medical devices, or power the space shuttle, they should definitely be careful.  But I just write code that powers a video game, or an advertising network, or a new social network for dogs.  It can&amp;#39;t hurt anyone!&amp;quot;&lt;/p&gt;

&lt;p&gt;Let me be clear up front:  You&amp;#39;re right, in part.  Code which has life-safety implications should be held to a very much higher standard than code which isn&amp;#39;t.  I certainly hope that the code which is inside an implantable defibrillator has gone through a hell of a lot more code checking and QA than the thrown-together code I&amp;#39;ve written for online advertising.  But making the leap from that to &amp;quot;my code can&amp;#39;t harm people&amp;quot; is a bridge too far.&lt;/p&gt;

&lt;p&gt;Look at the recent spat of security vulnerabilities that have leaked countless people&amp;#39;s personal information.  From OPM to Target, T-Mobile to Home Depot, it seems that it&amp;#39;s never more than a couple of weeks between a new report of some catastrophic information leak these days.  But it&amp;#39;s not only security vulnerabilities that we have to think about.  Let&amp;#39;s take a hookup app as an example.  On the surface, there&amp;#39;s not a whole lot to be concerned about here.  People are free to give as much -- or as little -- information about themselves as they want; they can select pictures which show their faces, or not, and the only bit of information revealed about them other than what they choose is the number of feet away that a user is from you.  Not particularly sensitive information.&lt;/p&gt;

&lt;p&gt;However, it&amp;#39;s quite easy to turn this relatively harmless piece of software into a very dangerous tool for the users.  Take Grindr, for example.  In 2014, it was publically revealed that you could query the Grindr API without any authentication and retrieve a list of users near you, along with their distances to you, out to several decimal places of accuracy.  In addition, you could query the API -- again, without any authentication -- and give it an arbitrary latitute and longitude of /your/ current location.  These two things combined meant it was trivial to triangulate the position of arbitrary users within a couple feet of accuracy [&lt;a href=&quot;http://gadgets.ndtv.com/apps/news/alleged-grindr-security-flaw-exposes-exact-location-data-endangers-users-1-579031&quot;&gt;1&lt;/a&gt;].  Because Grindr targets the gay community, this quickly became a life-threatening vulnerability.  Police in Egypt were recorded using this functionality to track down and arrest -- or extrajudicially punish -- gay people [&lt;a href=&quot;https://web.archive.org/web/20150329114806/http://www.cairoscene.com/ViewArticle.aspx?AId=13967-Egyptian-Cops-Using-Grindr-To-Hunt-Gays&quot;&gt;2&lt;/a&gt;].  Though they disabled the &amp;quot;distance&amp;quot; feature for several months, it has been reactivated, though blocked in several countries.  It is still possible to triangulate the position of arbitrary Grindr users today.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://blog.setec.io/assets/images/posts/grindr.png&quot; alt=&quot;Screenshot of Grindr Location App&quot;&gt;&lt;/p&gt;

&lt;p&gt;This is only one example of how a seemingly harmless feature can be extremely dangerous if they&amp;#39;re not carefully coded and the ramifications thought out carefully.  There are countless more out there; I&amp;#39;m sure every one of us can think of some feature that we have written at one point or another that could be misused to the detriment of our users.&lt;/p&gt;

&lt;p&gt;Do we, as software engineers, have the same kind of moral responsibility as our fellow engineers in other disciplines?  Should we refuse to build systems which can be turned against users, even if it means our jobs?  How do we, as a profession and as a community, balance our responsibilities to our employers and to the general public?  If we were required to &amp;quot;stand under the arch&amp;quot;, as it were, how many of us would have pushed back against things that our employers asked us to do?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://news.ycombinator.com/item?id=10488991&quot;&gt;Discuss on Hacker News&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Sun, 01 Nov 2015 00:00:00 -0400</pubDate>
        <link>https://blog.setec.io/2015/11/01/ethics.html</link>
        <guid isPermaLink="true">https://blog.setec.io/2015/11/01/ethics.html</guid>
        
        
      </item>
    
      <item>
        <title>MEGA is genius</title>
        <description>&lt;p&gt;Let me say this right off of the bat: I&amp;#39;m not weighing in on the business model or the controversies of MEGA when I say that its model is genius.  What I am specifically talking about is only its &lt;em&gt;security&lt;/em&gt; model.  MEGA uses an often misunderstood scheme of encryption as part of its threat model and mitigation that is nothing short of brilliant.  This isn&amp;#39;t, of course, a new scheme - plenty of others have done similar in the past (Spideroak, for example, among many others.)  Still, it&amp;#39;s brilliant.&lt;/p&gt;

&lt;p&gt;Before we delve into the specifics of MEGA, let&amp;#39;s work with a hypothetical example that can better show some of the balancing act that is involved, not just between security and usability, but also with &lt;em&gt;whose&lt;/em&gt; security we are discussing.&lt;/p&gt;

&lt;p&gt;Imagine a particular kind of chat service that enables pseudonymous conversations between two, randomly paired users of the service.  These users can have a conversation of whatever length they desire, and at the option of either of the users, be rematched to a new random pairing.  Let&amp;#39;s set out some of the attributes that we would like this service to have.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Only the sender and recipient of a message can access and read that message.&lt;/li&gt;
&lt;li&gt; Users cannot send messages that have no useful purpose - aka, spam.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Even with that very limited set of constraints, we run face-first into an immediate conflict.  The usability demand (&amp;quot;no spam&amp;quot;) requires that the server operator can, in some way, monitor the content of the messages, flying in the face of the demand for privacy (&amp;quot;no spying&amp;quot;).  How can we resolve this?  Thinking a bit more about what the purposes of these restrictions are, let&amp;#39;s break these constraints out a bit more to see if we can come up with an area that we are OK with compromising on.&lt;/p&gt;

&lt;p&gt;When designing the threat model, there are two different sets of reasons that we might want to ensure that the server operator is unable to read the messages of its users.  On the one hand, there is the simple case - we want users to have privacy and for their messages to be secure.  Simple.  But there is a second, hidden reason that we might want to have this property:  we, as the server operator, don&amp;#39;t want to be put into a position where we /have/ to monitor our users messages.&lt;/p&gt;

&lt;p&gt;Let&amp;#39;s assume for a second that we simply off-load the burden for securing the messages onto our users, in the same way that email providers do.  The users can use PGP or similar for whatever messages they want to remain private, and for messages that they don&amp;#39;t care, they can just use plaintext.  (Ignoring, for a moment, the problems of actually educating the users on how to use PGP or similar.)  Let&amp;#39;s say that a user ends up engaging in some kind of criminal activity using this service, somehow - harassment, maybe, or something else undesirable.  It is quite reasonable to assume that the investigating officers will come knocking on the server operator&amp;#39;s door with a subpoena, wanting whatever records that the server operator has.  Or, more dramatic, they may want to wiretap those users messages into the future.  Another possibility, a copyright owner may want us to block certain copyrighted content from being shared on the network.&lt;/p&gt;

&lt;p&gt;This is, for many reasons, not a great position to be in as the server operator!  We are having to do a bunch of extra work, both political and technological, including some that might conflict with personal beliefs.  Let&amp;#39;s make this explicit in our goals:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Users can only access messages for which they are the sender or recipient.&lt;/li&gt;
&lt;li&gt; The server operator cannot monitor the content of any user messages.&lt;/li&gt;
&lt;li&gt; Users cannot send messages that have no useful purpose - aka, spam.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, it is clear that the real conflict in goals here is between the latter two, not the former.  How can we resolve this conflict?  We will need to weaken one of our security goals in order to resolve this problem.  How can we do so, without trapping us in the earlier bind?  Let&amp;#39;s think about the goals of our attacker - in this case, the spammer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A spammer wants to send their messages to as many users as possible.&lt;/li&gt;
&lt;li&gt;A spammer wants either to:

&lt;ul&gt;
&lt;li&gt;gain some monetary advantage from the messages, even if indirectly (&amp;quot;commercial spam&amp;quot;)&lt;/li&gt;
&lt;li&gt;disrupt the service, either through technological means or by scaring off legitimate users (&amp;quot;lulz spam&amp;quot;)&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Clearly, regardless of the reason, spammers are incentivized to not have extended conversations with the people they are communicating with.  They wield a shotgun, not a sniper rifle.  This gives us multiple advantages - not only can we apply technological mechanisms such as rate limiting to interfere with their aims, we have a potential option for weakening one of our security goals without causing a major loss.  Since there is not a substantial amount of &amp;quot;metadata&amp;quot; to be leaked in a service that&amp;#39;s randomly pairing users - since they can&amp;#39;t choose who they are communicating with - our core goals around privacy of the users is aimed at the content of the messages.  For spammers, who are likely to want to spew their message and re-pair as fast as possible, it means there is not a whole lot of value to communicating for an extended period of time (thus causing messages to contain more and more private information).  How about structuring our goals to recognize that?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Users can only access messages for which they are the sender or recipient.&lt;/li&gt;
&lt;li&gt; The server operator cannot monitor the content of any user messages, unless one of the participants chooses to enable them to.&lt;/li&gt;
&lt;li&gt; Users cannot send messages that have no useful purpose - aka spam - without detection.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If messages can be revealed by one of the participating users - with, say, a &amp;quot;Report&amp;quot; button - the server operator is able to gain information about people misusing the service and take action against them, without having to risk a broad ability to access the content of messages.&lt;/p&gt;

&lt;p&gt;With this weakened set of goals, there is a pretty clear path towards how one can construct a system to achieve them.  Let&amp;#39;s turn our attention back to MEGA.  MEGA is the successor to Megaupload, which was taken down after a Department of Justice investigation into criminal copyright infringement in 2012.  One of the prime elements of the controversy around Megaupload was that they had tools in place to seek out certain kinds of content across the network and remove it, regardless of the links to it (as they did with child pornography), and yet they refused to use those techniques to remove copyrighted files.  Their ability to access the content that was uploaded to their system caused them to be put into a position where they were being forced to use it - or suffer the consequences.&lt;/p&gt;

&lt;p&gt;MEGA, its successor, advertises that it uses client-side encryption to ensure that they cannot read the content of the files which are uploaded to them.  This, however, is &lt;em&gt;not&lt;/em&gt; to ensure user privacy.  In the (vastly) most common usecase, the encryption key is simply provided to those who would access the files as part of the URL and publicly posted.  It is obvious that linking to a file, unencrypted, at the path example.com/fileA is no more or less secure than linking to a file, encrypted, at the path example.com/fileA#encryption-key - &lt;em&gt;for the users&lt;/em&gt;.  It is, however, a tremendous difference to the server operator&amp;#39;s ability to make statements about whether or not they are able to access the content stored on their system.&lt;/p&gt;

&lt;p&gt;This is a &amp;quot;hack&amp;quot; in the traditional sense, twisting the normal purpose of encrypting prior to upload -- to make the information accessible only to authorized people -- into a different security model altogether, one that blinds only a single person -- the operator -- to the content.  For better or worse, MEGA is genius.&lt;/p&gt;
</description>
        <pubDate>Sun, 18 Oct 2015 00:00:00 -0400</pubDate>
        <link>https://blog.setec.io/articles/2015/10/18/mega.html</link>
        <guid isPermaLink="true">https://blog.setec.io/articles/2015/10/18/mega.html</guid>
        
        
        <category>articles</category>
        
      </item>
    
      <item>
        <title>TOFU, Keybase, and Other Vegan Security Choices</title>
        <description>&lt;p&gt;When we left off &lt;a href=&quot;https://blog.setec.io/articles/2015/08/01/compromisable-authorities.html&quot;&gt;last article&lt;/a&gt;, we examined the two most common security models used today and found them both lacking.  But fear not, brave readers - there are yet more key distribution solutions out there.  Surely one of them isn&amp;#39;t total shit!&lt;/p&gt;

&lt;h2&gt;TOFU, or &amp;quot;eh, it&amp;#39;s probably alright&amp;quot;&lt;/h2&gt;

&lt;p&gt;There is one other method of key distribution that is commonly used.  Made popular by OpenSSH, TOFU, or &amp;quot;trust on first use&amp;quot;, has a slightly different attitude to the problem of key distribution than other solutions.  The hardest problem in key distribution is bootstrapping your trust from nothing.  At the end of the day, you need to choose something to build your trust on top of: the certificate authority model chooses a list of preselected authorities that are burned into the operating system, and the web of trust model bootstraps based on a network of people you trust in person.  TOFU looks at this problem and tosses up it&amp;#39;s hands.  &amp;quot;Fuck it,&amp;quot; TOFU says.  &amp;quot;It&amp;#39;s probably alright.&amp;quot;&lt;/p&gt;

&lt;p&gt;Trust on first use provides its security guarantees by protecting all of your connections /after/ the first one.  The first time you connect, you are prompted with a key fingerprint of the server and asked if it&amp;#39;s the right server.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;The authenticity of host &amp;#39;xmenrevolution.com (97.107.134.16)&amp;#39; can&amp;#39;t be established.
RSA key fingerprint is b9:2b:30:7c:a8:89:39:86:9b:13:19:fe:1b:c4:ec:a0.
Are you sure you want to continue connecting (yes/no)?
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It is the users responsibility to verify this fingerprint through some out-of-band method.  Checking with the server operator, looking at SSHFP records in DNS, or sacrificing virgins to those beyond the veil for the answer.  Whatever works.  After this first connection, the certificate is saved with a mapping to the host that you connected to.  On every subsequent connection, it verifies that the server you think you are connecting to has the same fingerprint as the one you first connected to.  If the key changes, it blocks the connection with a warning:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
b9:2b:30:7c:a8:89:39:86:9b:13:19:fe:1b:c4:ec:a0.
Please contact your system administrator.
Add correct host key in /tmp/asht to get rid of this message.
Offending RSA key in /tmp/asht:3
  remove with: ssh-keygen -f &amp;quot;/tmp/asht&amp;quot; -R xmenrevolution.com
RSA host key for xmenrevolution.com has changed and you have requested strict checking.
Host key verification failed.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Sarcasm aside, this is not necessarily an unreasonable approach.  In order to subvert it, an attacker must be constantly in a position to sit between the user and the server, always ready to intercept the connection.  If the attacker misses the window of opportunity, they won&amp;#39;t be able to use a man-in-the-middle attack in the future without being noticed.  Even for an adversary with extensive control, this is a difficult - though certainly not impossible - proposition.  TOFU strikes a utilitarian balance between security and usability, but it&amp;#39;s far from a silver bullet.  It can&amp;#39;t be easily used for asynchronous communications, like e-mail, because the window for an attacker is lengthened significantly.  It doesn&amp;#39;t help at all in the face of a global adversary, or one that is able to attack the network at the point of connection between the server and the internet.  It is difficult to imagine it being used for a replacement for the CA model used in SSL/TLS without sacrificing security in a substantial way.&lt;/p&gt;

&lt;h2&gt;Keybase&lt;/h2&gt;

&lt;p&gt;One company out there aims to solve some of the problems with the complexity of the web of trust by creating a publicly audited directory of people&amp;#39;s PGP keys.  It does so not only through a social mechanism, but also by letting people post claims to their identity through attestations on accounts that they control.  The Keybase software then lets you verify that these attestations are still in place when you retrieve the copy of their public key.  Even if an attacker compromises the person&amp;#39;s Keybase account, it is probably difficult for them to compromise all the associated accounts and post new attestations with a key controlled by the attacker.  For example, my &lt;a href=&quot;https://keybase.io/hlieberman/&quot;&gt;own Keybase profile&lt;/a&gt; has links to Twitter, Github, Hacker News, and this website.  An attacker would have to either compromise all of those accounts to post new attestations, or provide attestations to other profiles that could be confused with mine, as well as my Keybase account.  (Or Keybase itself.)&lt;/p&gt;

&lt;p&gt;Keybase also lets you &amp;quot;track&amp;quot; someone&amp;#39;s identity by signing an attestation yourself that you have verified someone&amp;#39;s information.  This attestation can be used by yourself in the future, if you change computers and no longer have access to the cached information.  It can also be used by others to validate that other people have been watching the profile for changes for a period of time.  The idea being, even if an attacker manages to compromise all the accounts, the more people that are watching, the more likely the compromise would be noticed and reported.  Keybase also uses the Bitcoin blockchain to make attacking Keybase servers more difficult&lt;a href=&quot;https://keybase.io/docs/server_security/merkle_root_in_bitcoin_blockchain&quot;&gt;[1]&lt;/a&gt;; in the end, it is likely an attacker would choose to target an individual user rather than the Keybase servers itself.&lt;/p&gt;

&lt;p&gt;On the surface, it seems that it would be very difficult for an attacker to simultaneously compromise all of the associated accounts on Keybase.  Many of the websites that can be linked support two-factor authentication and have strong password requirements.  If it&amp;#39;s difficult to break into one, surely it&amp;#39;s difficult to break into all of them, right?&lt;/p&gt;

&lt;p&gt;Well.  Sort of.  Let&amp;#39;s take my profile as an example.  I have four accounts linked on Keybase - Github, Hacker News, Twitter, and this website.  My email accounts that are supported in my key are a Gmail account and an account hosted on the same server as this website.  That would mean, you would need to compromise at least four different accounts, two of which have two-factor authentication, and all of which have strong passwords that are not shared between any accounts.  (Password reuse rates have been seen as high as 50%, making the average user&amp;#39;s case likely much easier than attacking mine. &lt;a href=&quot;https://xkcd.com/792/&quot;&gt;[2]&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;There is another link between all of these accounts, though.  Password reset mechanisms.  Many, many websites - including most of the above mentioned - use email as the out-of-band authentication mechanism.  An attacker that was able to compromise an email account could reset the passwords on the other accounts and gain access to them that way and &amp;quot;bootstrap&amp;quot; their access up to other websites.  This is a very common tactic and has been used to great effect, including in the Twitter hack in 2009 &lt;a href=&quot;https://techcrunch.com/2009/07/19/the-anatomy-of-the-twitter-attack/&quot;&gt;[3]&lt;/a&gt;.  &amp;quot;Separate&amp;quot; accounts may not be so separate after all, weakening the fundamental security that Keybase is built on top of.  Whether such a compromise could go unnoticed is a more nebulous question.&lt;/p&gt;

&lt;h2&gt;DNS, DANE, and SSHFS - oh my!&lt;/h2&gt;

&lt;p&gt;One option that has seen some popularity recently is validating the certificate of a server through the DNS infrastructure.  While a little bit of a strange choice at first glance, after mulling it over for a sufficient amount of time, it can make some sense.  DNS is the &amp;quot;directory-book&amp;quot; of the internet; why not extend it to give clients a picture not only of what server they want to contact, but also how to verify that server?&lt;/p&gt;

&lt;p&gt;Lots of reasons, it turns out.  DNS, by default, isn&amp;#39;t authenticated at all.  This means even trivial attackers can pass you whatever records they feel like.  So much for security.  Relatively recently, the DNS infrastructure has begun to be signed through a process called DNSSEC.  DANE, the standard for putting TLS certificates into DNS, requires that DNSSEC be used in order to trust the results.  Unfortunately, the roll-out of DNSSEC has been slow, with many top level ccTLDs not yet signed, and with most DNS resolvers still not verifying the chain.&lt;/p&gt;

&lt;p&gt;Even if DNSSEC was fully deployed, it&amp;#39;s really just a microcosm of the CA model.  Instead of trusting a whole laundry list of domains, though, you must trust a different set of people: the root keyholders, the TLD keyholders, and the nameserver keyholders.  If you mistrust anyone in the chain - and the US government is (substantially) in control of the root - then you can&amp;#39;t trust results coming from DNS.  DANE just ends up being another form of the certificate authority model.&lt;/p&gt;

&lt;h2&gt;What&amp;#39;s next?&lt;/h2&gt;

&lt;p&gt;We&amp;#39;ve looked at a handful of different problems with widely-deployed crypto out in the wild - from user experience to key distribution.  At this point, you might be feeling somewhat depressed about the state of security on the internet; I can&amp;#39;t particularly blame you.  A truly secure system isn&amp;#39;t something that you can really ever reach, though.  A recurring joke in &lt;a href=&quot;irc://irc.freenode.org/##crypto&quot;&gt;##crypto&lt;/a&gt; is a statement of the form &amp;quot;Best security practices recommend you X&amp;quot;, where X is something of the form &amp;quot;encase your system in cement&amp;quot;, or &amp;quot;cool your system with sulfuric acid&amp;quot;.  Security and usability are opposite ends of the spectrum; a well-secured system has struck the right balance between them for its particular threat model.  Security needs to exist in the world, not a vacuum.  So don&amp;#39;t fear, and don&amp;#39;t reach for the impossible.  Find the right balance of compromises for you.&lt;/p&gt;

&lt;p&gt;This is the last article in the &amp;quot;GPG is awesome; GPG is terrible&amp;quot; series.  If you have comments or questions, please feel free to reach out to me, over IRC, email, or IM.  I will continue covering security related topics in the future; if you have suggestions of things you&amp;#39;d like to read, please feel free to recommend them.&lt;/p&gt;
</description>
        <pubDate>Sat, 08 Aug 2015 00:00:00 -0400</pubDate>
        <link>https://blog.setec.io/2015/08/08/tofu.html</link>
        <guid isPermaLink="true">https://blog.setec.io/2015/08/08/tofu.html</guid>
        
        
      </item>
    
      <item>
        <title>Compromisable Authorities and the Web of Mistrust</title>
        <description>&lt;p&gt;&lt;a href=&quot;https://blog.setec.io/2015/07/12/gpg-generation.html&quot;&gt;The last article&lt;/a&gt; walked through the key generation process and all of the traps that will end in an insecure key.  Even after that, though, a new key pair doesn&amp;#39;t do you any good whatsoever if you can&amp;#39;t get it to the people you want to communicate with.  As the saying goes, &amp;quot;encryption is easy; key distribution is hard.&amp;quot;&lt;/p&gt;

&lt;p&gt;There are two main approaches to key distribution: the Certificate Authority model, and the Web of Trust model.  Both have slight variations and extensions as they are implemented in the &amp;quot;real world&amp;quot;, but they boil down to roughly the same fundamentals.&lt;/p&gt;

&lt;h2&gt;Certificate Authorities&lt;/h2&gt;

&lt;p&gt;The Certificate Authority (or CA) model is the basis for the majority of encryption used on the internet today.  From corporate intranets to securing your bank&amp;#39;s website, Certificate Authorities is the method of choice for making sure that the key you are using to talk to someone actually belongs to the person you want to reach.  SSL/TLS, which secures (essentially) all encrypted HTTP traffic in the world, mandates the use of the CA model.&lt;/p&gt;

&lt;p&gt;The Certificate Authority model is very simple.  Baked into your web browsers and your operating systems is a list of companies which you trust to validate identities on the internet, and so-called &amp;quot;root certificates&amp;quot; for those authorities.  You might be surprised to know just how many of them there are, and with names that you probably have never even heard of.  At the time of this writing, there are 180 root certificates that are distributed by the Mozilla Foundation with their Firefox browser, and other browsers and operating systems will have similarly large counts, though some of the specifics may vary slightly.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://wiki.mozilla.org/CA:IncludedCAs&quot;&gt;complete list&lt;/a&gt; has many names that are recognizable - the governments of France, Japan, Spain, Taiwan, The Netherlands, and Turkey, for instance - as well as many names that aren&amp;#39;t nearly so familiar.  Did you know that companies like Atos, Buypass, Camerfirma, Izenpe, and WISeKey can all sign certificates that will be instantly trusted by your computer?  This is not to say that any of these companies is necessarily untrustworthy - but it also points out the fundamental flaw of Certificate Authorities: you need to have at least one agency that you trust, fundamentally, to authorize all the others. - and you need it at the very beginning.&lt;/p&gt;

&lt;p&gt;If it&amp;#39;s not included in your browser, or in your operating system, you have no way of determining if any list of certificate authorities that you retrieve in the future is authentic.  These CAs, well-meaning as they may be, are a target for attack.  &lt;a href=&quot;https://en.wikipedia.org/wiki/DigiNotar&quot;&gt;Hackers have compromised them&lt;/a&gt; in the past, issuing fake certificates which were used to impersonate Google, among other things.  It is commonly believed that &lt;a href=&quot;https://en.wikipedia.org/wiki/Stuxnet&quot;&gt;the United States Government stole certificates&lt;/a&gt; for use in distributing targeted malware to disrupt the Iranian nuclear program.  CAs have also &lt;a href=&quot;https://blog.mozilla.org/security/2013/01/03/revoking-trust-in-two-turktrust-certficates/&quot;&gt;made mistakes&lt;/a&gt;, issuing certificates with more authority than they were intended to have.  These CAs are large targets precisely because of the pedestal on which we put them.&lt;/p&gt;

&lt;p&gt;Slimming down the list of CAs is certainly a good idea in theory, but in practice it is very difficult.  All the certificates issued by those CAs -- and all the certificates issued by their delegates -- need to be reissued.  Nor does it answer the solve the harder question: how do we choose who to trust?&lt;/p&gt;

&lt;h2&gt;Web of Trust&lt;/h2&gt;

&lt;p&gt;Many people would draw a parallel between the web of trust and communism:  great in theory, but terrible in practice.  The web of trust takes a decidedly more personal approach to solving the problem of key distribution - or, as today&amp;#39;s Silicon Valley VC-hotbed would say if it was reinvented today, &amp;quot;a social network for key distribution.&amp;quot;&lt;/p&gt;

&lt;p&gt;Whereas every person who uses a particular version of an operating system or browser works from the same, universal set of CAs, no two people have the same &lt;em&gt;view&lt;/em&gt; of the web of trust, even if they have an overlapping layout.&lt;/p&gt;

&lt;p&gt;The web of trust, most commonly known as the PGP web of trust, is built on the concept of &amp;quot;nearness&amp;quot;.  Each person starts out trusting no one but themselves, and their own keys.  Through a process of in-person verification of stranger&amp;#39;s keys, potentially at a ceremony the like of which would once have resulted in a burning at the stake due to the cryptic incantations, the goal is to establish a link of verified keys and trusted parties between you and anyone you would want to communicate with.  The hope is, with enough people that you have a trust relationship with, you can reach anyone that you might want to talk to through a minimum of hops.&lt;/p&gt;

&lt;p&gt;If you have read that paragraph a couple of times and still have no idea what the fuck it means, have no fear: that&amp;#39;s a quite common for first exposure to the web of trust.  Unlike the Certificate Authority heirarchical architecture, the web of trust is a distributed mesh of relationships, and it is far from simple.&lt;/p&gt;

&lt;p&gt;There are two fundamental operations in the web of trust: verifying (or attesting to) a key and assigning trust to an identity.  Let&amp;#39;s start with the more common one - verifying a key.&lt;/p&gt;

&lt;h3&gt;Key Signing&lt;/h3&gt;

&lt;p&gt;You and a friend (named Alice, by convention) have both managed to generate a secure key and you now want to be able to communicate securely.  Key exchange is relatively simple if you can meet in person - but how can you leverage people who you meet in person to talk to people that you can&amp;#39;t?&lt;/p&gt;

&lt;p&gt;You and Alice meet in person and exchange a copy of each other&amp;#39;s public keys.  This can be done by giving each other a USB stick with the copy of the public key on it, or more commonly, giving each other a piece of paper with a relatively short &amp;quot;fingerprint&amp;quot; of the key that you can use to retrieve the key from a server while trusting that it hasn&amp;#39;t been altered.  If you don&amp;#39;t know Alice that well, you might also examine a few copies of her identification, to ensure she really is the person she says she is.&lt;/p&gt;

&lt;p&gt;When you go home that night, you &amp;quot;sign&amp;quot; a particularly formed statement that PGP compatible systems know how to read which states that you believe that Alice&amp;#39;s key, with the fingerprint that you received from her earlier, actually belongs to her.  You then send this attestation to Alice for her to distribute publically.  Once she does so, anyone who retrieves a copy of her key will also receive your attestation.&lt;/p&gt;

&lt;h3&gt;Leveraging Trust&lt;/h3&gt;

&lt;p&gt;You go around to all of your other friends and exchange keys with each other.  At the end of the day, you build up a nice network of people that you have signed keys from.  How does this help you?&lt;/p&gt;

&lt;p&gt;While you have signed a bunch of different people&amp;#39;s keys, you still don&amp;#39;t have a mechanism to reach anyone whose keys that you haven&amp;#39;t met yourself.  However, there&amp;#39;s a simple thing you can do to extend your network.  As well as attesting to one of your friend&amp;#39;s keys, you can also tell your PGP system that you trust this particular friend to verify identities on your behalf.  You can even publish this statement of trust publicly.  When you do so, other people who trust you can leverage your verifications to reach people that you have met and they haven&amp;#39;t, and vice-versa.&lt;/p&gt;

&lt;p&gt;Great!  Everyone publishes their trusts, everyone publishes their verifications, and we can reach everyone that we want to.  This is great!  No single point of failure to compromise, leveraging real-world relationships.  How social!  How Web 2.0!&lt;/p&gt;

&lt;h3&gt;Getting Stuck in the Web&lt;/h3&gt;

&lt;p&gt;So, that&amp;#39;s it.  The web of trust is great.  Problem solved.  Right? ... Right?&lt;/p&gt;

&lt;p&gt;Not quite.  The largest network of PGP servers, SKS Keyservers, has around four million keys in its database &lt;a href=&quot;https://sks-keyservers.net/status/&quot;&gt;[1]&lt;/a&gt;.  Of those four million, the largest group of keys for which there is a validation path to every other key in that group is less than 60,000 &lt;a href=&quot;http://pgp.cs.uu.nl/plot/&quot;&gt;[2]&lt;/a&gt;.  That means, only 1.5% of keys on the key server can actually be validated through the largest web of trust (called the &amp;quot;strong set&amp;quot;).  All of the other 98.5% of keys are disconnected - either signed by no one, or signed by a small group of people that has no connection to the larger group.&lt;/p&gt;

&lt;p&gt;This problem is called the &amp;quot;small world&amp;quot; problem, and it is the giant hole in the web of trust.  The web of trust depends on a large interconnected graph, with published trust levels, in order to &amp;quot;walk&amp;quot; the path to the key of someone you want to talk to.  In practice, even if you manage to get into that 1.5% of the strong set, you are probably too &amp;quot;far away&amp;quot; on the graph to use it all that effectively.&lt;/p&gt;

&lt;p&gt;This is a bit confusing, so let&amp;#39;s work through a real-world example.  Let&amp;#39;s say I want to send an email to Linus.  I have a key in the strong set, and so does he, so I should be able to leverage that web of trust to retrieve a key that I can be confident he actually controls, right?&lt;/p&gt;

&lt;p&gt;Well... sort of.  No one that I trust fully to validate keys on my behalf has signed Linus&amp;#39; key.  People who I trust fully have signed keys that have signed keys that have signed Linus&amp;#39; key, but nothing direct.  When I ask GPG what the trust level of Linus&amp;#39; key is, it tosses up its hands:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;pub   2048R/0x79BE3E4300411886 2011-09-20
      Key fingerprint = ABAF 11C6 5A29 70B1 30AB  E3C4 79BE 3E43 0041 1886
      uid                 [ unknown] Linus Torvalds &amp;lt;torvalds@linux-foundation.org&amp;gt;
      sub   2048R/0x88BCE80F012F54CA 2011-09-20
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Digging into this further, GPG (by default) uses the following pattern to dictate how trusted a key is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; A key is trusted if it has been signed by you, or signed by someone you trust fully; OR&lt;/li&gt;
&lt;li&gt; A key is trusted if it has been signed by three people who you marginally trust; AND&lt;/li&gt;
&lt;li&gt; The path between the key and you is 5 steps or shorter.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;What does this mean for me emailing Linus?  Well, #1 isn&amp;#39;t valid - I haven&amp;#39;t signed Linus&amp;#39; key, nor has anyone I fully trust signed it. No one that I marginally trust has signed his key.&lt;/p&gt;

&lt;p&gt;One technique that is (somewhat controversially) used is the idea of transitive trust.  Most frequently, this is stated that trust is transitive at one level less than the parent.  That means, if I trust someone fully, and they sign someone&amp;#39;s key (let&amp;#39;s say, Bob), then I marginally trust Bob to sign keys on my behalf.  Trust, in reality, doesn&amp;#39;t really work this way - but let&amp;#39;s pretend for a moment.  Does that help me talk to Linus?&lt;/p&gt;

&lt;p&gt;It gets me closer, but not close enough.  I have three different paths of length three between Linus and myself.  Of those three paths, two of them start with someone who I trust fully, and one of them starts with someone I trust marginally.  This means that two of the people who have signed Linus&amp;#39; key get assigned the ability to produce marginally trusted signatures, and one has an untrusted signature.  Two marginal signatures isn&amp;#39;t enough to satisfy rule #2, so the trust level remains unknown, and it&amp;#39;s not &amp;quot;safe&amp;quot; for me to email Linus and have confidence that the key really belongs to him.&lt;/p&gt;

&lt;h2&gt;Now what?&lt;/h2&gt;

&lt;p&gt;Well, shit.  We covered the two most common models for key distribution, and we have a long list of why they both suck.  Now what?  In the &lt;a href=&quot;https://blog.setec.io/2015/08/08/tofu.html&quot;&gt;next article&lt;/a&gt;, we will cover some of the less common approaches to key distribution and see if any of those look better.&lt;/p&gt;
</description>
        <pubDate>Sat, 01 Aug 2015 00:00:00 -0400</pubDate>
        <link>https://blog.setec.io/articles/2015/08/01/compromisable-authorities.html</link>
        <guid isPermaLink="true">https://blog.setec.io/articles/2015/08/01/compromisable-authorities.html</guid>
        
        
        <category>articles</category>
        
      </item>
    
      <item>
        <title>GPG is awesome; GPG is terrible</title>
        <description>&lt;p&gt;When you read about GPG (aka GnuPG) these days, you will find a bunch of very intelligent people saying two completely opposite things.  On the one hand, we hear that GPG is an extremely effective tool against surveillance; it was one of the primary tools used by Edward Snowden in his efforts to release information about illegal activities by the NSA &lt;a href=&quot;https://firstlook.org/theintercept/2014/10/28/smuggling-snowden-secrets/&quot;&gt;[1]&lt;/a&gt;.  On the other hand, we hear that using GPG correctly is an incredibly difficult (if not almost impossible) process, and that is uses a protocol that is increasingly showing its age &lt;a href=&quot;http://thoughtcrime.org/blog/gpg-and-me/&quot;&gt;[2]&lt;/a&gt;.  While these appear to be conflicting propositions, I believe that they are both true.  GPG is awesome; GPG is terrible.&lt;/p&gt;

&lt;p&gt;For a moment, let&amp;#39;s leave aside the problems with the GPG protocol itself - lack of forward secrecy, lack of deniability, overly complex controls with insane defaults (yes, CAST5 is still the default symmetric cipher), compatibility with ancient legacy standards, to name a few - and focus on what I think is a larger problem with GPG: its user experience around key management.&lt;/p&gt;

&lt;p&gt;Let&amp;#39;s walk just through the generation step together with a fairly recent version of GPG:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;hlieberman@agartha:~$ gpg --gen-key
gpg (GnuPG) 1.4.19; Copyright (C) 2015 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
Your selection?
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;While the default that it suggests is sane, someone who is not familiar with GPG is likely to be confused about what exactly the differences are.  Even for someone familiar with the algorithms, half of the choices will give you a key pair that you &lt;em&gt;can&amp;#39;t&lt;/em&gt; receive encrypted email with.  But, OK, let&amp;#39;s just blindly hit enter and accept the defaults.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;While there&amp;#39;s certainly nothing wrong with a 2048 bit key, these days new keys should probably be 4096 bits.  Again, let&amp;#39;s accept the default.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;Please specify how long the key should be valid.
0 = key does not expire
&amp;lt;n&amp;gt;  = key expires in n days
&amp;lt;n&amp;gt;w = key expires in n weeks
&amp;lt;n&amp;gt;m = key expires in n months
&amp;lt;n&amp;gt;y = key expires in n years
Key is valid for? (0)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This is one of the more common mistakes I see for people generating GPG keys; one I have made myself before.  There is almost no reason to generate a key that has an expiration date longer than a year, and no reason to generate a key with no expiration date set.  Expiration dates can always be changed in the future - even after a key has expired.  However, they provide an important safeguard in the event that you lose access to both the private key and a revocation certificate.  Especially when you&amp;#39;re new to GPG, it&amp;#39;s not unusual for you to need to toss the first key that you create, and you don&amp;#39;t want a key sitting around on the keyservers forever that you can&amp;#39;t remove.  It&amp;#39;s good practice to make sure that your key has a somewhat close expiration date&lt;a href=&quot;https://help.riseup.net/en/security/message-security/openpgp/best-practices#use-an-expiration-date-less-than-two-years&quot;&gt;[3]&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let&amp;#39;s accept the default and move on.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;Key does not expire at all
Is this correct? (y/N)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Uh-oh.  Is this an error message?  Is it warning me about a bad practice?  Let&amp;#39;s go back and set an expiration date.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;Is this correct? (y/N) N
Key is valid for? (0) 3y
Key expires at Wed 11 Jul 2018 07:08:41 PM EDT
Is this correct? (y/N)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Guess it&amp;#39;s just a warning by default to make sure it&amp;#39;s parsed what you want correctly; I understand now.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;Is this correct? (y/N) y
You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
    &amp;quot;Heinrich Heine (Der Dichter) &amp;lt;heinrichh@duesseldorf.de&amp;gt;&amp;quot;

Real name: Harlan Lieberman-Berg
Email address: hlieberman@setec.io
Comment: This is just a test key.
You selected this USER-ID:
    &amp;quot;Harlan Lieberman-Berg (This is just a test key.) &amp;lt;hlieberman@setec.io&amp;gt;&amp;quot;

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit?
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Using a comment isn&amp;#39;t a great idea in most cases.  It either provides repetition of information already in the email address, or is used to tell people things that should better be elsewhere &lt;a href=&quot;https://www.debian-administration.org/users/dkg/weblog/97&quot;&gt;[4]&lt;/a&gt;.  (Why do you have a key with the comment &amp;quot;Don&amp;#39;t use this one&amp;quot; that&amp;#39;s not been revoked?)&lt;/p&gt;

&lt;p&gt;From here on, it&amp;#39;s relatively smooth sailing.  But did this cause me to generate a key that&amp;#39;s secure?  Well... sort of.  If you&amp;#39;re using a new enough version of GPG, you should be OK, but even fairly recent versions don&amp;#39;t follow best-practices.  You probably used SHA-1 for your self-signature, instead of something stronger; you may even have used MD5.  Your preference order for ciphers probably includes stuff you don&amp;#39;t want -- for this particular version of GPG, it includes 3DES as a preferred encryption algorithm.  Similarly, it prefers SHA-1 above SHA-512.&lt;/p&gt;

&lt;p&gt;You didn&amp;#39;t generate a revocation certificate, though doing so is very much recommended.  You also aren&amp;#39;t following the current best-practice of having an entirely offline primary key - and using the same key for signatures and key management to boot.&lt;/p&gt;

&lt;p&gt;This was hardly a great success, and we haven&amp;#39;t even gotten the key anywhere that we can use yet.  In the &lt;a href=&quot;https://blog.setec.io/articles/2015/07/26/compromisable-authority.html&quot;&gt;next post&lt;/a&gt;, we will focus on the next set of problems: securely integrating into the key infrastructure.&lt;/p&gt;
</description>
        <pubDate>Sun, 12 Jul 2015 00:00:00 -0400</pubDate>
        <link>https://blog.setec.io/2015/07/12/gpg-generation.html</link>
        <guid isPermaLink="true">https://blog.setec.io/2015/07/12/gpg-generation.html</guid>
        
        
      </item>
    
      <item>
        <title>Solitude</title>
        <description>&lt;p&gt;Looking back on the months that I spent working on AdvertiSin, I am struck by how inaccurate my estimates of what my problems would be were.  Before I started working on AdvertiSin at all, I spent a long time looking at the feasibility of the business.  The classic MBA outlook: identify the market, identify the competition, identify the differentiating factor, the value proposition, and so on and so on.  I looked at timelines, at financial forecasts, and examined whether I really thought the idea was workable.  I did - and still do.  When it came time to work on AdvertiSin full time, I leapt into the brink gladly, confident that I had a good grip on what the risks were - at least as much as such a thing is possible, where startups are concerned.&lt;/p&gt;

&lt;p&gt;I was wrong.  In the end, the thing that was by far the most difficult for me to struggle with was a risk I hadn&amp;#39;t even considered the broad category of when I set off on this project back in January of 2014:  me.  When I was weighing things, I was focused on the idea of the business itself, and the implementation of it.  I, personally, didn&amp;#39;t come into it, except with how I thought my skills could manage to do this or that.&lt;/p&gt;

&lt;p&gt;In retrospect, I did get some very good advice that I didn&amp;#39;t pay enough attention to.  Both of the founders of my then-employer, Alden and Venkat, warned me about the effects of solitude on startup founders.  They warned me about the sense of isolation, about the feeling in the pit of your stomach that can happen a couple of weeks in of &amp;quot;oh, fuck, what have I done?&amp;quot;&lt;/p&gt;

&lt;p&gt;I watched for that feeling in the back of my mind, but it didn&amp;#39;t manifest anything like I thought it would.  It wasn&amp;#39;t a hollow feeling, or a panic that struck late at night.  I was so focused on what I was doing, I forgot the things I learned as a manager; the symptoms of burn-out sneaking up on me.  I didn&amp;#39;t even realize what was happening when I first started seeing my useful working hours cut back, and then back further.  When ten hours of useful thought became eight, became six, became four.&lt;/p&gt;

&lt;p&gt;When I finally figured out what was happening, I was already crispy around the edges.  I took steps to mitigate it - joined a co-working space, made an effort to talk more to people who were advising me - but I wasn&amp;#39;t able to recover enough of my personal momentum to justify continuing full time.  Putting AdvertiSin back on the shelf, if only just for now, wasn&amp;#39;t an easy decision to make, but I think it was the right one.&lt;/p&gt;

&lt;p&gt;I hope that other founders learn from my lesson.  When you are looking at your startup, don&amp;#39;t just look at the business, but look at yourself.  Startups are a wild ride, and going it alone makes the peaks and falls that much harder on you.  Take breaks, and keep up your social life.  The business can&amp;#39;t survive without you, but it will consume you if it can.&lt;/p&gt;
</description>
        <pubDate>Sun, 28 Jun 2015 00:00:00 -0400</pubDate>
        <link>https://blog.setec.io/articles/2015/06/28/solitude.html</link>
        <guid isPermaLink="true">https://blog.setec.io/articles/2015/06/28/solitude.html</guid>
        
        
        <category>articles</category>
        
      </item>
    
      <item>
        <title>wdiff</title>
        <description>&lt;p&gt;This week, while helping out the &lt;a href=&quot;http://debconf15.debconf.org/&quot;&gt;DebConf 15&lt;/a&gt; team with some proofreading, I encountered a kind of diff I&amp;#39;ve never worked with before.  A wdiff, or word diff, is intended for displaying word differences between text files.  In the context where you are editing free-form text, rather than something like code, it makes a lot more sense than a more traditional unified or copied diff.&lt;/p&gt;

&lt;p&gt;So far, so good!  But, unfortunately, neither I nor the people who I was working with were able to find any tool out there that actually lets you apply a wdiff patch to a file - or even to blindly discard or accept all the changes inside a wdiff file.&lt;/p&gt;

&lt;p&gt;As with most problems, it&amp;#39;s nothing a sufficiently gross application of Perl can&amp;#39;t solve.  In case anyone in the future runs into this problem, I&amp;#39;m including the little Perl one-liner that will take a wdiff file on stdin and output the document with all changes applied.  It&amp;#39;s not pretty, and I haven&amp;#39;t tested it that thoroughly, so use it with caution.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;perl -ne &lt;span class=&quot;s1&quot;&gt;&amp;#39;$_ =~  s/ ?\[-(?:[^\]]+)-\]//g; $_ =~ s/ ?\{\+([^\}]+)\+\}/ $1/g; print $_&amp;#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
</description>
        <pubDate>Mon, 09 Mar 2015 00:00:00 -0400</pubDate>
        <link>https://blog.setec.io/articles/2015/03/09/wdiff.html</link>
        <guid isPermaLink="true">https://blog.setec.io/articles/2015/03/09/wdiff.html</guid>
        
        <category>code</category>
        
        <category>debian</category>
        
        
        <category>articles</category>
        
      </item>
    
      <item>
        <title>DebConf Retrospective</title>
        <description>&lt;p&gt;Once more, back in the air, just a bit beneath the route that I took on my way out to Portland.  The last nine days have been hectic and, in many ways, very different than I was expecting.  In other ways, though, it was exactly what I expected.  To-do lists definitely breed, that&amp;#39;s for sure.&lt;/p&gt;

&lt;p&gt;I&amp;#39;ve been to many other tech conferences before, but this didn&amp;#39;t have nearly the same feel to it.  It was more than simply a bunch of engineers with some common interest gathering together; as cliché as it is to write, it felt more like a gathering of friends.  Sure, there were talks aplenty, and those were familiar enough.  Perhaps it was just the regularity - the number of years that some of the other conferencegoers had been attending different DebConfs all over the world.&lt;/p&gt;

&lt;p&gt;I think leaving it at that, though, would be a disservice; it&amp;#39;s not the first time I&amp;#39;ve thought that Debian was one of the most welcoming communities that I&amp;#39;ve been a part of in the free software movement.  I certainly made new friends, and even as I fly back home, I&amp;#39;m eagerly looking forward to the next DebConf in Heidelberg.&lt;/p&gt;

&lt;p&gt;Emotional sappiness through, let&amp;#39;s turn talk to the tech.  The most significant thing that I worked on while at DebConf in terms of technical complexity, if not impact, was the debugging of a build failure in &lt;a href=&quot;http://search.cpan.org/dist/NanoMsg-Raw/lib/NanoMsg/Raw.pm&quot;&gt;NanoMsg::Raw&lt;/a&gt;, thanks in a very large part to help from my friend olasd - Nicolas Dandrimont.  The &lt;a href=&quot;https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756350&quot;&gt;build failure&lt;/a&gt; wasn&amp;#39;t an easy one for me to understand - it was a segfault coming from somewhere inside either the XS, inside the underlying library, or as some race condition somewhere in between.  Adding to the complexity was the fact that the NanoMsg::Raw package already had some test failures that were false positives, and the underlying library with its own set of test suite difficulties.&lt;/p&gt;

&lt;p&gt;We finally narrowed the intermittent failure down to an uninitialized variable in the XS code in NanoMsg::Raw that was causing two of the builds to fail - the primary cause of &lt;a href=&quot;https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756350&quot;&gt;the bug&lt;/a&gt;.  The fix ended up being two lines - initializing the variable and switching from an mPUSHs to an mXPUSHs to make sure there was enough room on the stack.  Of course, one thing so often leads to another, and the package still fails to build properly due to another failure, as well as various architecture-specific problems that the upstreams are working on fixing.&lt;/p&gt;

&lt;p&gt;That and getting a few moments to upload updated versions of packages for the pkg-perl team was the only things that I had planned on getting done that I had any chance to do, but I found a few other projects that are very interesting.  I worked with Raphael Geissert on some changes to the code editor for &lt;a href=&quot;https://sources.debian.org/&quot;&gt;sources.debian.org&lt;/a&gt;.  The version currently there, codeeditor, was causing tremendous javascript slowdowns when large amounts of code were loaded into it - almost up to ten seconds, on resource-constrained hardware.  Raphael and I tried to dig into the why for several hours, but we ended up with the belief that the problems were structural, not a minor bug, in how the codeeditor system was doing the actual highlighting and formatting.  The package was using individualized spans to do it, causing memory to jump into the hundreds of megabytes when large files were opened, as well as the achingly slow render time that drew our attention in the first place.&lt;/p&gt;

&lt;p&gt;In the end, we decided to jump ship to another, somewhat similar library: &lt;a href=&quot;http://ajaxorg.github.io/ace/&quot;&gt;Ace&lt;/a&gt;, the editor that &lt;a href=&quot;https://c9.io&quot;&gt;Cloud9&lt;/a&gt; develops and the descendant of the Mozilla Skyline project.  Integration isn&amp;#39;t fully complete yet, but the initial results look great.  The performance is fantastic, the quality is excellent, and all in all, the Ace editor seems to be a very well thought out piece of tech.  I hope to work with Raphael on finishing the last bits of it off in the next coming weeks, and I hope that you will be able to see the results soon for yourself.&lt;/p&gt;

&lt;p&gt;A lot more than that happened, and far more than I could write down here.  Even though the conference is barely over, I am eagerly looking forward to seeing everyone again at DebConf 15 in Heidelberg.&lt;/p&gt;
</description>
        <pubDate>Mon, 01 Sep 2014 00:00:00 -0400</pubDate>
        <link>https://blog.setec.io/articles/2014/09/01/debconf-return.html</link>
        <guid isPermaLink="true">https://blog.setec.io/articles/2014/09/01/debconf-return.html</guid>
        
        <category>dc14</category>
        
        <category>debconf</category>
        
        <category>debian</category>
        
        <category>travel</category>
        
        <category>f/oss</category>
        
        
        <category>articles</category>
        
      </item>
    
  </channel>
</rss>
