Mobile One-Time-Passwords in Ruby

I recently came across the Mobile One-Time-Passwords project, which aims to make a free, secure alternative to commercial two-factor authentication systems (like SecurID). The thinking is pretty simple: virtually everybody now carries a mobile phone capable of running basic applications, so there’s no reason that such an application couldn’t provide the processing power to generate one-time-passwords based on a shared secret, a PIN number known only to the authenticating party and to the server, and the current date and time stamp.
Great! But it turns out that despite there being libraries to produce server-side implementations of the technology in PHP, Perl, and C, nobody had yet bothered to write one in that most marvelous of programming languages, Ruby.

Well, now I have. So if anybody’s got the urge to add one-time-password based security to their Rails or Sinatra app, or would like to write an MOTP client for their Ruby-capable smartphone: well, now you can.

Copy-Pasting Passwords into Steam

Just want to know how to ‘fix’ Steam’s password field? Scroll down to “How to Fix It”

Steam & Security Theatre

You’re a smart guy. You’re not stupid about computer security. And that’s why you always make sure that you use a different password for every service you use, right? You might even use a different password for every account, even when you have different passwords on the same service. You know that there are really, really good reasons why it’s simply not good enough to, for example, have “high-security”, “general use” and “low security” passwords, and re-use each of them in several places. And if you don’t know that: well, take my word for it and I’ll explain it in detail later.

It’s no great hardship to have lots of long, complex, effectively-random passwords, these days. Tools like SuperGenPass, LastPass, and KeePass, among others, mean that nowadays it’s so easy to use a different password for every service that there’s no excuse not to. So you probably use one of those (or something similar), and everything’s great.
Except for that one application – Steam. I have Steam save my password on my desktop PC (by the time somebody steals my desktop PC and breaks into the encrypted partition on which my data files lie, I have bigger problems than somebody stealing my Just Cause 2 achievements), but it forgets the password every time that Ruth uses her Steam account on my computer. No problem, I think: I can easily copy-paste it from my password manager… nope: Steam won’t let you paste in to the password field.

What? If you ask Valve (Steam’s creators) about this, they’ll say that it’s a security feature, but that’s bullshit: it’s security theatre, at best. And at worst, it means that people like me are inclined to use less-secure passwords because it’s harder to memorize and to type out that a more-secure password would be.

How to Fix It

Well, obviously the best way to fix it would be to successfully persuade Valve that they’re being stupid: others are already trying that. But what would be nice in the meantime would be a workaround. So here is is:

  1. Edit Program FilesSteamPublicSteamLoginDialog.res (Program FilesSteamPublicSteamLoginDialog.res on 64-bit Windows, somewhere else entirely on a Mac) using your favourite text editor (or Notepad if you don’t have a favourite). Take a backup of the file if you’re worried you’ll break it.
  2. In the "PasswordEdit" section (starting at about line 42), you’ll see name/value pairs. Make sure that the following values are set thusly:
  • "tabPosition" "1"
  • "textHidden" "0"
  • style="TextEntry"

The next time you load Steam, you’ll be able to paste passwords into the password field. The passwords won’t be masked (i.e. you’ll see the actual passwords, rather than asterisks), but the dialog never loads with a password pre-populated anyway, so as long as you make sure that nobody’s looking over your shoulder while you type, you’re set!

Update: let’s face it, Valve’s security policies suck in other ways, too. Please read the tale of a friend-of-a-friend who’s desperate to change her Steam username.

Dan Q found GL4ZB9QK Oxford United FC

This checkin to GL4ZB9QK Oxford United FC reflects a geocaching.com log entry. See more of Dan's cache logs.

My favourite cache of the day! A wonderful little adventure!

I’d not noticed when I copied the data to my GPSr that this find was going to involve as much leg-work as it did! Starting in Headington, I collected the clues, zipping effortlessly around the locations by bike. Then, sat on the side of London Road, I came up with the coordinates. HOW FAR? Wow… it’s a good job I’m ready for a decent cycle, today, and I’ve got a few caches down that way that I’d like to collect anyway.

Several miles (and many caches) later I found myself getting close, hoping that I’d not miscalculated or gotten the wrong numbers. When I got close, it became clear to me where it was likely to be hidden: but the recent rain had made the ground treacherously slippy, and I struggled to get the cache, between groups of people walking past, without falling over!

I have no interest whatsoever in football, but I thoroughly enjoyed this cache… as well as enjoying learning a little bit of local history! TFTC!

Dan Q found GL4ZBA6C Son of the The Lonely tree

This checkin to GL4ZBA6C Son of the The Lonely tree reflects a geocaching.com log entry. See more of Dan's cache logs.

