I recently enabled [two factor authentication for my Google account](http://googleblog.blogspot.com/2011/02/advanced-sign-in-security-for-your.html). One of the ways of getting the second factor (the key that I have) is to install an Android app on my phone that displays a key for a short duration of time.

What does it take to create a web server solution paired with a smartphone solution?

I am using Windows and .NET on the server side and would be interested in both Android and iPhone apps. Are there existing libraries out there or do I need to start from scratch? Where is some starting documentation and explanations of the techniques used?