Category Archives: Computing - Page 5

ATM Phishing

You’ve probably heard of ATM fishing by now. If you haven’t you should have. It typically involves placing a card reading device that is designed to blend in perfectly with the ATM. Then a camera or other device is placed that records the PIN of the user as they type it. So effectively while the user is entering their credentials into the ATM they are unwittingly entering them into a scammers database.

In a flash of inspiration last night I think I may have found a solution! My first instinct was to put a poster next to or on the ATM that shows what the ATM looks like. There are a few problems with this though. First, the scammer can simply replace the poster, secondly only the security concious will check it. So this is really a non solution.

So what if you placed pictures of critical parts in the software and display them when the user first puts in their card. Show a shot of the card insertion point, the keyboard and and overall picture. Scammers can’t simply place a poster over the screen as the user needs it to use the ATM. You ask the user to confirm all the pictures and if any don’t match you don’t let them enter their PIN, and possibly eat their card.

I’m not sure how this would work in practice. If the recent response to Vista’s UAC is anything to go by people will probably just click accept on anything. This may get the pictures in their face though. So after seeing this many pictures of ATMs they might more easily notice something amiss. Maybe its a bit ambitious, maybe its not quite scammer proof. What do my readers think?

Random Thought: I’m getting an Android phone because it runs on an ARM CPU. That and my Windows phone is on its last LEGS.

Fedora 12 Alpha

So recently Fedora released the alpha of their latest OS. I’d been running rawhide for quite a while. Of particular interest is that my RS690 no longer flickers when I move a window that includes an alpha channel, and no longer randomly crashes. I’ve still got to disable modesetting but modesetting currently only stops me from enabling desktop effects.

Particular points I’m enjoying:

  • The desktop wallpaper that has squares on an angled surface is very appealing. The other new desktop wallpapers are very eye catching too.
  • Having 3D rendering working properly on my laptop.
  • The new Fedora 12 Login Theme is music to my ears (except when I have my laptop speakers turned up and it reverbs horribly).
  • EXT4 support seems a bit stronger. Of particular importance barrier based sync now works on LVM metadevices.
  • Dracut has made no discernible difference to boot times and ability to boot.
  • resize2fs is now able to shrink an ext4 partition. system-config-lvm now recognises ext4 and allows resizing it.

Particular points I’m not enjoying:

  • Eclipse is unstable and keeps crashing.
  • Turning off the menu icons in GNOME seems like a bad idea, it makes it harder to recognise each menu.
  • Modesetting stops me from using 3D effects.
  • You can’t drag icons from the menu to the panels or the desktop any more.

C++ Internal Classes

C++, like Java, allows you to have internal classes. You can implement them by simply including the class in the .cpp file and not in the header file. Yep, its that simple. If you try this you will probably realise that you cant include the class as a data member. This is because when you try to include it in the class the internal class hasn’t been declared yet. That’s easy to fix, you can prototype a class by simply adding class ClassName;. Why am I telling you this? Because its an interesting design pattern, and that inner class is called a “Cheshire Class”.

The Cheshire Class is a hidden internal class. This doesn’t immediately sound useful, until you think about how C++ handles private variables. When you add a private variable to a class, even though it is not visible to the calling application, it still affects the structure of the class and hence all the code that links against it will need to be recompiled. The Cheshire class prevents this by keeping all your private variables in a private internal class. See this Example:

outerclass.h

#ifndef OUTERCLASS_H_
#define OUTERCLASS_H_

class InnerClass;

class OuterClass {
private:
  InnerClass *internal;
public:
  OuterClass();
  virtual ~OuterClass();
};

#endif /* OUTERCLASS_H_ */

outerclass.cpp

class InnerClass {
public:
  int privateVariable;
};
OuterClass::OuterClass() {
  internal.privateVariable = 0;
}

OuterClass::~OuterClass() {

}

Now instead of adding new private data to the outer class, you add it to the inner class. This way your header stays the exact same, the data structure never changes.

Note that this does take up more space, and takes a little longer to resolve because it has to jump via and extra pointer but sometimes it is worth it for that nicer solution.
Random Thought: Which is more valuable, bread or gold? Why? Which is more useful?