Looks like I must have been there JUST before mumzoid970! Following the coordinates, I was standing almost on top of it (well, as close as one can get!) before I thought to look down and spotted it. TFTC.

Dan Q found GL4ZBARC Rock Edge

This checkin to GL4ZBARC Rock Edge reflects a geocaching.com log entry. See more of Dan's cache logs.

Despite the foul weather I really enjoyed exploring this little nature reserve (and not just because it gave me a break from my cross-town cycle!) Photos attached of me by the notice board, down by the cliffs, and of the cliffs with me pointing at them (because otherwise those cliffs could be anywhere; but only I would wear a jacket like that!). Email to follow. TFTC.

Dan at Rock Edge GZ

Dan Q found GL4ZB8G2 Testing (R50) 1, 2, 3

This checkin to GL4ZB8G2 Testing (R50) 1, 2, 3 reflects a geocaching.com log entry. See more of Dan's cache logs.

Found this on my way down from Horspath Nature Reserve. Nothing exciting happening on the test track, but I did notice that the signature before mine in the log was that of Fraig2010, who recently dropped off my Travel Bug at Famous Grouse, the final step of it’s journey! Maybe I’ve just passed him/her…

Dan Q found GL4ZB5QD All Ducked Up

This checkin to GL4ZB5QD All Ducked Up reflects a geocaching.com log entry. See more of Dan's cache logs.

After a hard uphill trek through slippery mud (in inadequate shoes) I got to this easy cache. Lots of stuff in the box, but TNLN. Thanks for giving me an excuse to stop for a break before pressing on to Famous Grouse!

Dan Q found GL4ZB6AQ Famous Grouse

This checkin to GL4ZB6AQ Famous Grouse reflects a geocaching.com log entry. See more of Dan's cache logs.

This cache was a primary goal of mine, today, because a travel bug I set off on it’s travels (a long while back, and in Wales), “The Oxford Scouting Party”, had safely landed here and I wanted to pick it up. Coming up the path from London Road after such rain was a mistake, because the path was wet and slippery, but I got there in the end and found the cache without too much difficulty (although I did need the clue to help make sure I was looking in the right place!). Took my travel bug, left a rubber bouncy ball and a sliding puzzle of a tiger.

And I did get to see a grouse or two on the way up! Two grouse? Grouses? Grice???

Thanks for a wonderful cache and an enjoyable walk.

Dan Q found GL4ZB6WK Old SideTracked – Horspath Halt

This checkin to GL4ZB6WK Old SideTracked - Horspath Halt reflects a geocaching.com log entry. See more of Dan's cache logs.

During a nice stroll around this lovely nature reserve (including a look at the artificial “bat cave” that’s been formed out of the remains of the old railway tunnel), I found this cache after an embarrassingly-long hunt. I choose to blame my GPSr being thrown off by all the trees, but in actual fact it’s my bad observation skills that are to blame for this one taking me so long! Lovely little cache; delighted to have found it!

Bricked-up railway tunnel near a geocache.

Dan Q found GL4ZB4T2 University Challenge 5 (munch munch)

This checkin to GL4ZB4T2 University Challenge 5 (munch munch) reflects a geocaching.com log entry. See more of Dan's cache logs.

I’ve visited dozens of times – I only live around the corner – but never realised that it was a virtual cache. Picture doesn’t include me nor my GPSr because (a) my GPSr (on my phone) is my camera and (b) I couldn’t find anybody to take the picture for me (there was only a confused-looking traffic warden around). So you’ll have to suffice with a picture of the landmark itself…

The Headington Shark.

Dan Q found GL4ZB56N Zed’s Pico Cache

This checkin to GL4ZB56N Zed's Pico Cache reflects a geocaching.com log entry. See more of Dan's cache logs.

Wonderful little cache in a devious little hiding place. Looked in the right place several times before I thought to let a curious finger do the exploring for me! Got strange looks from passers-by and so had to pretend to be on the phone… Great cache: thanks!

Dan Q found GL4ZB5G9 Blowing Away the Cobwebs

This checkin to GL4ZB5G9 Blowing Away the Cobwebs reflects a geocaching.com log entry. See more of Dan's cache logs.

Should have been easy, but not one but TWO cars were parked right in the way of the cache… and one of them was being unloaded by it’s owners at the time! I stood around with my bike, looking like a wally, until they went away, and then squeezed past to find the cache. TFTC.

Dan Q found GL4ZB0YP H. H. Park

This checkin to GL4ZB0YP H. H. Park reflects a geocaching.com log entry. See more of Dan's cache logs.

I love this park in the summertime, but in the depths of a wet winter it was more than a little difficult to get to the cache, and involved wading through ankle-deep water in the swampy area around the cache! Persevered, though, and found it in the end! TFTC.