Chapter 1

The Teardown

I got fired for being right. I want that on the record before anything else happens.

Technically, I got fired for breaking into a room I wasn't supposed to be in. But I was right about what was in that room, and nobody wanted to hear that part. So here I am. January. Forty-three years old. Unemployed. Standing in a scrapyard in Grove City, Ohio, negotiating for electric meters with a man wearing a Bengals jersey over his Carhartt.

The man is Rusty Kincaid. Rusty has never thrown anything away in his life, which is how he ended up with a pallet of forty smart meters, and how I ended up wanting them.

"Power company swapped out a whole block over by the outlet mall," he says, and kicks the pallet. "Smart meters." He spits. "Smartest thing about 'em is they tell the power company when you're home."

I pick one up. Grey plastic. Security screws. Little LCD window. There's still a strip of somebody's vinyl siding stuck to the back.

"Twenty bucks," I say.

"Twenty bucks and a six-pack."

"What kind of six-pack?"

"The kind you're about to go get me."

Fair.

We load the pallet into my truck. Rusty watches me the way he watches everything, like he's deciding what it would go for at auction.

"What the hell are you gonna do with forty electric meters?"

"Take 'em apart."

"Then what?"

"Then I'll know what's inside."

He thinks about that. "You still at that defense place out on 33?"

I slam the tailgate. It doesn't latch. It never latches. I slam it again.

"No."

"Huh." He nods slowly, like that explains a lot about the last two months. "Their loss."

It is, actually. But thanks, Rusty.

* * *

Here's what I do, or what I did, for nineteen years: I take things apart.

Not break them. People always get that wrong. Anybody can break something. You want to break a smart meter, use a hammer. What I do is open it up, find the chips, read the part numbers under a magnifier, look up the datasheets, and find the little copper test pads the factory forgot about. Then I hook up my own wires and ask the thing, real nice, to tell me everything it knows.

Most of them do. Nobody builds a device expecting it to be asked.

That's eight o'clock at night in my garage. Space heater ticking in the corner. Shop light buzzing over the bench, the way it's buzzed for the eleven years I've owned this house. Coffee went cold an hour ago. I'm drinking it anyway.

I back out the four security screws. The housing pops with a crack. They glued it. Cute. Inside, there's a green circuit board: a chip in one corner that counts every bit of electricity going into the house, a radio in the other corner that tattles to the utility every fifteen minutes, and in the middle, a little flash chip the size of my pinky nail. That's the brain.

"Hello," I tell it. "Let's see who you are."

I've been talking to circuit boards a lot since November. I'm aware this is a problem.

My phone buzzes. June. My daughter. Fourteen, every other weekend, and as of last month, going to be an electrical engineer, which I am trying very hard not to be smug about.

did u change the wifi password?? moms wifi is trash

I text her the password. Three dots. Then:

thx. love u. dont stay up all night taking stuff apart

I look at the pallet. Thirty-nine more meters.

Too late, kiddo.

* * *

First thing you do is look for the back door.

On the edge of the board, under a coat of clear goop, there's a row of four tiny pads. I scrape them clean and check them with my multimeter. Ground. 3.3 volts. And two that just float there.

Transmit and receive. A serial port. It's the debug port the engineers use while they're building the thing, and they almost always forget to turn it off before it ships. I solder on three wires about as thick as a hair, run them to a USB adapter, and pick a speed. 115200. It's always 115200. I don't know who decided that, but I'd like to buy them a beer.

I power up the meter. Text scrolls up my laptop screen:

BOOTLOADER v2.4.1
MEM TEST... OK
SECURE BOOT: ENABLED
IMAGE AUTH: OK

Then nothing. No login. No menu. No way in.

Okay. Somebody did their homework.

Doesn't matter. That boot screen just told me what chip family I'm dealing with, and that tells me where the software lives. Every device gives something away. You just have to let it finish talking.

I clip a test clip onto the flash chip, jumper the processor so it stays asleep and doesn't fight me, and pull a full copy. Four megabytes. Then I do it again and compare the two. They match. A bad clip can flip one bit and send you chasing ghosts for a week, and I've chased enough ghosts.

Then I run a scan that graphs how random the data looks, start to finish. Every firmware has its own skyline. Code is lumpy. Compressed stuff is a flat line up near the top. And at the very end, there's a skinny little spike, sixty-four bytes wide.

The signature.

Right before it, there's a second spike. Smaller. I've never seen it before.

Padding, probably. I write it on my legal pad — ?? 0x3FF800 — and move on.

Remember that. I didn't.

* * *

I load the firmware into Ghidra, which is a free reverse-engineering tool the NSA gave away to the world in 2019. Best thing the government ever did for me, and I've paid a lot of taxes.

Ghidra starts drawing the whole program out on the screen. Boxes and arrows, one function at a time. I need the part that checks the signature, so I search for the specific math constants every signature check has to use. Found them. Follow them back to the code that uses them. I name it verify_image_sig and lean back in my chair.

That's the whole trick, by the way. Nobody gives you a map. You find one thing you're sure of and you work outward from there.

