Hi, just saw this post when I'm working on a similar problem -- selling an encrypted pi with important stuff inside.
For encryption per se, I think a more manageable solution is to set up an encrypted loop device on the existing tinycore persistence partition (there are a lot of online guides for doing this). That way you can just put the standard setup code in bootsync.sh without altering any tinycore internals.
However, after some discussion with our team, we're no longer very keen on hardware-tied encryption. A problem is that if they could take out your sd card, they could just replace it with a standard raspbian and get whatever hardware information they need for the decryption.
Currently I'm thinking along these lines:
- Glue the card to the slot. I bought some "sealing glue", but I probably won't have the balls to try it before getting the software part finalized... Ideally, if the glue is stronger than the card, we could make it really hard for someone to take out the card without destroying it?
- Just open source the "protection code", but put the important a-million-dollars part on a meticulously logged server and make sure everyone knows that. On the server side, we could hire someone to read the log every day and make a phone call every time a new IP address appears. On the pi side, we download things to ramfs on boot, provide access over a network interface, and notify the server / reboot the pi whenever a hardware change is detected.
Any other thought on this topic?