Archive for April, 2008

Death by Localization

I read a Coding Horror post in March about testing localisation code for Turkey to make sure it’s correct.  Apparently Turkey has one of the hardest languages to write Internationalisation code for.

Anyway, it appears that a localisation fault on a mobile phone in Turkey has resulted in two deaths and three jailings.  Warning - bad language in this link!

Wow.  That’s a very bad side-effect…

CNN T-Shirts

From a few places comes news that CNN is selling t-shirts with news headlines on them.  An interesting/unusual idea, sure, but they’ve done one thing very wrong.

The text on the shirt is part of the URL.

All of which means I can presumably order (but at least create an image of) a shirt that says, “CNN slept with your mum” or “I like short shorts”.  The shirts come with a line underneath the headline that says, “I just saw it on CNN.com” and the date of the news story.  A person could have fun with that…

Now I’m all for RESTful architecture when it’s appropriate, but there should really be some checking to make sure the headline exists…

Damo

A Good Stack Overflow

Two of my favourite blogs have announced in the last few hours the upcoming launch of www.stackoverflow.com and I, for one, am excited.

The site will be a combined effort by two of the legends in the software design world, Jeff Atwood and Joel Spolsky.  Jeff runs the well-known Coding Horror blog, and Joel is chief guy for the Joel on Software blog as well as CEO of Fog Creek.  They’ve decided to combine forces to start a community site that’s essentially a free programming Q&A site.

Every programmer knows the recurrent problems encountered when searching for a programming dilemma in Google with the hopes of finding an answer.  There are a couple of problems that haunt me constantly.  Joel mentions in his blog post the situation where you find your exact problem and potential answers on sites that require registration and paymentExperts Exchange is a classic for that; so much so that I generally use some google-fu to remove any Experts Exchange pages from my search results when searching for solutions.  Don’t get me wrong, I’m sure Experts Exchange has some fantastic content, but I can’t justify spending that much money to save me a few hours every few months.

The other problem I encounter time and time again are the forum posts with no solutions.  Often, when I search for a specific problem in Google, I’ll get a ton of results that appear to exactly match my particular issue.  Excitedly, I’ll open them all up in new tabs and go through them looking for the bit of code that will be my saviour.  Far too often, the threads don’t provide answers at all - just a community of people lamenting the same fault and looking for cures.  Even more frustrating are the instances when the initial poster finishes up the thread with a post along the lines of, “Thanks everybody, but I found out how to do it” without providing the solution.

Hopefully, this site will hasten a timely death for these frustrations.  If there’s anyone I’d want on the case, it’s these two guys.

Damo

CAPTCHA is Dead, Long Live PAPTCHA?

Slashdot today carries a link to a story claiming that the CAPTCHA algorithm for Hotmail (or Windows Live Hotmail or whatever it’s called now) has been defeated by a spambot and the exploits have started.  So that’s Gmail, Yahoo Mail, and now Hotmail.

CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) is a great idea, but if it doesn’t work, then it doesn’t work.

CAPTCHAs were developed to tell humans apart from software.  They’re essentially a Turing Test across a very limited domain, and because of the limited domain, they’re much easier to attack.  In the case of a standard warped-text CAPTCHA, the attacker knows that the challenge will be an image with a certain number of letters and/or numbers, and that it will be warped in one or more ways.  The software can be written with this in mind.  Additionally, even if there is only a miniscule success rate, it’s often worthwhile for a spammer, particularly if attempts can be automated and run several times a second.

So what’s the solution?

Slashdot made a tongue-in-cheek reference to Kitten Auth, suggested in 2006.  It may have been a playful suggestion, but I think they’re on the right track.  Kitten Auth basically presents the user with a number of pictures of cute fluffy animals, and tells the user to select all the kittens.  The premise is the same as the text-based CAPTCHAs - easy for humans, hard for computers - but it doesn’t use text, making OCR useless.

