Conclusion
Security flaws
The Bean Lock would be a terrible lock if it were hackable enough to let people right into your home. Until you can be sure this is secure, we wouldn’t recommend you replace your home’s standard deadbolt with the Latch.
One suggestion we have for making the Latch a secure IoT device is to add shared-key encryption. If you used the Bean SDK to build an iPhone app to lock and unlock your door, you could add an AES encryption library to your Arduino and iPhone app code. Then you could implement a challenge-response system:
- The iPhone app sends a request to unlock the door.
- The Bean receives the request, then sends a challenge code (a random string of bytes) back to the app.
- The app encrypts the challenge code with the shared key, then sends the encrypted challenge code as its response.
- The Bean decrypts the encrypted response with the shared key and verifies that it matches the original challenge code. This proves that the iPhone has the same shared key and is an authorized device.
- The Bean opens the door lock!
If you are using something small, like a 5-digit pin instead of a 128-bit key, an attacker could decide to brute-force your lock by trying every combination, one after the other. If you include a lockout – turn off the lock for 60 seconds after 3 incorrect codes are entered, for example – brute-forcing the lock’s combo would be too time-consuming to be practical.
The Bean was designed to be very easy to program, but in the case of a lock, you may not want your neighbors having the same access as you have. To avoid this, we have added pincode protection to the latest firmware release. It will prevent anyone without the pincode from reprogramming your Bean.
If you want to be even safer, you can keep the BLE module from reprogramming the on-board Arduino by cutting the trace linking the reset line on the Arduino to the BLE module. Without the reset line, the LBM313 module can’t reset the Arduino chip for reprogramming. Optionally, you could solder a switch to this line, so only someone with physical access to the inside of the lock is able to reprogram the Bean.
What’s next?
This is only a prototype and not a secure solution yet. But we are sure that it can be developed further to work just as well as commercially available smartphone controlled locks, like the Lockitron.
Make sure to post in the BeanTalk forum if you have any questions, ideas or contributions you want to share. We love reading what you’re up to!