2

I made an Arduino project to lock and unlock my door via my phone (with Bluetooth). It works well but it’s unsafe since I just send the lock and unlock command in cleartext, without authentication or encryption. I would like to add authentication to this so that only I can enter the house. I should be able to give friends/family access and revoke the access remotely (without being in Bluetooth range). I also would like to give other people (e.g. the cleaning lady) temporary access ("each Wednesday between 1pm and 5pm”). Since I would like to do this remotely I think I would need a server.

I remember the protocol Kerberos from my crypto class which seems like it would get the job done. But this seems overkill and not lightweight enough. I’m not sure whether Kerberos is the way to go and whether there are other protocols out there that would fit my needs?

I looked online to see what protocols the commercial smart locks (like August, Lockitron) use but couldn't find too much information on this.

  • 1
    Your question is tagged "kerberos", that seems overkill and most importantly way too complex to be implemented on a microcontroller. You may be able to implement it on an actual computer, and the microcontroller will just respond to lock/unlock commands from that computer. – user42178 Mar 9 '15 at 16:32
  • Finally I don't think there is a need to go beyond a basic challenge/response like XORing a challenge with a known key. That's more than enough for a standard appartment door, as someone who wants to get in will most likely break the door down anyway. – user42178 Mar 9 '15 at 16:37
  • The microcontroller would be an application server so most of the Kerberos implementation is done on the authentication server and KDC (which would be an actual PC). The client implementation is done on my smarthpone. And probably you're right that Kerberos is overkill but I simply haven't been able to find any other protocol that satisfies all my requirements listed above, like for instance remote key revocation. For instance in your challenge/response protocol, how would I revoke/add users while I'm away from home and therefore not within Bluetooth range? – Nimyz Mar 9 '15 at 16:43
  • If you want to add users remotely you need a way to communicate with the microcontroller over the Internet. I highly suggest you just use a small computer (router with root shell access, Raspberry Pi, etc) to handle all the authentication stuff and just send "lock/unlock" commands over serial to the microcontroller. – user42178 Mar 9 '15 at 16:47
  • It's way easier to break a lock than any crypto... If you employ the protocol that @AndréDaniel said (challenge/response), you will be safe enough. Putting Kerberos, PKI, authentication, digital signature and HMAC on the mix is way too much overkill. Unless you are securing a Nuclear Launch Site. – ThoriumBR Mar 9 '15 at 18:12
1

You could use assymetric crypto to sign the commands. You can then use public key authentication to verify if the commands were signed by someone who is in the allowed list.

Each user needs to generate a key-pair in their app and you need to import their public key. You can then also revoke access by removing their public key from the access list. Access will only be given if you can verify a signed message with a public key which is associated to a user.

You need to make sure you secure your request with a nonce during the challenge response, otherwise a replay attack may be used.

  • Yes, but the problem with this is that I have to be in Bluetooth range to revoke and add keys. Is there a solution for this (without maybe using Kerberos)? – Nimyz Mar 9 '15 at 16:45
  • How would that be different from using kerberos? Kerberos would need a db as well where it knows who's allowed to enter and who not... – Lucas Kauffman Mar 9 '15 at 16:50
  • Yes but this database lives on a server which I can contact remotely over the internet, without using bluetooth. In your example I need to be in Bluetooth range to add/remove public keys to the lock because I cannot access my lock over the internet. – Nimyz Mar 9 '15 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.