Recovering keystrokes from audio recordings

Those trying to compromise the integrity of computer systems have a large variety of attack options to work with: everything from mathematical approaches to breaking cryptography, to TEMPEST attacks based on unintentional signal radiation, to social engineering methods designed to trick people into granting them access. A recent Economist article highlights a danger likely to be unfamiliar to most, namely how it is possible to convert audio recordings of typing back into text:

Such snooping is possible because each key produces a characteristic click, shaped by its position on the keyboard, the vigour and hand position of the typist, and the type of keyboard used…

That said, the method does have one limitation: in order to apply the language model, at least five minutes of the recorded typing had to be in standard English (though in principle any systematic language or alphabet would work). But once those requirements are met, the program can decode anything from epic prose to randomised, ten-character passwords.

The software being employed seems fairly clever. It augments the audio data with frequency analysis, based on how often individual letters and specific pairs of letters come up in English text. With refinements, it seems plausible that it could be made to work with a smaller sample.

Making a computer system secure against a capable and resourceful attacker is extremely difficult. That said, the basic principles of security continue to hold. For instance, using defence in depth can reduce the severity of any breach – for instance, by keeping critical files encrypted. Also, it must always be remembered that security involves trade-offs. Increasing security against these audio attacks is no different, and it will always be accompanied by some cost, in terms of finances, convenience, or security of a different type.

Saturday Morning Breakfast Cereal

While I am sure it will be old news to some of you, I recently came across this web comic and found it amusing and geeky, though sometimes crude.

Here are some of the strips I found funny. Note – many of these may be considered offensive by some people:

The strip is nearly always cynical, and sometimes horrifying, but amusing when one is in the right frame of mind.

BOLO 2010 photos

My photos from yesterday’s blogging event are on Picasa:

I think I managed to get a shot of everyone who read, with a few of the crowd thrown in. Some more photos are in a Facebook album. I also have photos from last year’s event.

My thanks go out to David Scrimshaw, who had the cleverness and boldness to point a couple of the ceiling-mounted house lights at the microphone, greatly facilitating the photography of all present. Indeed, there were very few annoying flashes.

If anybody wants full resolution files, they can contact me. Keep in mind, the original files are about 10 megabytes a piece, at 5616 x 3744 pixels. Also, my internet connection is in terrible shape. Getting these on Picasa took hours, and many false starts.

They were pretty much all shot between 6,400 ISO and 25,600 ISO. I was expecting the venue to be a bit brighter, so I brought my 70-200 f/4 lens, whereas my 50mm f/1.8 might have been a better choice.

Blog Out Loud Ottawa 2010

Blog Out Loud Ottawa 2010, which I mentioned before, went very well. My thanks go out to Lynn from TurtleHead for organizing it, bringing together twenty four readers and dozens of audience members.

All the night’s readings were good, but some of my favourites were:

I had heard Evey’s entertaining Bus People on the radio a few days before.

I was the only one who presented a political post written in an editorial style – Why conservatives should love carbon taxes. Perhaps next year I will have some company. After all, blogs can be turned to serve many purposes, including advocating changes in public policy.

Spaces after a period

Why did anybody ever put two spaces after a period, when typing?

Because of typewriters. Indeed, one name for this approach to sentence spacing is ‘typewriter spacing.’ Typewriters tended to use fixed-width fonts, in which each character takes up as much space on the line as every other. Each character is in its own little rectangle, like on a piece of graph paper. When text is presented in such a way, it arguably makes reading easier to have two spaces after periods.

Computers rarely use fixed-width fonts. The most common example (Courier New) is often used for purposes where seeing spacing is very important, such as when writing computer code. For text meant to be used by human beings, proportional fonts are superior. In these, letters take up different amounts of space, with narrow letters like ‘i’ taking up fewer pixels of width than wide letters like ‘w.’

In this situation, there is no reason to put two spaces after periods. The practice is obsolete.

So, why does it endure like a virus continually making the rounds? I would guess that institutional conservatism is the answer. Organizations like government departments adopted typewriter spacing decades ago, and never changed over. Similarly, typing classes in the world’s elementary schools may well be taught by people who originally learned to type on a typewriter, or who were themselves taught by someone who did.

Personally, I hope typewriter spacing eventually manages to fade away. It is especially annoying when you have to incorporate text from a typewriter spacer into a document mostly written using modern spacing. You have to do a find and replace operation to substitute single spaces for double ones, then manually scan through the altered text to verify that nothing barbarous has resulted.

On emotional control

The New York Times has an interesting piece today on emotional regulation. While being able to prevent sudden emotional outbursts is clearly a beneficial ability in general, the article points out how those with too much emotional control can alienate others, especially younger people who have not yet fully developed their own emotional control systems:

Socially speaking, in short, the ability to shrug off feelings of disgust or outrage may suit an older group but strike younger people as inauthentic, even callous.

It is an interesting observation and has the ring of truth to it. While we certainly don’t want the people around us to panic or freak out for unimportant reasons, it is not surprising that they might make us suspicious be responding in an overly cool way to emotionally fraught situations.

Does caffeine work?

You Are Not So Smart is a blog that seeks to catalog the many mental failings of human beings: from the confirmation bias to our ignorance about our past beliefs.

