Modules / M7

Supply chainDigital logicWritten material

Hardware Trojan insertion

The topic

A hardware Trojan is extra logic that stays dormant on almost every input and changes the function on a rare trigger. Students add a combinational trigger and a payload to a locked adder.

Where it belongs

Course: Digital logic.
Teach this after: detecting one input value and writing a conditional assignment. If you also assign the locking lab, do this lab second. The starter file is already locked. The lab is written and has not been graded yet.

Files and how to use them

There is no slide deck. The manual is the assignment. Students change only the marked region of the locked adder.

  • Lab manual. The five parts of the report and the questions. Use it as the in-class handout.
  • FullAdder.vhdl. Provided so the design compiles. Students do not modify it.
  • 4BitAdder_Key.vhdl. The locked adder. The trigger and the payload go where the file marks the spot. That region is empty in the starter.
  • tb_4BitAdder.vhdl. The testbench students simulate. The manual names the file tb_4BitAdder_Key.vhdl. The file in this bundle is tb_4BitAdder.vhdl.

Video lectures

These are links, not files stored with the module. Play one in class, or send the link to students.

Further reading

Optional papers for the instructor, or for a student who wants to read past the assignment.

  • Bhunia, Hsiao, Banga, and Narasimhan, “Hardware Trojan Attacks: Threat Analysis and Countermeasures,” Proceedings of the IEEE, vol. 102, no. 8, pp. 1229–1247, 2014.
  • Xiao, Forte, Jin, Karri, Bhunia, and Tehranipoor, “Hardware Trojans: Lessons Learned After One Decade of Research,” ACM Transactions on Design Automation of Electronic Systems, vol. 22, no. 1, 2016.

The exercise

Students receive the adder already locked. They do not modify the full adder and they do not modify the locking equations. The work is a trigger and a payload. The trigger is combinational, looks only at the two operands, and asserts on a single combination the student chooses. The payload runs only while the trigger is asserted and changes at least one bit of the key before that key reaches the locking gates. For every other input the adder still behaves as the lock intends.

Outcome

The sum is correct everywhere except the trigger combination, where the altered key corrupts the carry chain. The student explains why the Trojan is invisible on every other input, and how a one-bit change in the key becomes a fault that ripples into the higher bits.

The five parts of the report

  1. Read the lock. Explain the key port and both locking styles. The provided architecture uses XOR and XNOR on the masked carries. A multiplexer version is left in comments.
  2. Design the trigger. Pick one pair of operand values. Implement it as combinational logic on a signal named trigger. Say why that pair is rare.
  3. Design the payload. Build a modified key that differs from the real key only when trigger is 1, and only in at least one bit. Leave the obfuscation equations alone.
  4. Simulate both cases. The supplied testbench holds carry-in at 0, drives the key port with 010, and walks the operand space. Find the activation in the waveform. Show A, B, the sum, and carry-out in unsigned decimal.
  5. Explain the hiding. Which key bit changed, how that change moves through the carry chain, and why every other input still looks like a correct, locked adder.

The starter file marks the region where the trigger and payload belong and does not contain them. Completing that region is the lab.

Support

This work was supported in part by the U.S. National Science Foundation (NSF) Secure and Trustworthy Cyberspace (SaTC) program under Award No. 2114157.

Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the U.S. National Science Foundation.

The project is a collaboration of the University of Kansas, the University of Florida, and Florida International University.