Inspiration
I thought of a hardware key that would use asynchronous encryption to decrypt data. It seemed secure because the public key can only be used for encryption and the private key stays on the hardware key, where it is used to decrypt data. After a quick web search, I found a key that did something similar to this, but it was very expensive. There must be a way to mimic this kind of behavior with affordable devices.
What it does
The key communicates with the computer through USB. The communication is used by the ESP32 (the board used by the project) for debugging and development. Data that is encrypted by a public key stored on the computer is sent to the hardware key. The decrypted data is then sent to the computer. The key can also do authentication, by sending encrypted data, and checking if the decrypted data is the same as the original data.
How I built it
First, I had to find a way to do RSA encryption on the ESP32. After some searching, I found this package. It promised optimized RSA encryption and decryption for the ESP32. Unfortunately, whilst building the custom version of Micropython with this module, I couldn't build it successfully with optimizations enabled, but RSA encryption and decryption still worked. Finally, I wrote code for the ESP32 that would decrypt the data it received. I also wrote code for the computer that would connect to the ESP32 and send the encrypted data. The LCD was the easiest part of the project because there was lots of documentation readily available online.
Conclusion
The ESP32 cost around 5$ and the LCD cost around 2$. Yubikeys, however, cost more than 25$! It can be argued that the price is reasonable because the hardware and software are designed for security, but I just learned that encryption on small embedded devices is not difficult and can be run on cheap hardware. Once hardware security keys become more popular, we may see a decrease in security breaches due to bad/overused passwords. But for this to happen, hardware security keys must become affordable.
Built With
- micropython
- python
Log in or sign up for Devpost to join the conversation.