2013-09-16

A free market in censorship

Readers of this blog will be aware of my feelings towards the current Chinese government and their attitude towards suppression of free speech. I do, however, have to give them credit; they have created quite the free market in online censorship tools:

King's dabble in Internet entrepreneurialism has shown that Chinese censorship relies more heavily than was known on automatic filtering that holds posts back for human review before they appear online. The researchers also uncovered evidence that China’s vast censorship system is underpinned by a surprisingly vibrant, capitalistic market where companies compete to offer better censorship technology and services.
If you're running an online business in China, especially if you intend to offer per-user accounts, you have no option but to co-operate with one of the approved businesses which will help you conform to the requirements of the Chinese government in censoring posts, providing information on user identity on demand etc. An object lesson in this came from ex-head of Yahoo!, Jerry Yang when he testified to Congress in 2007 regarding the arrest of journalist Shi Tao following Yahoo! turning over Tao's identity to Chinese officials:
In February, 2006, Yahoo's Callahan had testified that Yahoo did not know why Chinese officials wanted information on Tao. But several months later, a U.S. advocacy group for religious and political prisoners in China published translations of documents sent to Yahoo from Chinese officials stating that Tao was suspected of divulging state secrets. "What those documents say is that, at the very least, Yahoo's Beijing office knew what crimes were being investigated when they were approached by law enforcement in China," says Joshua Rosenzweig
You have to feel at least a little sorry for Yang, who was carried along on a wave on enthusiasm about investment in China without, presumably, being informed of what Yahoo! would be obliged to do for the Chinese government in return. Of course, poor Shi Tao is the one who really got it in the shorts.

But back to modern online business in China. If (heaven forbid) this censorship system was implemented in the UK I can imagine a new body, say the "Online Identity Check Executive", issuing reams of degrees about how censorship should be conducted, appropriate regulations, "best practice" advice and an "Approved Code of Practice" booklet issued annually and consuming several inches of shelf space. The instinct for bureaucrats is to control finer and finer details in order to increase the need for their organization. That makes it all the more remarkable that in China how you satisfy the government is really up to you, and there's an enthusiastic market in tools, systems and people to help you maximise your bang per yuan in your censorship systems:

Companies are free to run their censorship operations mostly as they wish, as long as they don’t allow the wrong kind of speech to flourish. That creates an incentive to find ways to censor more effectively so as to minimize the impact on profitability.
Interestingly, "the wrong kind of speech" seems to focus more on collective action than on isolated "the system sucks" speech. The Chinese government are clearly terrified of an organized rebellion, along the lines of 1989's Tiananmen Square action but more coherent and better planned. The article also notes the censorship rate: about 2 censors per 50,000 users seems to be the minimum for effective censorship assuming the use of reasonably effective tools to pre-screen posts for censor review.

So a certain grudging admiration for the Chinese government in making a blatantly capitalistic approach to maximising the effect of their censorship. Of course, the companies actually providing these tools are enabling the censorship in the first place, but even then they could argue that they are maximising the ability of Chinese citizens to engage online, censoring the minimum number of their posts - after all, manual censor review costs money, so the fewer posts selected for review the better.

2013-09-13

Client-side encryption in the cloud

I'm not entirely sure where this post is going to go, so bear with me. I've been thinking about encryption during the past few days, and how it relates to "cloud" services (Amazon Web Services, Google Compute Engine, Microsoft Azure) etc. If you can't trust your cloud storage provider to repel attempted security breaches, whether from government agencies or pirate enterprise, what can you do about it?

First, a bit of background. "The cloud" is commonly perceived as an amorphous blob of computing power, spread across cities / countries / continents as appropriate. The supposed killer application of the cloud is that it removes the need for a company to rent space in several data centers, build out an appropriate security system, build out a load balancing system to handle one or more data centers being down, employ a dedicated set of data center operations and systems staff... instead it can just "rent" 1PB of storage - where one PB (petabyte) = 1024 terabytes (TB), 1 TB is a standard hard disk size - and specify that be split across at least four geographic locations where at least 2 are in Europe and at least 2 are in the USA. That way it can keep four copies of its key information, and (since data centers get periodically taken down for maintenance or via accidents) at least one copy of the information will almost certainly be available very close to a given user, and at least one copy is practically always available somewhere in the world. Job done, right?

Well, not quite. The first problem is that the company's users in (say) the UK and Germany may well be talking to a data center in France for most of the time. That means that their key data is flowing across national borders, and very vulnerable to being tapped by a random bad guy who may or may not represent a government. Since industrial espionage and national wiretapping are uncomfortably close, how can the company protect against this?

