zaterdag 17 juli 2010

Nomad Warrior

We should be able to work and play anyplace, in many circumstances. This planet could be our mobile office.

maandag 12 juli 2010

GPS logging as part of my self tracking setup

Here's a quick overview of the GPS logging part of my self tracking setup.

GPS logging
I'm using InstaMapper on my Android phone to track my position (every 30s).

Downloading GPS data
A few times a day, a shell script downloads the position data in CSV format using the InstaMapper API.
A typical CSV file looks like this:
2422576166695,Nexus One,1278915999,50.93014,3.63114,55.0,1.5,275
2422576166695,Nexus One,1278916059,50.93017,3.62980,52.0,1.7,274
2422576166695,Nexus One,1278916120,50.93022,3.62837,51.0,1.5,253
2422576166695,Nexus One,1278916181,50.93052,3.62713,58.0,1.8,285
2422576166695,Nexus One,1278916241,50.93049,3.62579,67.0,1.5,285
2422576166695,Nexus One,1278916301,50.93077,3.62449,54.0,1.2,260

Enriching GPS data
Every day, another shell script enriches that data by adding the names of known locations. It uses the Google Contacts API to fetch known locations and their addresses from my Google Contacts address book, and then uses Google Maps to convert those addresses to GPS coördinates.
The resulting CSV file will look like this:µ
Tue Jun 29 08:45:33 CEST 2010|51.03728,3.71103|11.96737|Gent-Sint-Pieters (126 m)
Tue Jun 29 08:46:34 CEST 2010|51.03696,3.71184|3.95215|Gent-Sint-Pieters (116 m)
Tue Jun 29 08:52:08 CEST 2010|51.03703,3.71191|.09921|Li De Clerck (145 m),Gent-Sint-Pieters (125 m)
Tue Jun 29 08:53:08 CEST 2010|51.03669,3.71167|2.48479|Gent-Sint-Pieters (86 m)
Tue Jun 29 08:54:09 CEST 2010|51.03671,3.71152|.63349|Gent-Sint-Pieters (80 m)

This setup is very up-to-date and dynamic, since it uses live data from the Google API's. As you can see, it adds the name of a location (such as "Gent-Sint-Pieters") or the name of a person (such as "Li De Clerck") whenever I'm within 100m from it.

I'm releasing all relevant scripts under GPL 3.0, feel free download and play with them !

Getting EMV/CAP challenge/response to work

Let's recap; I've been sing my Belgian EID smartcard reader to query my KBC debit card. This has been working great, and I'm now able to select the SecureCode application and unlock it by verifying my PIN code.

Now I'm trying to get the challenge/response mechanism to work, so I can have my PC automatically login to KBC Online. This should work by now, but for some reason the response always turns out to be wrong...

Warning: if you're playing with this as well, keep in mind that KBC will only allow 3 failed attempts at logging in. So when you've failed twice, log in using the normal method (that actually works) to reset the login try counter.

According to the specs, we need to generate an Application RQ Cryptogram, and then cancel it by requesting an Application Cryptogram. See my script for the dirty details... much of this work is based on EMV CAP examples from "Chip & PIN is broken".

Now if only I could figure out what's wrong with the responses I'm generating !