Something like Kitten Auth could work as long as there’s no predictability.  If the same images are repeatedly used, a brute force attack would work.  If you needed to select three kittens out of nine pictures, all you need is one random success and bam, you have copies of three images that are kittens.  Given enough time, the software could learn enough images to be viable as a solution.

Alternatively, if OCR can be trained to learn letters and numbers that are very warped and modified, then why not pictures of kittens?  It’s harder, sure, but if we mere mortals can tell a kitten apart from a possum, then why not a computer? These spammers and malware authors are pretty determined you know.

So what else?

Maybe the problem with CAPTCHAs is the “CA” part.  Completely Automated.  What about PAPTCHA? Partially Automated. Sure, it ruins the contrived acronym, but it might be more effective.

Arguably, Kitten Auth is already an PAPTCHA.  The pictures of kittens can’t really be completely automated unless there are 3D models of kittens rendered from different angles with different lighting each time… hmm… that’s an idea… but I digress.

If Microsoft and Google and Yahoo were to put some effort into changing their “PTCHA” regularly, by real people, maybe there’s a solution.

Here’s how it could work:

  • Twenty people, armed with cameras, walk the streets for a few hours taking photos of random objects or scenery.
  • They get back to the office and upload the photos to today’s collection.
  • They link each photo to some standard questions (e.g. “what is the main object in this photo?”) and provide acceptable responses.
  • They provide additional specific questions for each photo (e.g. “How many white horses are there in the field?”) and provide acceptable responses.
  • One or more other staff members look at the photo and each question for quality control.  They can add more acceptable answers, remove them, or reject photos or questions outright.
  • Photos are retired after a time to prevent them being learned.

As a very rough estimate, I’d expect that a person would be able to add at least fifty photos with ten questions each every day.  With 20 people, that equals 10,000 new PTCHAs every day - 50,000 per working week. Surely that’d be enough.  Is 20 people too many?  Even with five people you’d have 12,500 new challenges every week.  If you expire the questions after a month, you’d still have an incredibly large number to choose from.

Current CAPTCHAs effectively have an infinite number of possibilities, however they’re still in a narrow domain.  By expanding the domain to include any question about any photo, there’s no pattern to learn - no possible algorithm to solve the problem.

Is it foolproof?  Definitely not.  However, I’d suggest that implemented properly (and that means a lot of QA), it would be a lot harder to break than current CAPTCHA methods.

There could be a business in this you know… I’d be interested to know what you think!

Damo

Edit: I’ve been having a discussion with a friend of mine who has outlined exactly why 50,000 new challenges per week is not enough.  In short, if x people are creating these challenges, then some fraction of x can be employed to decipher them (answering is quicker than asking).  The answers get added to a massive database along with copies of the images, and there’ll be enough solutions saved to give some malicious code a decent success rate.  If the image and question match one in the database, then the answer will be there.

Repetition of challenges is therefore a significant problem.  A challenge that presents an “image and question” that is repeated every 200,000 requests (4 weeks of 50,000 per week) is far too repetitive.  If the malicious code runs one request every fifteen minutes on 1,000 nodes, you’d have seen every challenge in just over 2 days.

So to overcome this, here are some ideas:

  • Use existing CAPTCHA technology such as warping the question text and putting it directly on the photo in a semi-random place.  You’d get no exact repeats.  The obvious problem is that this may still allow a malicious program to recognise sections of the photo that haven’t been altered.  With every photo and answer saved, there’s still a one in ten chance (given 10 questions per photo) of getting the question right.  Very unacceptable.
  • Warp not only the text, but the image as well.  Obviously it’d still need to be recognisable, so overlaying a random, semitransparent pattern or something might be all you could do.  It might be enough to slow down matching of the image though.
  • Include a bevy of questions that bear no relation to the image.  These could be added to any of the images.  For example, you could have a picture of a field of horses which renders with the question, “How many legs are most people born with?”