For high security data, the problem can usually be solved with SSL (Secure Sockets Layer) communication. The idea here is that the server (in the cloud) and the client (in the company site) negotiate to establish a shared secret key before starting to communicate data. Essential to the security of this approach is that the server can "sign" a request by the client, proving that it knows a secret ("private key") that only the server should know, without giving away to an observer what that private key actually is. So the server has to be provided with a suitable private key as part of the cloud set-up process, and the client needs to be told what a valid server "signature" looks like.

One aspect of encryption that is often overlooked is that, for a user's data to be available in data centers A, B, C and D, whenever the data changes in one data center it has to be copied ("replicated") to all other data centers. Because this often happens after a user's conversation with a data center has finished, this can't be done as part of the user's SSL connection; it has to be managed separately. If you don't encrypt this later communication, a very clever eavesdropper who has determined some information about the structure of your data and messages can eavesdrop on the inter-datacenter communications. This is what Google has announced recently: they now encrypt all traffic between their data centers, to foil such eavesdropping. This way, every "pipe" between the user and any computer on which they might store data is encrypted.

So far so good, but the user's data is sitting on several hard drives scattered across the globe. What if an intruder gains access to one of the machines with this data? Well, currently he or she can read the user's data with impunity. We can try to fix this with encryption; pick a secret key, store the data in encrypted form, then decrypt it as it's read. The problem here is that you have to keep the secret key somewhere, and access it whenever the user wants to read their data; this means, in practice, storing a copy of the secret key in each data center and having a very robust way of checking whether a machine is authorised to know it just before decrypting the data. Now you've just shifted the hacker's problem; he or she has to find the key store and compromise it. This is probably not much harder than compromising the original machine.

The other problem is compelled access; if your cloud hosting company is given a court order to provide some entity with your data then they can decrypt your data at will and hand it over in the clear. So how do you protect your data?

The obvious answer is that you should keep the secret key yourself. There are two flavours of approach here, and each has its problems. The superficially attractive approach is that you pass in a copy of your key each time you want to access your data; because your connection to the server is secure (see above) this is nominally safe. The server keeps your key in memory, reads the encrypted data into memory, decrypts it and sends it back to you in clear text, and then wipes its memory to overwrite the key and clear text. An attacker would have to have access to the machine at the time you are accessing your data, and be able to read the relevant segment of memory to get hold of the key, or alternatively compromise the server software itself and get it to squirrel away copies of keys as they are received; this is significantly harder, but still feasible. So this is better, but far from perfect.

The "bullet-proof" approach is never to send your encryption key to the server at all. Instead you send and receive encrypted data, keeping a copy of the key on your personal machine, and encrypt/decrypt the data as it passes from and to your machine. This is essentially a perfect defence against a compromised cloud provider. One problem, though, is that it negates many of the benefits of cloud hosting; any processing (e.g. indexing) of the data you provide has to be done on your own machine, as the cloud systems will never have access to the clear text to be able to index it. All they are doing is providing a distributed, expensive and slow hard drive for you, which is not worth very much money to most people. And, of course, your machine will now be the target of crackers who will mail you malware and try to get you to browse malware-serving web pages to compromise your system and send them your key, or even key-log your keyboard to catch your key as you enter it.

Worse, if you are responsible for your encryption key, you had better make sure you don't lose it. For a key to be strong (proof against distributed cracking) it has to have a lot of information and hence will tend to be hard to remember exactly. If you forget it, you are screwed - your encrypted data is just wasted space on a hard drive. Perhaps you will use a "password safe" program to store these keys, but then a) you need to trust that the password safe program has not itself been compromised and b) you have to remember the password safe key and keep it safe from keylogging...

All of this goes to show that if you want to keep data in the cloud, and you want it to be secure, it turns out to be a very hard problem if you are defending it against a capable and determined opponent. The best approach seems to be to have a reasonably robust encryption scheme (say, server-side encryption) and accept the risk of hosting company compromise; to defend against this, try not to have data that anyone would actually find interesting enough to try to decrypt.

2013-09-10

How public money is spent

Rarely have I seen a more perfect example of the care with which public bodies expend public (tax) money. The Bay Bridge connecting San Francisco with Oakland is a $6.4bn two-span bridge, connected by Yerba Buena Island in the Bay. It has There is already a bike + pedestrian path on the 2km east span (Yerba Buena Island to Oakland). So why not provide a dedicated bike path on the 1.5km west span?

