After wanting the EZ430 Chronos watch for a long time, I finally ordered one on Febuary 20th from TI eStore, and I got the watch on February 24th (Tax Free). So this is another stuff in my long list of “things to hack”.
I had a good idea to use my Ez430 Chronos as OTP generator for Google 2 factor authentication. Before my long weekend, I did my research on Thursday (24 February) and that time no one had implemented it. So I wrote a small modification to OpenChronos, and just before I finished my implementation on Sunday (I was quite busy during the long weekend helping to move our company’s office), I looked at Chronos Wiki again to find some links to the chronos documentation, and found out that Huan Truong has just implemented his version of OTP by modifying OpenChronos.
After learning that in his version the clock function doesn’t work yet (in his readme it says “THIS FIRMWARE CURRENTLY HAS A YET-TO-IMPLEMENT CLOCK FUNCTIONALITY, SO IT WONT DISPLAY TIME PROPERLY”), I decided to continue my implementation. My implementation doesn’t change the time logic so you can still use the stock Control Center provided by TI (Huan Troung changed the OpenChronos code to use epoch implementation, and he modified the control center) . Instead of replacing all algorithms to use timestamp, I use a simple mktime implementation to convert existing year/month/date data to unix timestamp.
After flashing the image to the watch, a new menu is added to the second line after “rFbSL”, it will show a heart icon and first 2 digits of the OTP (I will never buy a heart monitor for this watch so I use that icon just to show that I am in OTP mode). Pressing the “#” key for a few seconds will show the remaining 4 digits. Just for your information, enabling CONFIG_OTP adds 2914 bytes to the code size.
So here is my version of Google OTP
(If many people are interested, I can put it in github):
I am too lazy to implement the “make config’, just edit otp.h with your key, and fill in the timezone offset (+N from UTC). You can get the key from base32 encoded string using codegen script that I made, for example:
bash$ python codegen.py pf xwqy lomvz wu 33f
You can use
make config to set your secret key in base32 (that means you can just copy paste from the auth code presented by Google), and you can set the timezone offset.
4 thoughts on “EZ430-Chronos OTP”
i will pull soon into openchronos 🙂
ps: replacing the logics with timestamps is useless idea. the msp430 contains a real time clock that does everything. there is a branch that currently implements necessary drivers and logics but it is not finished yet.
Is it possible to host the elf or txt file? I am having a devil of a time getting cygwin to compile the mspgcc code let alone getting your code to compile.
Hi Yohanes. I recently downloaded Tiny Meter for my Blackberry 9700. Very nice and compact app. Thank you. Why does it require access to the phone in order to work? I can’t figure out what function it performs that needs phone access…