Monday, 28 January 2013

Twittering and signatures

One of the things that I want to be able to do at some point is connect to a server using a secure socket.  That's a little way off yet, but isn't so distant that I can put it out of my mind.

Many Internet-of-Things devices might want to connect securely; and more than that, robust authentication is also necessary.  Simple authentication is being discarded and OAuth is starting to become the norm for services such as Twitter and COSM.

In view of that, I constructed an example a little while ago that will sign a Twitter API call using an HMAC-SHA1 signature.  Rowley Associates has an established history in all this crypto boffinry as we wrote compilers under contract to Microsoft for their smart card virtual machine, and we also wrote the SmartWorks for MULTOS product which was bought out, rebranded, and now rests with MAOSCO as SmartDeck.  This signing code isn't hardcore crypto: it's rather simple, in fact.

So, if you're interested in the signing code, you'll find it here:

http://www.soldercore.com/manual/corebasic_twitter_oauth_signature.htm

This example takes the example from Twitter of constructing an OAuth signature and codes it up in CoreBASIC.  When I run the program, I get the correct signature:


So, we're on the way to direct posting to Twitter without using a proxy application!

No comments:

Post a Comment