Why not, indeed. Here (from the proponents) is the case for a bike path over San Francisco Bay:

With the east span finally open, planners are already at work on the next mega-Bay Bridge project - a $1 billion-plus makeover of the western span that would include a $500 million hanging bike path.
"I'm sure the bike advocates are going to start agitating for that" soon, Metropolitan Transportation Commission Executive Director Steve Heminger said
I'm sure they are. Since they're not paying for it, why wouldn't they? And who is going to pay for it?
Drivers are already paying up to $6 at peak hours to cross the Bay Bridge. Redoing the western side to include the bike path would probably mean "putting something in front of the voters," - like a "temporary" $1 hike in bridge tolls, said MTC spokesman Randy Rentschler.
Let's do the maths here. Over a 40 year lifespan, assume that the $500M cost is approximately tripled by maintenance (5% per year, which seems optimistic if anything). Looking at weekday traffic of ~ 250 days per year, that's 10,000 days of cycle traffic. Divide $1.5bn by 10,000 and you see a $150,000 / day cost of the bike lanes. Assuming - in a fit of optimism - that 10,000 bikers per day decide to bike to Oakland, over the bridge and along to their office in (notably steep and traffic-snarled) San Francisco, that's $15 per biker per day. Are they going to charge that to bikers? My arse, they are. This, as Rentschler notes, will be going straight onto the tolls of motorists (as they are a captive audience) who will reap less than zero benefit from this extension. But the San Francisco politicos have a Green source of campaigning dollars to appease, and they're in no danger of being voted out, so why wouldn't they do this?

This is a classic destruction of wealth. That $1.5bn of money could easily be invested into a project with a better social pay-off - or even, horror, returned to the voters to spend in lowered state and city taxes. However the bike path is an irresistably visible and "green" capital project for egocentric politicos to attach their name to. There's no way that it's not going to be built, despite the economic insanity of the project.

2013-09-05

Glenn Greenwald veering off the tracks

I've followed the Snowden/Greenwald/Miranda saga with varying degrees of fascination and disgust - the UK government didn't exactly cover itself in glory in how it intercepted Greenwald's partner David Miranda - and so I was intrigued by Greenwald's latest missive in the Grauniad: "US and UK spy agencies defeat privacy and security on the internet". For a start, I'd have capitalised the "i" in "Internet" but I digress... An amateur crypto enthusiast like myself usually finds plenty of groan room in these kinds of articles, so what is Greenwald discussing, and why is he writing in conjunction with Guardian diplomatic correspondent Julian Borger and ex-Wikileaks "data journalist" James Ball?

According to Greenwald, NSA and GCHQ are heavily involved with defeating encryption with three main thrusts:

Those methods include [1] covert measures to ensure NSA control over setting of international encryption standards, [2] the use of supercomputers to break encryption with "brute force", and – the most closely guarded secret of all – [3] collaboration with technology companies and internet service providers themselves.
I can believe [2] without breaking sweat. Brute-forcing encryption should be the stock-in-trade of any serious spy agency. Even if the opposition encrypts their files / hard disk, typically they have a lousy choice of password because they want it to be memorable and easy to type - two aspects directly benefitting a brute-force attack. Any password typed by a human should make a brute-force attack attractive unless that human is particularly crypto-aware. If you can't decrypt by brute force, another approach is to install a keylogger (e.g. via malware mailed to the user) and catch him or her typing the password directly.

Let's talk about [1], though: influencing international encryption standards. The problem with this idea is that many, many very competent cryptographers are involved in the selection of an encryption or hashing standard such as AES or SHA-3. The overall process may be overseen by US agency NIST, but the decision process and factors are, by design, completely open. Usually there's a fairly clear choice of the shortlist of candidate functions; a cryptographically weak function is likely to have a sufficiently obvious record of theoretical attacks that it would be a glaring anomaly for NIST to short-list it. I could just about believe that NSA could influence the choice between candidates #1 and #2 for the winner, but frankly I don't see it buying them much. There's a theoretical possibility that NSA knew of a better-than-brute-force attack against candidate #2 and "persuaded" NIST to choose #2 instead of #1, but I can't see NIST members accepting that; and the downside publicity would far outweigh the relatively small computational gain in near-brute-force attacks.

It's notable that in the peculiar case of the random number generator Dual_EC_DRBG NIST approved four functions. Three were fine, but the fourth - Dual_EC_DRBG - was the only openly NSA-championed one. It was also very slow, had suspicious "magic numbers", and its output was notably way off the level of entropy (randomness) that it should be. Later analysis by Microsoft cryptographers showed something that looked very much like a back door related to the magic number selection. Why would the NSA champion something that was so startlingly broken? We may never know for sure, but it was as popular as a bacon-wrapped pork chop in Mecca. This was the standardisation process working as intended - everyone was well informed to steer clear of this candidate despite ostensible NSA support.