So now I have a system where a modified image is rendered with an overlayed warped-text question which may or may not have anything to do with the image.

Of course all I’m really doing is adding complexity, but as long as it’s complex enough to withstand attacks for the length of time it’s used (one month in my example), it should work.

My other suggestion, the CG kittens, got more interest.  In this case, there would be essentially no repeated images.  You’d probably only need a handful of animal models with a few variables set at random to make it feasible.  Perhaps fur colour, lighting, camera position, and some posture or face variables.

Teach your staff about BCC

Every now and then I’ll get an email from someone that’s been addressed to a number of people. I can tell how many and who they are because all of our email addresses are listed in the “To:” header. My email address has been sent to a list of people I don’t know.

There are a couple of reasons I don’t want my email address broadcast to the world.

Spam et. al.

I often don’t know many of the other people on the list, and more to the point, I don’t know anything about their computers. It’s possible, probably likely, that in an email addressed to 20 people, at least one of them has a fairly insecure computer and probably has at least one virus or a trojan. When the insecure computer receives the email, my email address going to be visible to this malware.

In short, I can have the best and most robust security on my computer, and I can ensure my email address is never published on the web, but all of this is useless if a single person sends my email address to a compromised machine.

Email addresses can be personal

I may be in the minority here, but I maintain a large number of email addresses. Having my own domains means that I can set up separate email addresses for job applications, friends and family, work, web enquiries, and so on. Right now, off the top of my head, I can think of about twenty email addresses that I use regularly. Most are simply forwarders, but they allow me to categorise incoming emails efficiently.

The other thing this lets me do is control communication. If I am wary about giving a company or a person my email address, I’ll create a new one. If I start getting emails I don’t want, or if for some reason I don’t want them to contact me any more, I can delete the email address.

Now you can see the dilemma. If I’ve given a particular email address to one company and they broadcast it to other people in a group email, I lose control.

Easily Fixed

If you’re reading this blog, I’d be surprised if you didn’t know about BCC, but I’ll summarise just in case.

When sending an email, you can put recipients’ email addresses into the “To:” field, the “CC:” field, or the “BCC:” field. “To:” and “CC:” behave the same, but “CC:” indicates that the person is being given a “carbon copy” - a legacy name from the paper days.

“BCC:” stands for “blind carbon copy”. These people will still receive the email, but the email addresses in this section will not be included in the header. They will be kept private.

The problem of sending everyone’s email addresses out with the email is obviously easily fixed. Just put all the email addresses in the “BCC:” section. For emails amongst groups of friends and family, it’s often not a big deal, but in business it’s frankly unprofessional.

Design flaw

People still don’t know about BCC. I sometimes feel compelled to educate the sender of a group email about BCC and the usual response is surprise. They usually aren’t even aware of this function.

I think the problem is deeper than just a lack of education. There are fundamental design flaws here. Now, email is old - Wikipedia claims that it’s been around since about 1965. So I’m not going to suggest any fundamental technical changes. Such changes would be infeasible in a system that a) works, and b) is older than the Internet.

A significant part of the problem is that it’s called “BCC”. What the hell does that mean to the average person? Even expanding it to “blind carbon copy” doesn’t really help - it doesn’t describe its behaviour.

“Carbon copy” is relatively easy to understand. It’s at least reasonably clear that the people in this section will be getting a “copy” of the email - it’s not directly addressed to them, but they’ll see it anyway. But what does “blind” mean? That it will be invisible? It’ll be transmitted in Braille? People won’t know what BCC does until they’re told.

The other problem I can see is that “BCC:” isn’t presented as a default field in many email clients. The main email clients I use are Outlook and Gmail. In both cases, “BCC:” must be explicitly turned on.

