Zero-Trust Homelab Security: Unlocking Encrypted Drives with Cloudflare and an ESP32

Saurab Thakur Saurab Thakur
6 min read

If you are running a proper homelab, you are probably taking security seriously. You’ve installed TrueNAS, you’ve set up a ZFS storage pool, and you have enabled native encryption. This means that even if a thief breaks into your house and physically steals your hard drives, they cannot read your private data. It is locked behind complex mathematics.

But this incredible security introduces a massive, annoying headache.

Every time the power goes out and your TrueNAS server reboots, the hard drives are locked. Your Docker containers, your media servers, and your file shares are completely broken. To fix it, you have to open your laptop, log into the TrueNAS interface, and manually type in a ridiculously long decryption password.

What if you are on vacation when the power flickers? Your server is essentially a brick until you get home.

The UPS Supervisor V2.0 solves this by acting as an automated, high-tech security keycard. But how do you teach a tiny microchip to automatically unlock your encrypted server without accidentally making it easy for a hacker to steal the password?

Enter the world of Zero-Trust Split-Key Cryptography.


The Danger of “Just Remembering” the Password

The easiest way to automate the unlock process is to just tell the UPS Supervisor your 64-character password and tell it to send that password to the NAS whenever the power comes back.

This is an absolutely terrible idea.

If you save the full password inside the UPS Supervisor, you have defeated the entire point of encrypting your hard drives. If a thief breaks into your house and steals your server rack, they will steal the UPS Supervisor too. They can simply plug it into a laptop, read the memory, extract your password, and unlock your hard drives.

We need a way for the UPS Supervisor to know the password, but only when it is physically sitting inside your house, connected to your specific network.


The Solution: Ripping the Password in Half

Imagine you have a treasure chest with two padlocks. You keep one key in your pocket, and you bury the other key in a secret location in the woods. To open the chest, you have to bring both keys together.

The UPS Supervisor does the exact same thing with your TrueNAS decryption password. It mathematically rips the password into two distinct pieces.

  • Part A (The Local Key): This half of the password is saved directly onto the tiny flash memory chip inside the UPS Supervisor.
  • Part B (The Cloud Key): This half of the password is never saved in your house. Instead, it is uploaded to a highly secure, invisible “Cloudflare Worker” server floating somewhere on the internet.

Because the password is ripped in half, the UPS Supervisor is completely useless to a thief. If someone steals it, they only get Part A.


The Magical Unlock Sequence

So, the storm has passed. The UPS Supervisor has just commanded your TrueNAS server to wake up, and the hard drives are locked. It is time to assemble the keys.

1. The Cloud Handshake First, the UPS Supervisor reaches out to the internet to talk to Cloudflare. Cloudflare is extremely suspicious. It refuses to hand over Part B unless the UPS Supervisor provides a secret digital ID badge and perfectly matches a unique security fingerprint. Once Cloudflare is satisfied that it is talking to your authentic UPS Supervisor, it securely beams down Part B over an encrypted channel.

2. The Mathematical Blender Now, the UPS Supervisor holds Part A in its left hand, and Part B in its right hand. It smashes them together. But to be extra safe, it doesn’t just stick them end-to-end. It runs them through an industrial-grade mathematical blender called a SHA-256 hash. This creates a completely new, incredibly complex string of characters. This final string is the true password required to unlock the NAS.

3. The Vault Opens Finally, the UPS Supervisor turns to your local network. It knocks on the digital door of your TrueNAS server and whispers the newly blended password.

The TrueNAS server verifies the math, realizes the password is correct, and gracefully unlocks the hard drives. Instantly, your Docker containers spin up, your media servers come back online, and your network drives reconnect to your PC.

The entire process takes less than two seconds, and it requires zero human intervention.


Ultimate Peace of Mind

This split-key architecture provides enterprise-grade security for a DIY project.

If a thief ever steals your hardware, they have a locked TrueNAS server and a UPS Supervisor containing only half a password. When they try to turn it on at their house, you simply log into Cloudflare from your phone, click “Revoke,” and Cloudflare permanently deletes Part B.

The thief is permanently locked out. Your data remains perfectly safe, wrapped in unbreakable mathematics.

Building the UPS Supervisor V2.0 isn’t just about keeping the lights on; it is about building a system that you can trust to protect your most valuable digital assets, no matter what happens.


Thank you for exploring the UPS Supervisor V2.0 series! We hope this deep dive into smart power management, local control, and high-tech security inspires your next homelab project.


From this Series

More from the Blog

Share this article

You might also like

Table of contents