Hardware Authentication

I have a question on hardware authentication. Is there a feature or method in the Blynk ecosystem for making hardware “authentic” so that another hardware vendor cannot make copies of my hardware devices and let them provision their devices in my organization? I have done alot of work with STM32 and similar MCUs and there are features that help prevent hardware copying both in hardware, (flash read protection) and in software (custom firmware encryption). Do you guys have a recommended workflow for this or is this something I would have to add on my own? It would be really nice to be able to use Blynk.Air for firmware updates, but it seems like the security might not be 100% secure?

One thing I was thinking is that perhaps I could pre-generate unique auth tokens and write them into the devices NVM at the factory, and then if someone were to try to use that auth token then they would at most only be able to register one device, vs automatic provisioning, in which case people could add lots of copies?

Any insight or recommendations would be appreciated!

A quick idea came to my mind. May or may not work. Give it a try.

Every chip has its own id. What you need to is compare the chip id in the setup () . Something like if (chip_id == your unique device id) { Loop ok = 1 } else { Loop ok = 0 }

This way chip_id will fetch the id from the chip like we do with esp chipID = ESP.getChipId();

But you will have to find out each device’s id and fill it up at your unique device id

If this step doesn’t match, the code will not be executed and your device dont work.

When someone copy the code, they will be copying along with the “your unique device id” which will be different for their device. And they fail.

Try not to expose programming pins. Use epoxy to cover up the chip. Burn the fuse once programmed.

Are you saying that you would build a separate copy of the FW with that check for every device and make that the one available? Otherwise it is not scalable to check thousands of devices right?

Yes. It would be hard to maintain firmware for thousands of devices. If your product is so unique from the rest, then putting in effort to safeguard your FW is worth. But its not practical i can understand.

Better to epoxy your PCB. But the problem is you cannot service your product if it is still under warranty.

I looked into the Blynk Edgent code a bit. It looks like the interface to the firmware update portion is handled using OTA.h within Blynk, and then also the “Updater.cpp” which I think is an Arduino file? Anyways, it seems like technically I could rewrite this portion of the code to handle decryption of FW if needed. That said, I tested out using Blynk.Air as it is written and it works so well it pains me to think about trying to modify it!

Any other ideas out there? I might actually try to move the more custom portion of my product code into another chip which also has the benefit of being jtag debug-able. Then I could write a simple serial interface for reading / writing data (and encrypted FW embedded in the ESP32 application). I don’t know about others out there but I have not been able to debug really well on ESP. Visual GDB actually has a pretty good setup, but it’s still extremely slow to step through code (multiple seconds per line).

It makes me nervous to rely on Arduino code for production, but it really seems to be pretty well built out for Blynk!