In one post, they argue that caffeine (coffee, specifically) mostly just alleviates caffeine withdrawal. Rather than lifting you up from ‘normal’ to a more wakeful state, it just brings you back to normal, from the depressed state that caffeine consumption establishes as your new norm:

The result is you become very sensitive to adenosine, and without coffee you get overwhelmed by its effects.

After eight hours of sleep, you wake up with a head swimming with adenosine. You feel like shit until you get that black gold in you to clean out those receptor sites.

That perk you feel isn’t adding anything substantial to you – it’s bringing you back to just above zero.

Neurologist Stephen Novella echoes this position on his blog:

The take home is that regular use of caffeine produces no benefit to alertness, energy, or function. Regular caffeine users are simply staving off caffeine withdrawal with every dose – using caffeine just to return them to their baseline. This makes caffeine a net negative for alertness, or neutral at best if use is regular enough to avoid any withdrawal.

As an experiment, I am going to try abandoning caffeine for a week or so. I will report on any notable effects, though it is always hard to determine which observed changes in ones mental life are the consequence of any particular change in circumstances, given all the complexities of life and all the failings of our mental faculties.

Shots left on the 5D

The 5D Mark II is a great camera, and I have really enjoyed using it so far. The low-light capabilities are excellent. Even shots taken at 6400 ISO are not excessively noisy, and shots taken at 800 ISO look essentially perfect. That is useful for shooting at smaller apertures in situations without all that much light.

One very minor flaw, which is nonetheless annoying, is that the indicator for the number of shots left before your memory card is full tops out at 999. Even at full resolution, my 8GB compact flash card can store well over 1,000. People with 16GB or 32GB cards must be even more annoyed. You can argue that you only need to start worrying about how many shots you have left once that number falls between 1,000, but it still strikes me as bad design. For instance, if you were on a multi-month expedition somewhere far from computers, it would be useful to know how much space you have left each day.

If they are hell-bent on keeping the display to three characters, I would recommend expressing it as a percentage. Seeing ‘80%’ or ‘60%’ is a lot more useful than having ‘999’ flashing at you all the time.

Mark III designers, are you listening? If so, I would be very happy to serve as a tester for any prototypes…

Khan Academy

Khan Academy is a collection of over 1,400 miniature lectures, delivered by one man via YouTube. They cover topics that range widely, in disciplines including mathematics, chemistry, biology, statistics, history, finance, and physics.

From the twenty or so I have tried, they seem to be quite accessible, at least for those with a basic grounding in mathematics. I had never covered matrices in high school or university math, but the videos in the linear algebra collection have left me with what feels like an adequate theoretical awareness of what they are, why they are useful, and how they fit into mathematics more broadly.

The whole collection is worth a look.

How good is gas?

Per unit of electricity generated, natural gas is the lowest-carbon fossil fuel. Producing a kilowatt-hour (kWh) of electricity using oil, and especially coal, generates significantly more emissions. While bituminous coal produces about 370g of CO2 per kWh, oil produces about 260g, and natural gas produces about 230g.

A recent MIT report focuses on switching American electricity production to gas, as a way of reducing greenhouse gas emissions:

In the results of a two-year study, released today, the researchers said electric utilities and other sectors of the American economy will use more gas through 2050. Under a scenario that envisions a federal policy aimed at cutting greenhouse gas emissions to 50 percent below 2005 levels by 2050, researchers found a substantial role for natural gas.

“Because national energy use is substantially reduced, the share represented by gas is projected to rise from about 20 percent of the current national total to around 40 percent in 2040,” said the MIT researchers. When used to fire a power plant, gas emits about half of the carbon dioxide emissions as conventional coal plants.

They claim that nuclear power, renewable energy and carbon capture and sequestration are all more expensive than gas, and thus less viable as low-carbon alternatives. They also claim that by 2050, 15% of the U.S. vehicle fleet will be fueled with natural gas.

I have three big objections to all this:

First, an increasing share of natural gas is coming from unconventional sources, using techniques like hydraulic fracturing. This has associated environmental risks, such as the contamination of groundwater.

Secondly, the amount of climate change humanity will cause depends on the total amount of all fossil fuels burned before society becomes carbon neutral. Burning more gas obviously contributes to this cumulative total, changing the atmosphere and climate in ways that will endure for thousands of years. If humanity ever starts to burn the methane embedded in permafrost of methane clathrates, the total quantity of associated emissions could be very worrisome indeed.

Thirdly, building new gas-fired power plants perpetuates fossil fuel dependence. It keeps us wedded to fuels that are inevitably going to become ever more costly and destructive to access, and which can never form the basis for a truly sustainable society.

None of this is to say that gas has no role to play in dealing with climate change. In the short term, substituting gas for coal may be a promising way to reduce emissions during the transitional period before renewables become dominant. In the long run, however, there is no alternative to moving beyond fossil fuels.

Helpfully, the MIT report does not just take energy demand as constant, or ever-increasing. Rather, they model the economic effect of putting a price on greenhouse gas emissions, and find that doing so would keep demand flat in the next few decades. They project that carbon pricing would raise electricity prices by 30% by 2030 and 45% by 2050 – a small price to pay for reducing the extreme risks associated with climate change.