By contrast I invite the reader to consider the advice of the NSA to IBM to change the data values in the "S-Boxes" forming part of the DES encryption process in 1977. Many years later it became clear that the values NSA had proposed made DES substantially stronger against differential cryptanalysis than the original values. It seems probable that NSA knew of differential cryptanalysis techniques back then, and deliberately made DES resistant to this attack. Why might that be?

Every spy agency wants to eavesdrop on everyone. But there's a trade-off. If everyone's crypto is weak, many other foreign spy agencies will be able to do the same thing; if your country (the USA) is one of the most prominent in world commerce, the limited gain to the domestic spy agency from being able to read commercial communications will be dramatically offset by other countries - Russia, China for instance - where government, espionage and commerce have an unhealthy intersection. It's in the NSA's interest to give good crypto to American firms and, by extension, people. They need to leverage their unique advantages (computing power, mathematical excellence) to target the threats that matter.

By contrast, the Chinese Government blocks most uses of Virtual Private Networks crossing the country's electronic borders, and can block or mount man-in-the-middle attacks on SSL (secure web traffic) connections. Why isn't Greenwald shouting about this? Is it because net censorship and blatant interception isn't interesting if it's a Communist country?

In the interest of neutrality, I'd point out that [3] is justified at least in part by previous NSA behaviour with regard to exported crypto. Back in 1997 it turned out that export versions of Lotus Notes made 24 bits of the 64 bits of the encryption key available to the NSA:

When sending e-mail messages, Lotus uses a 64 bit key. But in export editions, 24 bits of the key are broadcast with the message, reducing the effective key length to 40 bits. The 24 bits are encrypted using a public key created by the NSA. This is called the Workfactor Reduction Field. Only NSA can decrypt the information in the Workfactor Reduction Field. Once the key length is reduced to 40 bits, fast modern computers can break the code in seconds or minutes.
The NSA aren't the only ones making exported crypto weak. Witness the sale of Enigma machines after World War 2 to developing countries by the British. "Hey, here's a totally secure encryption system!" Since Enigma had been comprehensively broken by the British, they could read any cipher traffic they chose...

Summary: storm in a teacup. NSA can't negatively effect international encryption standards in practice, and indeed should have a vested interest in these being strong. They totally do brute-force encryption but this only works for very targeted attacks on personally-encrypted files - they can't realistically brute-force regular HTTPS web encryption. They do try to get NSA-specific back doors into exported crypto, but they've been doing this for at least 20 years that we know of. This is not news.

2013-09-02

Science is about prediction and refutability

The recent Guardian editorial on climate change was a near-perfect encapsulation of everything I think is wrong with the current "scientific consensus" on climate change. Before I start panning parts of the article though, let me start by acknowledging that it does highlight that current temperatures have diverged from predictions, and that we really don't understand why - it doesn't even fall into the trap of translating post-hoc explanations as fact:

There is, however, a serious debate about why the observed temperatures have not kept pace with computer-modelled predictions and where the heat that should have registered on the global thermometer has hidden itself.
On the other hand, however, it fails to nail just how important is the failure of these past predictions to the climate change debate.

Science is about prediction and refutability. You use your best measurements and scientific theories to determine what you think is going to happen; you then make a public announcement and justification of this theory and associated predictions, and the criteria for measuring their success or failure in the designated timespan. We were fairly clear back in the late 90s that everyone was predicting steadily increasing global temperatures, based on the (objectively measurable) amount of carbon dioxide in the atmosphere and its effect as a greenhouse gas. Since then, reality has not dealt kindly with the predictions. There has been warming in parts of the globe, but not elsewhere; global temperatures have been basically flat over the past decade. There have been spikes and troughs, but nothing sustained. If carbon dioxide levels drive temperature rises, and atmospheric CO2 has been climbing steadily, where is the associated temperature rise that this theory would predict?

If reality does not match your predictions, you have to face the possibility that you do not actually understand the system you are modelling. What a lot of people are missing is that when "scientists" go back to tweak the failed computer simulations so that they then correctly model the past years they are not performing science. At best, it's a sanity test for their adjusted models, but it's not a verification in any form. The only way they can repair their reputation is to start over; produce and justify predictions for the next N years, set out success/failure criteria, and wait. I would say that five years is the minimum period for which we should demand a prediction, and ten years is more like it. Therefore we won't know until around 2020 whether the current theories and predictions are any good. Should we base major economic decisions on these conjectures?