So here's why the signature matters. It's the manufacturer saying we wrote this, you can trust it. The meter won't run anything without it. That's the only thing stopping some jackass from loading his own code onto a million meters and turning off Ohio. The key that makes that signature is locked in a vault somewhere, with guards and alarms and auditors who fly in twice a year to watch people type passwords.

I scroll to the signature. It's valid. Of course it's valid.

I almost move on.

Then I notice the key tag. That's a little label that says which key signed it. This manufacturer has used the same two keys for six years. I know them by heart. I built a database of this stuff. For fun. On weekends. Yes, Mara left me. We'll get there.

This tag isn't either of them.

"Okay," I tell the board. "So you got a new key."

Except I check the list of keys the meter will actually accept, the ones burned into the chip at the factory. Burned in. Permanent. Nobody can change them. Not the utility, not the manufacturer, not God.

Two keys. The same two.

So this software is claiming a key the meter has never heard of. And the meter ran it anyway.

I do the math myself, on my laptop, with no meter involved. I run the signature against the manufacturer's real key.

It passes.

I sit there for a while.

Somebody made a signature that the manufacturer's real key accepts, on software the manufacturer never wrote. Which means somebody has the manufacturer's private key.

Or somebody doesn't need it.

* * *

I pull up the official software I've got on file and line it up next to this one in a tool called BinDiff, which lights up every difference in color.

Most of it matches. But woven into the radio code, there's new stuff. Small. Tight. Honestly kind of beautiful. No names. No notes. None of the junk programmers always leave behind: the shortcuts, the half-finished experiments, the swear words. I've read code from a hundred engineering teams. You can always tell when a person wrote it.

Nobody wrote this. It looks like it grew.

From what I can tell, it does three things. It listens to the other meters on the neighborhood radio network. It keeps a little list of them: how long a signal takes to reach each one, how steady their voltage is. And it waits. There's one piece of it that does absolutely nothing except wake up every few hours, check for a certain message, and go back to sleep.

A meter that's been taught to be patient.

That's what the code does. What's eating at me is how it got there.

I go back to the legal pad. ?? 0x3FF800.

Five hundred and twelve bytes of garbage, right before the signature. In the official software, that spot is blank. And nothing in the program ever reads it. No code touches it. It's just sitting there.

My dad was a mechanic. He had one rule: Nothing's in there for no reason.

So I tear off a clean sheet and do what they taught me my first week on the job. Facts on the left. Guesses on the right.

FACTS:

  1. Signature checks out against the real key.
  2. Key tag is wrong. Meter runs it anyway.
  3. 512 bytes of junk before the signature. Nothing reads it.

GUESSES:

  1. Bug in the signature check?
  2. Stolen key?
  3. ???

Fact two is easy. I read the signature check line by line. If the key tag doesn't match, the meter just tries both keys anyway. Some engineer added that years ago to be helpful. The meter doesn't care who claims they signed it. Only whether the math works.

Guess one I can test. I keep a spare meter on the bench for exactly this kind of thing. I load the weird software onto it and power it up.

IMAGE AUTH: OK

Then I change one bit. One single bit, deep in that pile of junk that nothing ever reads. Load it again.

IMAGE AUTH: FAIL

Won't boot.

I flip the bit back.

IMAGE AUTH: OK

So the junk isn't junk. The signature covers every byte of it. Whoever made this needed those exact 512 bytes, in that exact order. I cross out guess one.

Guess two is the one that keeps bugging me. If you stole the key, why bother with any of this? You'd sign your code and push one file to a million meters. Done. Go home.

I look at the pallet.

I open up five more meters. Two are running the normal software. Three are running the weird one. Same new code. Same wrong key tag.

Different junk in every single one.

Different signatures, too.

I lay all four printouts side by side on the bench. Same code. Different garbage. Different signatures. Like somebody had to make the same file over and over, changing nothing but the garbage. And every single time, the meter bought it.

At the bottom of the page, I write it out and underline it twice:

IF YOU HAD THE KEY, WHY WOULD YOU NEED TO KEEP CHANGING THE GARBAGE?

I know this feeling. I'm standing right on top of something. I just can't see it yet.

* * *

The clock on my laptop says 4:50 a.m.

A year ago, I'd call Joanne Teagarden. My old boss. The woman who once drove three hours through a blizzard to bring me a logic analyzer because she knew I'd be stuck without it. She'd look at this, go real quiet, and start calling people with clearances.

But Joanne's the one who walked me out to the parking lot on November thirteenth, carrying a cardboard box with my coffee mug and a picture of June in it. She didn't look me in the eye.

For a second I'm back in that cold room at Halvorsen. Racks of machines. A hum I could feel in my teeth. A whiteboard with one word across the top in blue marker.

PROTOTYPE.

I save three copies of the software. One on the laptop. One on a thumb drive. And one, after I think about it for a minute, on an old SD card that I drop into the coffee can full of loose screws on the shelf. If anybody ever finds it in there, they've earned it.

I kill the shop light.

The garage goes dark. The fridge hums through the wall. The furnace kicks on. All of it runs through the meter on the side of my own house, which has spent the whole night talking to its neighbors in a language I didn't know existed until tonight.

I look out the little window in the garage door.

Across the street, on the Hendersons' porch, their doorbell camera has its little red light on.

It's pointed right at me.