Solutions

  1. Change the name.
    “BCC” doesn’t mean anything - even when it’s expanded to “blind carbon copy” it doesn’t mean anything.
    Obviously, this change can’t be fundamental, but it can be cosmetic. If an email client changed “BCC:” to “Discreetly To:” or something similar, it might help with people’s understanding.
  2. Change the behaviour.
    In an office environment, group emails to external domains should, by default, include everyone in the “BCC:” field rather than the “To:” field. If that’s too extreme, it should prompt the user, suggesting that perhaps they don’t want to share the list of email addresses with all the recipients. At the very least, hiding email addresses from the other recipients should be a very visible option.

In the meantime? Teach your staff about BCC. Make sure they use it when it’s appropriate.

Damo

Wordpress Upgrade

So I finally bit the bullet and upgraded the version of WordPress.  This blog is now running the brand spanking shiny new version 2.5!

I’ve gotta say, the upgrade went really, really smoothly! Literally about 10 minutes from thinking about doing it to now (including download time)

While it’s far from a one-click upgrade solution, it is very straightforward.

Having said all that though, I’m dreading the upgrade of the QUT Volleyball WebsiteThe most dangerous thing about these upgrades is apparently the plugins - and the QUT Volleyball Website is filled with them.  Videos, Polls, etc.

I’ll let you know how that one goes when I finally get the courage!

Damo

Metaphor Use

I was doing some blog-hopping the other day and came across an old post called “The Scott Adams Meltdown: Anatomy of a Disaster” on the Ask Tog site.

Basically, Scott Adams (creator of the Dilbert comics) had an incident in early 2006 where he accidentally (permanently) deleted a post as well as 500 comments that were attached to it.

Tog identifies a “misleading metaphor” as one of the issues and highlights the importance of using appropriate metaphors when designing software and educating users on how to use it.

Several articles in his site talk about other misleading and confusing metaphors and how they contributed to bugs or problems, and it got me thinking about the use of metaphors a bit more.

Now, I’m a big fan of metaphors - I use them constantly, particularly when I’m talking about anything IT to a “layperson”. Communication between “nerds and normal people” is something that is typically not handled well. Frequently the nerd doing the explaining gets frustrated at the user’s lack of understanding and the user gets frustrated at the jargon and poor explanations. Metaphors can help, but only if they’re used properly. Similarly, when writing software, user-interface metaphors are frequently used. Think of the recycle bin in Windows or the Home button in your browser. These are (usually) effective metaphors.

My sister is fairly heavily involved in AFL. She was talking the other day about how coaches teach young kids the correct techniques for handballing and marking. They tell the kids to imagine the ball as a spaceship and the little valve in the middle of the laces as the spaceman. When you’re kicking, the spaceship should be pointing up, and the spaceman should be pointing to where you want to kick it.

The problem with this is that the intended behaviour doesn’t match the metaphor terribly well. A spaceship should point where it needs to go, right? In fact, the spaceman should probably point in that direction as well. Essentially, you’re telling kids to imagine the ball as a spaceship, but a spaceship that doesn’t really mimic the behaviour of a spaceship. It’s misleading.

It gets worse though. When they teach the kids to handball, they tell them to hold the spaceship in one hand with the spaceman at the top up and the spaceship pointing in the direction it needs to go. Ok, not bad so far. Then, they tell the kids to imagine there’s an icecream in their other hand. To handball correctly, they should smash the icecream into the back of the spaceship. What?

I don’t think I need to point out the problems with that one.

This, to me, is a series of very poorly thought-out metaphors. A metaphor should be something that someone can relate to to help them understand the concept in question. The properties and behaviour of the metaphor should closely resemble the model you’re trying to present. This is why metaphors like “bookmarks” in browsers and “address books” in email programs work reasonably well, and others like “Clippy” (Word’s abandoned instructional paperclip) confused many users.

Damo

Mid-20s?

Yeah, I finally bit the bullet and changed my blog tagline…

ramblings of a mid-late 20s IT nerd / volleyball junkie / semi-professional drinker

…how depressing… ;)