I contrast the article's reports of current climate chaos:

Twelve of the 14 warmest years on record have occurred since 2000; the last two years have been marked by catastrophic floods in Australia and record-breaking temperatures in the US; and the loss of north polar ice has accelerated at such a rate that climate modellers expect the Arctic Ocean to be routinely ice-free in September after 2040.
with the reality of thickening ice in the Arctic blocking the Mainstream attempt to row the Northwest passage:
Severe weather conditions hindered our early progress and now ice chokes the passage ahead. Our ice router Victor has been very clear in what lies ahead. He writes, “Just to give you the danger of ice situation at the eastern Arctic, Eef Willems of “Tooluka” (NED) pulled out of the game and returning to Greenland. At many Eastern places of NWP locals have not seen this type ice conditions. Residents of Resolute say 20 years have not seen anything like. Its, ice, ice and more ice. Larsen, Peel, Bellot, Regent and Barrow Strait are all choked. That is the only route to East. Already West Lancaster received -2C temperature expecting -7C on Tuesday with the snow.”
and the lack of hurricanes in the Atlantic this year:
Seasonal predictions were for an above-normal season. The 30-year average is for 12 storms with winds of at least 39 miles per hour, the threshold at which they are named. Nineteen such systems formed in each of the last three years.
The Arctic ice is a particularly interesting case. It seemed very clear a few years ago that the Arctic ice was getting thinner and less expansive every summer, and an ice-free season seemed like a slam dunk. Now, suddenly, the ice is getting thicker again - a lot thicker, jumping back towards the 1998-2010 average. Why is this happening? We don't know, we didn't predict this. Perhaps there's a lot more about the Arctic that we don't understand.

It seems clear that the climate of the world is changing, and it may even be warming. But the degree, if any, of this warming is far from certain. If the world is indeed warming considerably, it's not clear whether we can (in practice) do anything to affect it. If we can do anything to affect it, it's not even clear that we should do anything - if Arctic sea ice melts completely then suddenly we can send a lot more shipping trade north of Canada, avoiding the bottleneck of the Panama canal. If we can't grown corn in the middle of the USA any more, we may be able to grow it far more north in Canada than we can currently. The current media clamour sounds awfully like the syllogism: "Something must be done! this is something, therefore we must do it."

The more I read of climate science, the more I realise that we know sweet F.A. about it. Confusing political propaganda with science is not helping. Mounting witch hunts against scientists sceptical of current orthodoxy ("denialists!") is not science, it's medieval conformism. If your theory is threatened by a few loudmouths then perhaps the problem is not with the loudmouths. True science welcomes debate and rebuttal. That is, after all, how we learn.

2013-08-29

Chemical horror

Today UK MPs rejected military action against the Syrian government despite the recent nerve agent attack killing hundreds of civilians. While I think that this was the right decision in the current circumstances, I've heard a lot of objections to military action along the lines of "civilians get killed in larger numbers by bombs, gunfire, napalm and starvation - what's so different about chemical weapons?" Playing Devil's Advocate, here's my answer.

Chemical warfare generally involves saturating a target area with a chemical agent for one of two reasons:

  1. area denial; making it impossible or at least unattractive for opposing forces to occupy a strategically or tactically advantageous position; or
  2. short-term offense; aiming to kill or debilitate concentrated opposing forces in an attractive location.
Modern chemical weapons such as the nerve agent sarin (one of the possible culprits in the recent attack, and one of the weapons likely used at Halabja) are devastatingly effective against any unprotected people in the immediate area; even gas masks aren't effective, since nerve agents can be absorbed through the skin. Full personal protective equipment is required to protect against a nerve agent attack. Modern armies can afford this for their troops - although the equipment makes them less effective and more susceptible to heat-induced illness - but there's no practical way to protect adequately a civilian population. Nerve agent attacks are therefore very much a 1-shot weapon from a military standpoint, advantageous if they can take opposing military forces by surprise, but with very little sustained effect if the forces are warned and well-equipped.

If an attacker has free use of chemical weapons, and little fear of reprisal, their best tactic is therefore to saturate target areas with nerve agents. As well as nailing any poorly-prepared opposition soldiers, this will force the properly-equipped military to button up in protective gear and be less efficient in communication, manoeuvre and combat. It's not a decisive win, but certainly an advantageous tactic. The side effect of this saturation, however, will be devastating to any civilian position both in the location and downwind. Lacking effective protective gear, casualties in any populated area will be horrendous - and completely irrelevant in military terms.

