What Is a Hardware Trojan, and How Is One Detected?

A hardware trojan is a deliberate, hidden modification to a chip's design or manufacture. It has two parts: a trigger, a rare condition that activates it, and a payload, what it does once active, such as leaking a key, corrupting a result or disabling the chip. Because the trigger is rare, normal functional testing almost never activates it, so detection relies on looking at the design and at the chip's physical behavior, not only at its outputs.

Before you start

This is defensive knowledge, for building and testing your own hardware or hardware you are authorized to test. It explains mechanisms and defenses with references to published research. It does not give step-by-step attacks on products or systems you don't own.

What you'll learn

  • Triggers and payloads
  • Where in the supply chain a trojan can be inserted
  • Why random testing almost never finds one, with numbers
  • Detection: logic testing, side-channel fingerprinting and formal methods
  • Prevention by design

Triggers and payloads

PartExamples from the literature
TriggerA rare combination of internal signal values; a counter reaching a value after a long time; a specific input sequence
PayloadLeaking data through an output or a side channel; flipping a result bit; denial of service
Always-onNo trigger at all: for example, a change that shortens the chip's life

Where they can be inserted

Modern chips involve many parties: third-party IP blocks, EDA tools, a design team, often an external foundry, and test and packaging houses. A trojan can be added in a purchased IP block's RTL, in the netlist, or in the layout at an untrusted fab, where the attacker sees only geometry. The further down the flow, the harder it is to insert but also to detect.

Anatomy of a hardware trojanNormal circuit inputs pass through the original logic to the outputs. A hidden trigger watches rare internal conditions; when it fires, the payload alters an output or leaks data.InputsOriginal logicOutputsTriggerrare conditionPayloadfires
The trigger sits idle through normal testing; only the rare condition activates the payload.

Why random tests miss them

Suppose a trigger fires only when 32 specific internal bits take one particular pattern. A random vector hits it with probability 1 in 2^32, about 1 in 4.29 billion. A billion random vectors would expect only 0.23 activations, and have only about a 21% chance of activating it even once. Real triggers are chosen from nodes that are rarely active, so the odds are worse still.

Detection

  • Logic testing aimed at rare nodes: find signals that are almost never 0 or 1 in simulation and generate tests that drive them, as in the MERO approach, which tries to exercise each rare condition many times.
  • Side-channel fingerprinting: compare power, delay or EM measurements of chips under test with a trusted reference (a 'golden' chip); extra logic changes leakage current and path delays, even when it is idle.
  • Formal and structural analysis: equivalence checking between the RTL and the netlist, and searching for logic that is almost never active or that doesn't affect any specified function.
  • Physical inspection: delayering a sample of chips and comparing the layout with the design, which is slow and destructive.

Prevention by design

  • Trusted foundries and audited IP for sensitive parts.
  • Split manufacturing: the fab sees only part of the layout.
  • Logic obfuscation and camouflaging, so an attacker at the fab can't tell what a block does.
  • Filling unused layout space with functional filler cells, so there is no room to add logic unnoticed.
  • Run-time monitors that check for out-of-spec behavior.

Common mistakes

  • Thinking full functional coverage rules out a trojan. It tests the specified function, and a trojan stays inside it until triggered.
  • Relying on one golden chip without verifying it is clean.
  • Ignoring third-party IP because it was purchased.
  • Treating detection as a one-time check rather than part of the flow.

Check your understanding

  • Q1. What are the two parts of a hardware trojan? Answer: a trigger (when it activates) and a payload (what it does).
  • Q2. Why can side-channel measurements find a trojan that never triggers in test? Answer: its extra logic changes leakage power and path delays even while idle.
  • Q3. A trigger needs 20 specific bits. What is the chance per random vector? Answer: 1 in 2^20, about 1 in a million.

The series

Related

Sources

Tehranipoor and Koushanfar, 'A Survey of Hardware Trojan Taxonomy and Detection', IEEE Design and Test of Computers, 2010; Chakraborty and colleagues, 'MERO: A Statistical Approach for Hardware Trojan Detection', CHES 2009; Bhunia and Tehranipoor, Hardware Security: A Hands-on Learning Approach, Morgan Kaufmann, 2018.

Last verified

The trigger probabilities are computed in the site's tests (lib/batch9Numbers.test.js) on 16 November 2026.