Songs in Code

I had assignments to do this weekend, so I’ve ripped the best from #songsincode twitter. Enjoy!

antallan: substring(“the tiger”,6,1)

elephanti: try { me.add(shirt) } catch (TooSexyException e) {}

elephanti: if (you.near() || you.far() || you.getLocation() != null) { myHeart.setGoOn(true); }

codepo8: if(dogs.location==’out’){instigator.enquire()/*repeat if needed*/}

elephanti: sweetDreams = SweetDreamsFactory.getInstance().generate(these));

jorgelamb: GET /whatImLookingFor HTTP/1.1 -> HTTP/1.1 404 Not Found

mediadonis: HTTP/1.1 417 Expectation Failed | Location: http://getsatisfaction.com

geekyjohn: function checkColour(colour) { if (colour==’black’ || colour==’white’) { doesntMatter=true; } }

dudester: if ( strcmp(living, “without you”) == 0) strcpy(i, “can’t live”)

akselsays: if (touch==ground) and (me==on_the_hunt) and (me==after_you): smell_like_i_sound(lost_in_a_crowd=true) me = HUNGRY(wolf=true)

Spiiikey: while(self.location <> yourdoor.location) walk(miles(500)); falldown();

nigelwatson: if ( car.colour == ‘#FF0000‘ && car.size == ‘big’ ) { me.ride.like.add(car); }

jblyberg if (!$you->can_dance || !$you->will_dance) { $me->friend($you) = FALSE; }

yahelc: If(you.happy()&&you.knowit()) you.clap(hands);

kirilnyc: ["they call me %s" % n for n in ('girl','Stacey','her','Jane') if n != my_name]

benuphoenix: if content_of_whispered_words$ == “wisdom” then let it$=”be” ;

Random Thought: Twitter: Making your blogging just that little bit easier.

Pet Projects

One thing I’ve observed of people around me who are extremely passionate about computers is that they all have pet projects. For some its their work on an open source project, some maintain distribution packages, others run useful websites and some even attempt to found companies. I’ve had a few pet projects through my years.

Early in my high school education I discovered Microsoft Visual Basic 6.0. This was my original programming language and where I learnt the basis of my programming skills. Using Visual Basic I wrote many programs, some useful some utterly useless. I remember writing a chat program, a scrabble optimiser, a remote PC control application and several games. Unfortunately an over zealous system administrator saw many executables in my home directory and decided I had been infected by a virus and wiped the whole directory. Unfortunately as much as I protested and complained the files were never restored and they are all lost forever.

As I was completing my high school years I ran a web game with two fellow classmates of mine. We spend most of the second half of the year designing it and I spent my exam period implementing it. We managed to keep it running for a year until we ran out of funds (we were all studying) to support it. The game had several limitations and some major design flaws. I’ve entertained thoughts of setting it up once again many times, but ultimately without my two partners (one of who I’ve lost touch with) it would never work. In addition all copies of the original source code have been lost.

Now we come to my favourite project of all. WeatherMon was written for my Dad. He had bought a weather station that had a PC link and this enabled me to get the data into our server. Not only is WeatherMon‘s source code still available it is still running to this day. It was also my first foray into AJAX and XML. WeatherMon does not reload the page at all, and all data transferred is either images or XML. I’ve got a write up all about it here.

Finally, it began as a school assignment but I took it way too far. Originally I had implemented it as a web service, which I then extended to a website, then I made the XHTML so that it could easily be themed and finally I implemented several themes. You can read about converter here.

I think pet projects are what differentiates the passionate from the crowd. Anybody can write programs, and anybody can go to work and do it there. It takes the right person to want to toil outside hours on something that isn’t earning them any money. I think the best thing you can do to further your abilities and your career is to start a pet project. It doesn’t have to be thankless, or useless but that doesn’t mean it can’t be. Its easy, submit a patch to an open source project, become a maintainer for a project lacking development, fork a project, start a website or even start your own open source project.

Random Thought: How tasty is the definitive Open Sauce?