The international opprobrium in use of chemical weapons is therefore (unusually) for a good reason. It aims to make chemical weapon use, which is normally not a terribly efficient military method but disproportionately devastating in civilian casualties, a much higher cost for offensive forces than conventional weapons. The cost of conventional artillery and airstrikes is roughly proportional to the number of weapons used, and hence incentivises the attacker to target military forces as accurately as possible. Chemical weapons have no such incentive, and so there is a natural incentive to saturate the target area (maximising deterioration of effectiveness of the opposition) which has the side effect of civilian annihilation.

Back to the original question: why is killing a civilian with chemical weapons worse than killing them with a bullet? It's because unfettered chemical weapons use will devastate a civilian population in short order. We have forgotten this because the threat of nuclear retaliation has kept chemical weapon usage to relatively low volumes in the past 95 years. If we want to see many more thousands of chemical weapons deaths, we should treat chemical weapon usage like artillery usage.

Real Internet novices

A rite of passage in a geek's life used to be explaining "the Internet" (in practice, the Web) to parents and grandparents. Nowadays there's enough of a critical mass of email and Web usage that even computer-free grandparents find their buddies talking about emails and photos from their grandchildren at college / abroad, and possibly even exchanging Facebook tips. The youngest generation now grows up with interactive touch-controlled LCD displays (e.g. tablets) and the concept that you can communicate, navigate and send photos from nearly anywhere is taken as read.

There is one group of middle-aged Western people who really have no idea what the Internt is: lifer Federal prisoners since Federal prison regulations forbid Internet use. If you take the year 1998 as the point where the Web and email really went mainstream, anyone who's been in Federal prison for over 15 years as of today has likely had no real experience of the Web:

A handful of San Quentin prisoners took a class about the internet and startups. Through books, presentations, and printouts, they gained a theoretical understanding of the web, but not a practical one. While they still haven’t been online, this basic understanding made it easier for them to articulate just how far off their first impressions were.
We forget just how transformative and mind-blowing the Internet really is, because we have grown up with it - and it has grown up with us. The first real search engine, Archie, actually predated the Web; it was used to locate information in ftp sites. It didn't really index content as we understand it today, rather it was like an efficient directory of hundreds of FTP sites, updated roughly monthly. You had to have a good idea of the likely filename that your required content lived in; once you had that, you could see what FTP servers had that file and where it lived. Because it was a monthly index, there was the perpetual frustration of going to the listed site and finding out that they had moved files around or cleaned them up.

Consider what Internet search can do now, efficiently locating and ranking web pages relevant to your search topic, automatically using synonyms and spelling correction to work out what you actually mean rather than what you're asking for. The number of web pages with meaningful content is staggering; and yet search engines can automatically spot and index updates in days if not hours. We can search images as well as text - sometimes even automatically recognising basic content information of an image without reference to the text around it. The physical location of a website in the world is almost irrelevant: South African sites are indexed side-by-side with Korean, Welsh, Canadian and Tuvalan sites.

In terms of how it has changed human behaviour, "wondering" is usually a very short activity. The answers to "I wonder if it's safe to eat flour with bugs in it," "Why do cats hate dogs?" and indeed a staggering range of things that people wonder are now a few keystrokes and a fraction of a second away. Of course, it has meant that people seeking information have had to learn to apply critical judgement of the quality of the answers. "Go not to the Internet for answers, for it will tell you 'yes', 'no' and 'you suck'." On balance, I think that the increased scepticism of the accuracy of any printed or electronic report, and the consequent death of trust in the traditional news media, is perhaps no bad thing.

I agree with the article's author that we need to do something about Internet access for lifer prisoners. Banning it completely is like banning books completely; you don't want to give them completely free range of access, and preventing inappropriate communication is certainly an issue, but if you plan to ever let a prisoner go free again then equipping him to use the Internet is the very least we need to do if we hope to reintegrate him into society.

I did like prisoner Jorge Heredia's comment though; I'm not sure he realises how accurate his original concept was:

I was completely in the blind about the purpose [of Internet sites]. I thought they were just sites for people to socialize and spend their idle time.

2013-08-28

What's the point of bombing Syria?

