# Are secret government backdoors built into all chips today?

**URL:** <https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737>\
**Category:** Factual Questions\
**Created:** [June 23, 2009, 5:09pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737 "2009-06-23T17:09:36Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [May 27, 2016, 1:58pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/41 "2016-05-27T13:58:49Z")

</div>

The encryption is based on an RNG _inside the cpu_. This RNG was compromised, hence the encryption is compromised.

The “encryption chip” _is_ the cpu.

In case you hadn’t noticed, the media is terrible at explaining tech.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [May 27, 2016, 2:26pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/42 "2016-05-27T14:26:30Z")

</div>

> [@](#):
>
> Quoth **watchwolf49** :
> 
> I don’t know any of the details of how SSL works. The cryptographic algorithm requires a seed value, and both sides need this seed value; one to encrypt the information, the other to decrypt it. My understanding is this seed value is convoluted and complexified as to be unrecognizable, and then just simply included with the message. Granted, a person who intercepts the cipher would need the computation power of someplace like the NSA to extract the original information. With enough money, about anyone can get this computation power.

I do know more of the details about how RSA works, and while it can be cracked with enough computation power, “enough” in this case means “all of the computers ever built or which ever will be built in any of our lifespans working continuously for many times the lifespan of the Universe”. It’s possible to attack RSA more quickly if it’s using a poor-quality random number generator like the one built into most commercial chips, but everyone remotely qualified to work in security already knows that the RNGs built into most commercial chips are poor-quality, and so doesn’t use them.

---

<div class="post-metadata">

**Author:** ![CurtC](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@CurtC](https://boards.straightdope.com/u/CurtC)\
**Post date:** [May 27, 2016, 4:30pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/43 "2016-05-27T16:30:03Z")

</div>

> [@watchwolf49](#):
>
> Your citation doesn’t seem to back up your claim. The article is about the NSA’s ability to get the information off the internet and break the encryption. It doesn’t say they’re tapping into the CPU itself. If the NSA could tap straight into the CPU, they wouldn’t need to break the encryption.

You misunderstand. Weakening the RNG weakens the encryption that uses the RNG for the seed value. There’s no need to get into the CPU itself if they’ve put in a compromised RNG into its design.

> [@](#):
>
> I’m not sure this information was reveled by Snowden, the encryption we use over the internet was never considered very robust. The military has never used it for their classified transmissions. … should have used military encryption, where we don’t actually include the key with the document.

You really should read up on public-key encryption and how it works.

> [@watchwolf49](#):
>
> I don’t know any of the details of how SSL works. The cryptographic algorithm requires a seed value, and both sides need this seed value; one to encrypt the information, the other to decrypt it. My understanding is this seed value is convoluted and complexified as to be unrecognizable, and then just simply included with the message. Granted, a person who intercepts the cipher would need the computation power of someplace like the NSA to extract the original information. With enough money, about anyone can get this computation power.

Lots of misconceptions there, I don’t even know where to begin to correct it.

> [@](#):
>
> The military writes this seed value on a piece of paper, gives it to a security officer, puts him on a C-17 to where ever and the security officer hand-delivers the seed value to the recipient. The “key” is never sent where our enemies can get it.

What you don’t understand here is that this situation you’ve described, where you send the decryption key via messenger, is exactly the weak link that public-key cryptography solves.

> [@](#):
>
> The NSA cannot break their own codes.

And they can’t break public-key crypto, according to every expert.

---

<div class="post-metadata">

**Author:** ![watchwolf49](https://avatars.discourse-cdn.com/v4/letter/w/e9c0ed/32.png) [@watchwolf49](https://boards.straightdope.com/u/watchwolf49)\
**Post date:** [May 27, 2016, 6:17pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/44 "2016-05-27T18:17:15Z")

</div>

> [@ftg](#):
>
> The encryption is based on an RNG _inside the cpu_. This RNG was compromised, hence the encryption is compromised.
> 
> The “encryption chip” _is_ the cpu.
> 
> In case you hadn’t noticed, the media is terrible at explaining tech.

I gotta agree with you on that last part … but the [NYT article](http://www.nytimes.com/2013/09/06/us/nsa-foils-much-internet-encryption.html) doesn’t mention CPU either. The best I’m getting is some chip makers do this some of the time, and one software company does this all the time.

Let me pose this as a **General Question** for which there is a **Factual Answer**. How does the random number generated by the transmitting computer get to the the receiving computer? Let’s set aside the fact it’s being transmitted in the clear to the NSA. We still have to get it to where we want it to go.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [May 27, 2016, 6:39pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/45 "2016-05-27T18:39:48Z")

</div>

> [@](#):
>
> Let me pose this as a General Question for which there is a Factual Answer. How does the random number generated by the transmitting computer get to the the receiving computer?

It doesn’t. If it did, then the system wouldn’t be secure.

---

<div class="post-metadata">

**Author:** ![RaftPeople](https://avatars.discourse-cdn.com/v4/letter/r/6f9a4e/32.png) [@RaftPeople](https://boards.straightdope.com/u/RaftPeople)\
**Post date:** [May 27, 2016, 7:36pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/46 "2016-05-27T19:36:18Z")

</div>

> [@watchwolf49](#):
>
> Let me pose this as a **General Question** for which there is a **Factual Answer**. How does the random number generated by the transmitting computer get to the the receiving computer? Let’s set aside the fact it’s being transmitted in the clear to the NSA. We still have to get it to where we want it to go.

The NSA uses the weakness in the RNG to reduce the amount of time spent to decrypt. When the RNG is good and/or close to random, the time to decrypt is beyond a useful time frame, when RNG is weakened, the time to decrypt is reduced significantly.

---

<div class="post-metadata">

**Author:** ![Voyager](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/voyager/32/133_2.png) [@Voyager](https://boards.straightdope.com/u/Voyager)\
**Post date:** [May 27, 2016, 8:56pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/47 "2016-05-27T20:56:51Z")

</div>

> [@TommySeven](#):
>
> No one disputes that hard-wired backdoor programs are possible. The question is whether they can do anything useful without getting detected. Nothing about the attacks in your linked paper would make them any less detectable to the end user than the conventional and obvious way for an IC designer to implement a backdoor. The novelty in that paper is in how the IC fab might hide a backdoor from the IC’s designers, not how an IC designer might hide a backdoor from the IC’s end users.

Since 2009 this has been a big area of research in my field. I’m on the editorial board of one journal, and we get multiple special issue proposals on this subject. But no one has ever described an actual case of this. Counterfeiting on the other hand is indeed a big problem.  
There are lots of interesting theoretical methods of showing if someone puts in a Trojan Horse, but anyone with the skill to do so would likely be working at a better place than the kind of fab that would do it. Big fabs, like TSMC and Global Foundries, are not going to risk billions of dollars of business for this.  
And the problem btw is exactly the fab putting in a Trojan Horse. It is trivial for a design team to do it. You buy a chip designed by a subsidiary of the Chinese Army and you may be in for problems.

---

<div class="post-metadata">

**Author:** ![Voyager](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/voyager/32/133_2.png) [@Voyager](https://boards.straightdope.com/u/Voyager)\
**Post date:** [May 27, 2016, 9:06pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/48 "2016-05-27T21:06:50Z")

</div>

> [@TommySeven](#):
>
> Actually, I see that **Voyager** was maybe slightly disputing that above. I think it’s easier than he/she thinks: you can probably escalate privilege just by tampering with one or two bits that aren’t in a critical path, and you can hang your trigger circuit off basically any one bit that’s under software control. I think it would be hard but still practically possible for an IC fab to do that in a typical design, for some definition of “practical”. The deadline (since you have to work fast, or else the customer notices the mysterious extra year of lead time…) certainly makes it harder. You might be able to backdoor popular hard IP (e.g., an ARM core) ahead of time, though, and wait for a design that used it.
> 
> In any case, nothing in the linked paper makes the “not breaking the test vectors” part any easier. Their contribution is a slightly smaller (easier to place, harder to notice by examining die photographs and stuff) trigger circuit. They do model some of the timing effects mentioned by **Voyager** , which they claim are not too bad. Those timing effects are no different with their trigger vs. a conventional one.

A fab does not get a netlist. A fab gets tapeout data (used to be a tape, not any more) with masks and other information that tell you where the transistors, pads, interconnect and vias go. Good luck figuring out where and how to wire anything new up with that. For instance, there are often spare gates that can be used to make relatively low cost changes without a new mask for all wiring layers. Using them for a Trojan horse is going to be tough. There is also not a lot of room left after layout and routing is done.  
Hell, a tool that could go from layout to logic would be awesome to have for verification. I’m not aware of one that could work on entire chips. When I was at Bell Labs we tried to do a transistor to gate mapper, and it was really tough. I’m not sure one is available even now, we don’t use it for sure.

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [May 27, 2016, 9:23pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/49 "2016-05-27T21:23:10Z")

</div>

> [@watchwolf49](#):
>
> Let me pose this as a **General Question** for which there is a **Factual Answer**. How does the random number generated by the transmitting computer get to the the receiving computer? Let’s set aside the fact it’s being transmitted in the clear to the NSA. We still have to get it to where we want it to go.

Let me just make it clear. Your knowledge of how all this works is very, very low. To even _ask_ this question means you are vastly unaware of how public key encryption works and the importance of good RNGs.

To reiterate: there are hardware RNGs in many modern cpus. The one used in some Intel and VIA cpus was deliberately fudged by NSA to have a weakness they knew how to exploit.

(The idea that companies go to NSA for analysis of their crypto-related products and then follow the NSA’s suggestions is astonishing.)

As noted, the encryption method used by good, current versions of (SSL’s successor) TLS seems pretty good. But they rely on RNGs. If the RNG is broken, the encryption scheme breaks down.

I don’t see it as my responsibility to teach a course in Encryption 101 here. For one thing, you have some misconceptions that a typical beginner doesn’t have. So I’d need to erase those just to get to a reasonable beginning point.

---

<div class="post-metadata">

**Author:** ![TommySeven](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@TommySeven](https://boards.straightdope.com/u/TommySeven)\
**Post date:** [May 28, 2016, 7:54am UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/50 "2016-05-28T07:54:04Z")

</div>

> [@Voyager](#):
>
> A fab does not get a netlist. A fab gets tapeout data (used to be a tape, not any more) with masks and other information that tell you where the transistors, pads, interconnect and vias go. Good luck figuring out where and how to wire anything new up with that.

What’s so tough about going from layout to netlist? Think of how the LVS stuff analog designers use works. The tool you’d want in this case is slightly different, because you’d want to work slightly higher up the hierarchy (like recognizing gates and other standard cells, not transistors), but in some ways easier, because each copy of the standard cell is identical. I don’t think that exists, but I think that’s from lack of demand, not difficulty. Maybe the EDA tool developers have stuff like this for internal debugging?

Inserting the backdoor would be tough, but again, I don’t think it would be impossible in most designs. If you couldn’t often make meaningful changes to a complicated design without moving any existing logic around, then designers wouldn’t include those “sewing kits” in the first place. And, since the fab is making all the masks, they’re not operating under those constraints; they’re free to move things around a bit if required, at greater risk of getting discovered in a die photograph of course.

I don’t think this is a very practical risk, for the same reason that I don’t think hardware backdoors included by the designers are a very practical risk: there’s just not a lot you can do with the backdoor that won’t be inevitably discovered, so it’s a lot of work for a one-shot attack that also destroys your reputation. That’s a different question from technical feasibility of the hardware backdoor itself, though.

---

<div class="post-metadata">

**Author:** ![TommySeven](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@TommySeven](https://boards.straightdope.com/u/TommySeven)\
**Post date:** [May 28, 2016, 8:04am UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/51 "2016-05-28T08:04:29Z")

</div>

Also, what NSA-backdoored hardware RNG are people talking about? The NSA almost certainly backdoored Dual\_EC\_DRBG, but that’s a software pseudo-random number generator (which could be hardware-accelerated, but would still be deterministic).

I’ve seen speculation that hardware true RNGs are backdoored, but no strong evidence. It certainly doesn’t make sense to use that (or any other opaque source of entropy) without mixing it with all other sources of entropy available in some cryptographically strong way. Any hardware exploit would then need to be tailored to the specific code using the RNG, a more complicated task.

---

<div class="post-metadata">

**Author:** ![Voyager](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/voyager/32/133_2.png) [@Voyager](https://boards.straightdope.com/u/Voyager)\
**Post date:** [May 28, 2016, 8:59pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/52 "2016-05-28T20:59:54Z")

</div>

> [@TommySeven](#):
>
> What’s so tough about going from layout to netlist? Think of how the LVS stuff analog designers use works. The tool you’d want in this case is slightly different, because you’d want to work slightly higher up the hierarchy (like recognizing gates and other standard cells, not transistors), but in some ways easier, because each copy of the standard cell is identical. I don’t think that exists, but I think that’s from lack of demand, not difficulty. Maybe the EDA tool developers have stuff like this for internal debugging?

Analog stuff, sure. But that is a trivially small amount of the area in a processor. When you have a bunch of transistors, how they are partitioned into standard cells is far from obvious. There are lots of possible mappings. And, remember, you want a netlist that can be read, not a collection of basic gates and bus drivers.  
The reason we worked on it was that our internal clients back 25 years ago were making DSPs with custom logic. Their customers wanted netlists, and it was to our advantage to give the inefficient ones, so that if they tried to build a chip with it they’d come up with crap.  
As for EDA companies, I don’t know for sure, but I used to do EDA and I’m heavily involved with people in EDA companies, and was on the program committee of one user group conference. Never heard of this as a practical tool. I can see it for a small block with maybe some hand correction, but for a billion transistors?

> [@](#):
>
> Inserting the backdoor would be tough, but again, I don’t think it would be impossible in most designs. If you couldn’t often make meaningful changes to a complicated design without moving any existing logic around, then designers wouldn’t include those “sewing kits” in the first place. And, since the fab is making all the masks, they’re not operating under those constraints; they’re free to move things around a bit if required, at greater risk of getting discovered in a die photograph of course.

If our fab moved stuff around you’d hear the screams from California in Taiwan. Closing timing is not easy at our speeds. I’ve seen examples of a big yield loss from a dogleg in a signal path, which is nothing as big as what you’d get when you moved something. And I’m pretty much sure we do our own masks - or at least the masks are a direct representation of our detailed layout.  
We also know the physical location of each gate on the chip, information I’ve used to see if failures are close together physically.

> [@](#):
>
> I don’t think this is a very practical risk, for the same reason that I don’t think hardware backdoors included by the designers are a very practical risk: there’s just not a lot you can do with the backdoor that won’t be inevitably discovered, so it’s a lot of work for a one-shot attack that also destroys your reputation. That’s a different question from technical feasibility of the hardware backdoor itself, though.

The people claiming that fab-inserted Trojans are a problem have never come up with any examples. In a sense there are designer inserted backdoors already. Remember when Intel got into trouble about chip ids? We have them on our chips - for the more recent ones, there is a command you can type at a Linux prompt which will give a hex number. If you give that to me I can tell you everything about what happened to that chip before it went to system assembly. Lot’s of companies build call home features into high end computers which, with permission of the customer of course, sends information about what is going on in the system, including voltage fluctuations, crashes, temperature. We don’t monitor data of course, but I suspect it is possible. But could be notices with even rudimentary security.  
I once jokingly wrote in a column that we should worry about digital picture frames that take voice commands listening to us. An expert told me that this is very possible. So there are really simple ways of collecting information that are much safer than fab or designer inserted logic.

---

<div class="post-metadata">

**Author:** ![TommySeven](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@TommySeven](https://boards.straightdope.com/u/TommySeven)\
**Post date:** [May 28, 2016, 9:42pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/53 "2016-05-28T21:42:48Z")

</div>

> [@Voyager](#):
>
> Analog stuff, sure. But that is a trivially small amount of the area in a processor. When you have a bunch of transistors, how they are partitioned into standard cells is far from obvious. There are lots of possible mappings.

Whoever’s performing this attack probably has the libraries. Indeed, they might have designed them. So they know the set of possibilities, and if you do find cases where the mapping is ambiguous, then any netlist is still “correct”, in that it corresponds to the same logic, and given the complexity of the synthesis tools doesn’t seem obviously easier or harder than any other to reverse-engineer.

> [@Voyager](#):
>
> And, remember, you want a netlist that can be read, not a collection of basic gates and bus drivers.

I think that’s the hard part, not extracting a topologically correct netlist. The layout may provide some clues, though. If you can reduce your attack to tampering with signals into a particular independently-routed and -placed structure (e.g., a register file, or an MMU), then you can drop the number of transistors to consider by orders of magnitude. I think these attacks would be closest to practical on some relatively small piece of hard IP, to limit the scope and give you time to reverse-engineer without delaying the customer, and maybe reuse the backdoor across multiple designs.

> [@Voyager](#):
>
> If our fab moved stuff around you’d hear the screams from California in Taiwan. Closing timing is not easy at our speeds. I’ve seen examples of a big yield loss from a dogleg in a signal path, which is nothing as big as what you’d get when you moved something.

Maybe on some paths, but it’s not like you’re going to tamper with the ALU, program counter register, etc. The trick would be to find something in a conservatively-timed peripheral that let you perform an interesting attack, which is why I’m thinking of stuff like the MMU setup registers (for escalation of privilege from user-mode code, for example).

> [@Voyager](#):
>
> The people claiming that fab-inserted Trojans are a problem have never come up with any examples.

Is anyone really claiming with a straight face that this seems like a practical problem? I see this as an academically interesting attack, not something anyone’s really worried about. I’d tend to agree that the large number of people with visibility into this process at a typical fab would make it hard to secretly perform the attack, even if it were technically possible.

It’s possible for a large group of people to keep a secret (e.g., the Manhattan Project), but hard to keep secret that a large group of people is keeping a secret (e.g., the newspaper article about all those scientists in the desert). From what I know about the processes by which fabs hire and assign work to employees, they don’t seem to have the necessary security procedures in place to keep a secret like this.

And just for completeness: the interesting thing about attacks through the hardware RNG is that they’re not detectable by black box examination. This is true only for a peripheral that’s supposed to be non-deterministic, because there’s no way to test if it’s working properly. If that entropy is used in intelligent ways (mixed in a cryptographically strong way with other sources of entropy, like keystrokes, network activity, etc.), though, then a practical attack would become extremely complex.

---

<div class="post-metadata">

**Author:** ![Voyager](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/voyager/32/133_2.png) [@Voyager](https://boards.straightdope.com/u/Voyager)\
**Post date:** [May 29, 2016, 3:52am UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/54 "2016-05-29T03:52:20Z")

</div>

> [@TommySeven](#):
>
> Whoever’s performing this attack probably has the libraries. Indeed, they might have designed them. So they know the set of possibilities, and if you do find cases where the mapping is ambiguous, then any netlist is still “correct”, in that it corresponds to the same logic, and given the complexity of the synthesis tools doesn’t seem obviously easier or harder than any other to reverse-engineer.

We had the libraries. They were our libraries, so we had them to whatever level of detail was needed.

> [@](#):
>
> I think that’s the hard part, not extracting a topologically correct netlist. The layout may provide some clues, though. If you can reduce your attack to tampering with signals into a particular independently-routed and -placed structure (e.g., a register file, or an MMU), then you can drop the number of transistors to consider by orders of magnitude. I think these attacks would be closest to practical on some relatively small piece of hard IP, to limit the scope and give you time to reverse-engineer without delaying the customer, and maybe reuse the backdoor across multiple designs.

Have you ever seen the netlist of a microprocessor? Even a hierarchical netlist with useful names is hard enough to figure out - a flat mostly incorrect one with no names worth mentioning I suppose can be decoded, but remember they would have to do it fairly quickly.  
Even if inserting something near a register file would be useful, many memory elements are timing critical - and the fab won’t know which ones. I know this for sure since we would love to insert some test hardware around memories, but the designers usually won’t let us. If the fab guesses wrong, they are going to be in serious trouble, since the first thing that would be looked at is the failing memory.  
Plus, routing congestion is often pretty high around memories, which means there is even less space to route signals from the inserted hardware.

> [@](#):
>
> Maybe on some paths, but it’s not like you’re going to tamper with the ALU, program counter register, etc. The trick would be to find something in a conservatively-timed peripheral that let you perform an interesting attack, which is why I’m thinking of stuff like the MMU setup registers (for escalation of privilege from user-mode code, for example).

Some sort of IP for a memory driver or a USB or other bus signal would be easier. But we use soft IP, so you have the same problem, and while if they attacked and rewrote hard IP (breaking protection of it) you’d have the problem that it is bigger than advertised, and that would be a red flag. I’m not sure that this would let you hijack anything, but we can forget about that for this discussion.

> [@](#):
>
> Is anyone really claiming with a straight face that this seems like a practical problem? I see this as an academically interesting attack, not something anyone’s really worried about. I’d tend to agree that the large number of people with visibility into this process at a typical fab would make it hard to secretly perform the attack, even if it were technically possible.

Trust me, the justification sections of lots of papers and special issue proposals imply that this is a big problem now or will be very soon - but when you look closer, you see that it is actually counterfeiting or gray market chips which are the real problem. We’ve rejected several special issues because of this. One on the counterfeiting problem would be interesting, especially if you get some security people to write an article. There was a paper in IEEE Spectrum a few years ago about this which was quite good. No Trojans there.

> [@](#):
>
> It’s possible for a large group of people to keep a secret (e.g., the Manhattan Project), but hard to keep secret that a large group of people is keeping a secret (e.g., the newspaper article about all those scientists in the desert). From what I know about the processes by which fabs hire and assign work to employees, they don’t seem to have the necessary security procedures in place to keep a secret like this.

In Feynmann’s autobiography, he mentioned that the stationmaster of the Princeton Junction station knew something was going on since all these Princeton professors and graduate school students were buying tickets to the middle of nowhere New Mexico.

---

<div class="post-metadata">

**Author:** ![TommySeven](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@TommySeven](https://boards.straightdope.com/u/TommySeven)\
**Post date:** [May 29, 2016, 6:59am UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/55 "2016-05-29T06:59:02Z")

</div>

> [@Voyager](#):
>
> Have you ever seen the netlist of a microprocessor? Even a hierarchical netlist with useful names is hard enough to figure out - a flat mostly incorrect one with no names worth mentioning I suppose can be decoded, but remember they would have to do it fairly quickly.

I’m more of an FPGA guy than an ASIC guy, but yes, I’ve seen many flattened netlists for complex designs. Have you ever seen the binary reverse-engineering tools used e.g. to find vulnerabilities in x86 code? They’re sort of like a debugger that also lets you annotate and restructure the disassembled code in various ways, as you refine your best guess at what each instruction is doing.

I’m imagining the logic simulator equivalent of that. The goal, as with reverse-engineering of software, would be not to understand the complete design, but to find an attack that required you to understand as little as possible of that. I think you could develop a useful version of that tool for low millions of dollars, beyond academic budgets but easily within any government’s means.

> [@Voyager](#):
>
> Some sort of IP for a memory driver or a USB or other bus signal would be easier. But we use soft IP, so you have the same problem, and while if they attacked and rewrote hard IP (breaking protection of it) you’d have the problem that it is bigger than advertised, and that would be a red flag.

How much bigger are you thinking the hard IP would get? I liked the MMU because it seems like you potentially could implement an interesting backdoor (enable access to the operating system’s memory upon some undocumented register write) in ~100 gates, a small fraction of the total area.

The memory controller seems like it could still do something interesting, but that a useful backdoor would be bigger. USB seems trickier, but I guess possible e.g. in DMA architectures where any master can write to arbitrary memory? Any attack on hard IP that’s available on the open market gets easier, if you can buy it yourself and read the documentation, or maybe even buy it in soft form and get a netlist to compare against.

Soft IP everywhere makes life much harder. Unless you have some chance to become familiar with the design before submission (like from an earlier version), or a really good excuse for the delay, that one might be hopeless.

> [@Voyager](#):
>
> Trust me, the justification sections of lots of papers and special issue proposals imply that this is a big problem now or will be very soon - but when you look closer, you see that it is actually counterfeiting or gray market chips which are the real problem. We’ve rejected several special issues because of this.

Maybe I have low standards for honesty? I just assume that since all papers will claim that, all such claims should be treated as meaningless, like an investor talking his book, or parents who think their children are beautiful. In any case, agreed that hardware backdoors look like academic toys for now, while shady component brokers selling floor sweepings are everywhere.

The extraordinary cost of IC fabrication equipment may help to discourage these backdoors. There’s really no such thing as a fly-by-night fab (at least, for modern digital processes), and anyone who has made such an investment would think very carefully about the cost of the reputation they’re about to destroy before inserting a backdoor that will almost surely be discovered within a few months of use. That’s not quite true for the hardware RNGs, though…

---

<div class="post-metadata">

**Author:** ![Voyager](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/voyager/32/133_2.png) [@Voyager](https://boards.straightdope.com/u/Voyager)\
**Post date:** [May 29, 2016, 10:17pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/56 "2016-05-29T22:17:50Z")

</div>

> [@TommySeven](#):
>
> I’m more of an FPGA guy than an ASIC guy, but yes, I’ve seen many flattened netlists for complex designs. Have you ever seen the binary reverse-engineering tools used e.g. to find vulnerabilities in x86 code? They’re sort of like a debugger that also lets you annotate and restructure the disassembled code in various ways, as you refine your best guess at what each instruction is doing.
> 
> I’m imagining the logic simulator equivalent of that. The goal, as with reverse-engineering of software, would be not to understand the complete design, but to find an attack that required you to understand as little as possible of that. I think you could develop a useful version of that tool for low millions of dollars, beyond academic budgets but easily within any government’s means.

For FPGAs such a tool would be fairly simple, if it doesn’t exist already. Of course you can just fiddle with the ROM holding the design so adding a backdoor would be fairly trivial.  
I started writing machine language - no assembler - and used to use adb a lot. Basic disassembly is trivial, tracing variables by looking at data flow from memory looks very doable - and no doubt done. Much simpler than the raw gate problem.

> [@](#):
>
> How much bigger are you thinking the hard IP would get? I liked the MMU because it seems like you potentially could implement an interesting backdoor (enable access to the operating system’s memory upon some undocumented register write) in ~100 gates, a small fraction of the total area.

I know FPGAs are sloppy. 🙂 When I was at Intel I owned a spreadsheet giving the area and number of transistors of every bit of logic my team owned.  
Looking at die photos of some of the chips I worked on, I don’t see a lot of empty space except in the I/O ring, and something there would show right up.

> [@](#):
>
> Maybe I have low standards for honesty? I just assume that since all papers will claim that, all such claims should be treated as meaningless, like an investor talking his book, or parents who think their children are beautiful. In any case, agreed that hardware backdoors look like academic toys for now, while shady component brokers selling floor sweepings are everywhere.

No one expects total practicality - though I do challenge it. You can say that saving area is important, say, and that this method saves area - even if what it saves is trivial and not worth the time. But these proposals made grandiose claims that were easily refuted. Anyhow, we care about our circulation, and we are more accessible than Transactions type journals, so we do want subject of interest to more than a few dozen people.  
And you got the real problem right.  
Their work is actually very interesting, they just need a better justification for it.

> [@](#):
>
> The extraordinary cost of IC fabrication equipment may help to discourage these backdoors. There’s really no such thing as a fly-by-night fab (at least, for modern digital processes), and anyone who has made such an investment would think very carefully about the cost of the reputation they’re about to destroy before inserting a backdoor that will almost surely be discovered within a few months of use. That’s not quite true for the hardware RNGs, though…

Exactly. I don’t know much about recent hardware RNGs, so I have no opinion about that discussion.

---

<div class="post-metadata">

**Author:** ![dropzone](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dropzone/32/7515_2.png) [@dropzone](https://boards.straightdope.com/u/dropzone)\
**Post date:** [May 29, 2016, 10:23pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/57 "2016-05-29T22:23:12Z")

</div>

> [@Lumpy](#):
>
> Are secret government backdoors built into all chips today?

I don’t know why I pay my taxes if they aren’t. 😉

---

<div class="post-metadata">

**Author:** ![TommySeven](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@TommySeven](https://boards.straightdope.com/u/TommySeven)\
**Post date:** [May 31, 2016, 7:52am UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/58 "2016-05-31T07:52:49Z")

</div>

> [@Voyager](#):
>
> For FPGAs such a tool would be fairly simple, if it doesn’t exist already.

What would make such a tool simpler for an FPGA than for an ASIC? After you’ve extracted the netlist, isn’t it almost exactly the same problem, equivalently difficult for equivalently complex designs? ASIC designs are probably bigger, but hard macros within ASICs (if used) aren’t necessarily.

> [@Voyager](#):
>
> I started writing machine language - no assembler - and used to use adb a lot. Basic disassembly is trivial, tracing variables by looking at data flow from memory looks very doable - and no doubt done. Much simpler than the raw gate problem.

The reverse-engineering tools go beyond that, with tools to annotate, and, more importantly, to interactively reorder and transform the code in ways that are functionally equivalent but that the operator thinks give more insight into what’s going on. I agree that a netlist is probably more difficult to reverse-engineer, per unit of complexity, than object code for a typical processor, but typical ASICs are also less complex (like in some kind of Kolmogorov sense, the shortest possible representation of each design) than operating system, game engine, etc. software that routinely gets reverse-engineered.

I wonder what the most serious effort has been so far to reverse-engineer a digital design from its masks. Maybe some kind of competitor analysis? That seems risky legally, given the heavy patent coverage, but maybe that will become more common as treble damages get awarded less often for knowing infringement? I’ve never seen any large-scale academic work.

---

<div class="post-metadata">

**Author:** ![Voyager](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/voyager/32/133_2.png) [@Voyager](https://boards.straightdope.com/u/Voyager)\
**Post date:** [May 31, 2016, 5:22pm UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/59 "2016-05-31T17:22:39Z")

</div>

> [@TommySeven](#):
>
> What would make such a tool simpler for an FPGA than for an ASIC? After you’ve extracted the netlist, isn’t it almost exactly the same problem, equivalently difficult for equivalently complex designs? ASIC designs are probably bigger, but hard macros within ASICs (if used) aren’t necessarily.

You wouldn’t really have to extract a netlist, would you? You can build it from the programming patterns. You’d still have to understand it, but that is an equivalent problem. If there is space for your backdoor it would be easy to add, but it is also easier to get caught.

> [@](#):
>
> The reverse-engineering tools go beyond that, with tools to annotate, and, more importantly, to interactively reorder and transform the code in ways that are functionally equivalent but that the operator thinks give more insight into what’s going on. I agree that a netlist is probably more difficult to reverse-engineer, per unit of complexity, than object code for a typical processor, but typical ASICs are also less complex (like in some kind of Kolmogorov sense, the shortest possible representation of each design) than operating system, game engine, etc. software that routinely gets reverse-engineered.

I guess they reverse engineer virus code all the time. Small ASICs might be easier to understand, but they’d have to be in a part of the system getting useful information.

> [@](#):
>
> I wonder what the most serious effort has been so far to reverse-engineer a digital design from its masks. Maybe some kind of competitor analysis? That seems risky legally, given the heavy patent coverage, but maybe that will become more common as treble damages get awarded less often for knowing infringement? I’ve never seen any large-scale academic work.

I’ve sat in on competitive analysis meetings, and it was all done either by looking at freely available information or by running various tests. I don’t think academics could handle anything that big - it is hard enough to get them to do anything on real ASIC netlists I was able to distribute as benchmarks.

---

<div class="post-metadata">

**Author:** ![TommySeven](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@TommySeven](https://boards.straightdope.com/u/TommySeven)\
**Post date:** [June 1, 2016, 2:25am UTC](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737/60 "2016-06-01T02:25:03Z")

</div>

> [@Voyager](#):
>
> You wouldn’t really have to extract a netlist, would you? You can build it from the programming patterns.

“Extract a netlist” is maybe a bit of a pretension. I mean compute it from the configuration bitstream, as you say, and that’s of course an easier task than any that we’ve been discussing. The “understanding” part is the interesting one.

Here’s someone who seems to have reverse-engineered a Russian 8080 clone. There’s not a lot of detail, but he ended up with a schematic and a transistor count. So I guess he did it entirely by hand from the die photo? Of course, that’s just 4758 transistors…

[http://zeptobars.com/en/read/KR580VM80A-intel-i8080-verilog-reverse-engineering](http://zeptobars.com/en/read/KR580VM80A-intel-i8080-verilog-reverse-engineering)

[Previous page](https://boards.straightdope.com/t/are-secret-government-backdoors-built-into-all-chips-today/500737.md?page=2)