I'm getting increasingly concerned at the US, UK and French war drums being beaten in anticipation of bombing Syria to punish them for nerve-gassing civilians. Don't get me wrong, I think that the use of chemical weapons at all is deserving of severe punishment, and if we can identify the military unit responsible for killing hundreds if not thousands of civilians with nerve agents then it should be bombed so hard that "they'll have to pipe in the sunlight"; a good few 2000lb LGBs to break open their shelters, napalm or white phos to burn up the munitions, and a healthy sprinkling of cluster weapons to finish off anyone left standing. At the very least, it will cause other chemical weapons unit commanders to think very hard about whether using their munitions really is in their personal best interest.

However it seems that the Syrian government didn't know this attack was coming, and indeed were rather horrified when it did according to US communications intercepts:

...in the hours after a horrific chemical attack east of Damascus, an official at the Syrian Ministry of Defense exchanged panicked phone calls with leader of a chemical weapons unit, demanding answers for a nerve agent strike that killed more than 1,000 people," the report said.
Now I don't know how much credence to give to this report, but it certainly fits well with observed behaviour; the US and UK now seem very confident that the Syrian government forces were responsible, yet there's no obvious gain - and much potential loss - for the Syrian government itself. Assad and company haven't survived this long by being pointlessly brutal. Even arch-tyrant Saddam Hussein of Iraq had method to his brutality: it was focused on keeping him in power, with him personally shooting senior ministers and officers if he even suspected a threat to him. Bashar al-Assad similarly is a survivor and not one to give Western forces a casus belli to open direct hostilities against him.

Bombing random airfields does nothing to deter the regime from using chemical weapons; quite the opposite. It certainly hurts their war effort, but it wasn't really triggered by government decisions in the first place. The Syrian government can certainly try to get more strict control of their weapons, but this action is punishing the government (however revolting) for actions outside their control. I'm not sure it really sends the right message. I'm also not convinced that the current opposition forces are necessarily the kind of people we want to back.

Update:
Matthew Inman at The Oatmeal pretty much nails my discomfort.

2013-08-23

Regulation is not the answer to IT failure

Widespread gloom and despondency today as the NASDAQ exchange shut down for three hours due to a "glitch":

"I would not want to speculate other than to say this is huge. Everything is halted in the market," said Sal Arnuk at Themis Trading in Chatham, New Jersey. Options trading was also halted, the exchange said.
Guess what? This is what happens if you have a SPOF (single point of failure). If you can only trade your Apple, Facebook shares on the NASDAQ then NASDAQ is a single point of failure for your systems. If you don't want a single point of failure, you have to make it easy to trade on multiple systems.

The WSJ has a few more details:

Nasdaq said it plans to work with other exchanges to investigate Thursday's outage, which centered on a problem with the data feed supplying U.S. markets with trade information, and supports "any necessary steps to enhance the platform."
Nasdaq officials internally pointed to a "connectivity" problem with rival NYSE Arca, according to people familiar with the matter, that led to price quotes not being reported.
Nice muddying of the waters there, NASDAQ. "Work with other exchanges", forsooth. If the problem affected feeds in general, and not just an isolated feed to one exchange, then the problem was at NASDAQ's end. In theory you could get improved robustness by reporting from each exchange to NASDAQ on problems with the feed, but in practice each exchange's clients would notice quickly enough that something was up. If the problem were at Arca's end, it seems odd that NASDAQ would suspend operations. Rumours have it that Arca somehow "locked" an order causing the NASDAQ side to freeze. Unfortunately, that doesn't let NASDAQ off the hook. If you are designing a client-server system then you should plan for clients to do arbitrary and crazy things, especially if you don't control the client code. Your server should tolerate badly-behaved clients, or at least alert you to them and give you the option to force ignoring that client until they have sorted themselves out. Letting a single client freeze the whole system with no work-around for three hours in the middle of the trading day - when all your techs are in the office - is terrible design.

For reference, since the NASDAQ market opening hours are 6.5 hours per day 5 days a week they are open for about 1690 hours per year. Therefore this downtime was 0.18% of the year, bringing them below "three nines" of reliability. If they keep from having an outage next year they should go back to three nines - but it gives you some perspective on the limits of reliability even for a firm where time is, quite literally, money.

What's the answer to this outage? Regulation!

Currently, exchanges can voluntarily choose to have their backup plans reviewed by the SEC, which then audits their technological systems. One potential rule, known as Regulation SCI, would require major exchanges to submit to the audits. That regulation is pending comment.
Lauer said the shutdown should be a wake-up call to regulators to monitor exchanges, which he said have not kept up with the speed of current technology. "We have an overly complex system, and it's complex to the point of dysfunction," he said.
FFS. Lauer may be right about the complexity - actually, I'm pretty sure he is right - but his solution blows chunks. Adding regulators very seldom improves technological problems. For a start, if you have a complex and broken software system, you're not going to be able to evolve it into a reliable system. You're going to have to develop (carefully, with due respect of the Second System Effect) a new system in parallel with the old one, and very slowly and carefully migrate traffic from old to new while detecting and fixing the inevitable bugs and scaling issues. A regulator might be able to make you initiate that process, but sure as little green apples won't make that process any more reliable.

Why not? Let's be brutally honest. What really good software engineer / technical project manager would work for a regulator, employed on a government-standard seniority-based competence-hostile salary scheme, battling with much more highly paid software engineers to make them try to do the right thing? Even if their employer (here, the SEC) has anti-poaching arrangements with the major banks, forbidding them from poaching an SEC tech who works or has recently worked on their compliance, there's nothing to stop Fred from Bank of America informally recommending his ex-colleague Jim at Goldman Sachs that they hire Sheila from the SEC who's been doing compliance testing on BofA and showing unusual technical competence. In return, Jim could tell Fred to look at hiring Sophie from the SEC who's been working with Goldman Sachs, but avoid Hermann at all costs as he's a talentless box-ticking drone.

NASDAQ clearly has software architecture problems, but regulator intervention is not going to fix them. Only commercial competition is going to help. If another firm is willing to set up a small exchange for (say) the top 50 NASDAQ-listed firms, and persuades some major banks to act as market makers, it will slightly increase liquidity in those firms and (more importantly) provide redundancy in the event that NASDAQ trading fails. They may have to plan and provision for NASDAQ failure, handling several times their normal traffic until NASDAQ get back on their feet, but that's feasible. A beneficient side-effect will be that NASDAQ will realise that downtime will no longer just delay trades, but will actually move trades to their competitor and lose them money. If that's not an incentive to improve, I don't know what would be.

2013-08-21

Terrorist mis-management

Pity poor Ayman Al-Zawahiri. Not only is the USA reading his communications, and the Egyptians arresting his brother, he's forced to deal with problems such as those profligate bastards in Al-Qaeda Yemen splurging his hard-earned cash on a new fax machine:

When he took over al Qaeda in 2011, senior U.S. intelligence officials were already pointing out his penchant for micro-management. (In one instance in the 1990s, he reached out to operatives in Yemen to castigate them for buying a new fax machine when their old one was working just fine.)
We never see this aspect of terrorist life portrayed on "24", but I feel they missed a trick here. Think of the missed potential for a gripping scene where Habib Marwan escapes from his hideout with CTU in hot pursuit, but is weighed down by several safeboxes full of receipts and outstanding invoices from his minions which he can't leave behind in case he leaves an expense claim unpaid - or, worse, lets through a claim from Navi Araz for carpet cleaning without a receipt.

Jacob N. Shapiro's analysis makes amusing reading. He points out how terrorism "in the large" increasingly resembles a medium-size business. Perhaps at the top level the leaders aren't worried about filing accounts with the Inland Revenue - unless they have some country's intelligence service providing funding, in which case the audits might be just as bad - but they have to struggle to manage very limited funds to give the best bang per buckriyal, demanding accountability from staff who have practically been selected to be unstable and rejecting authority and order.

Perhaps al-Zawahiri should take inspiration from Hank Scorpio; providing good healthcare and an attractive pension plan for your minions does seem to go a long way towards smooth running of your terrorist organisation, and showing personal concern for their domestic problems does a lot for loyalty. al-Zawahiri doesn't really seem to be a people person; he should rope in someone more personable to supplant him in the day-to-day people management. Alan Sugar, maybe. "Hamas al-Masri: you're fired!" <boom>

I do wonder about this assertion though:

Terrorist managers are also obliged to place a premium on bureaucratic control, because they lack other channels to discipline the ranks. When Walmart managers want to deal with an unruly employee or a supplier who is defaulting on a contract, they can turn to formal legal procedures. Terrorists have no such option.
Were I to run an international terrorist organisation, I'd put a premium on remote management of problems. Specifically, I'd be selecting my heads-of-region based on their ability to deal effectively with problems. Since they are (by definition) not bound by legal considerations, I'd expect the "unruly employee" problem to raise its head only once, and that very briefly. After that they can rely on word of mouth to propagate the result of giving grief to the organisation's management layer. If Mr. al-Zawahiri is reading this, I'd be willing to consult on people management re-engineering for a very reasonable fee; just email me your address, with the email titled "al-Zawahiri's permanent address" so it won't get trapped in my spam filters.