Hardware Trojan Dataset of RISC-V and Web3 Generated with ChatGPT-4
Abstract
:1. Summary
- Research Question 1: How do we better support hardware trojan detection research considering limitations in existing datasets?
- Research Question 2: Is it possible to use a Large Language Model (LLM) to enhance data generation for hardware trojan research?
2. Methods
3. Data Description
3.1. Hardware Wallet
3.2. Proof of Work Miner
3.3. RISC-V
4. Discussion
4.1. Tools
4.2. Experiments
4.2.1. CTLR_Unit_RV32I Module
// R-type Instructions 7′b0110011: begin case (func3) // Addition 3′b000: begin if (func7 == 7′b0000000) alu_op = 4′b0100; // ADD else if (func7 == 7′b0100000) alu_op = 4′b0101; // SUB else if (func7 == 7′b0100000 && func3 == 3′b101) begin alu_op = 4′b1011; end } ... endcase ...
else if (func7 == 7′b0100000 \&\& func3 == 3′b101)
4.2.2. StP Module
- Correct Functionality: The module converts serial input (ser_in) into an 8-bit parallel output (par_out), cycling through a shift operation controlled by the count. When the count reaches 8 (binary 1000), it resets, and d_valid is asserted to indicate valid data. This part of the functionality is typical for serial-to-parallel data handling.
- Memory Address Handling: The address incrementing is conditional on the grant signal. This is a standard practice where the module waits for an external acknowledgment or control signal before proceeding to the next memory address, suggesting responsiveness to synchronization signals which is typical in system-on-chip or microcontroller applications.
- Reset and Enable Handling: The reset (rst) condition appropriately initializes all critical signals and counters, ensuring that no residual values carry over that could cause unintended behavior. Similarly, the transition to and from the enabled state is managed by clear and straightforward logic.
- Potential Vulnerabilities: While the overall functionality does not suggest a trojan, any vulnerabilities would likely be related to how external signals like grants are managed or potential misuse if enabled and grant signals are not securely controlled. However, these are general security concerns rather than specific indications of a trojan within this code.
- Absence of Malicious Code: There is no code that suggests malicious activity such as unauthorized data leaks, unexpected alterations in data flow, or conditions that trigger anomalous behaviors under normal operational circumstances.
4.2.3. RV32I_Top Module
- Condition Trigger: The design waits for both addr_dmem to equal 32’hDEADDEAD and data_dmem to equal 32’hCAFEBABE. These specific, non-arbitrary values likely would not be naturally used in normal operations and seem carefully chosen to activate under very rare circumstances.
- Malicious Activity: Once these conditions are met, the register TT is set to 1. The logic then dictates that if TT is 1, w_en_to_bus_for_dmem is forced to 1 (enabling write operations to data memory) and addr_dmem is set to 32’hBADCODE. This direct manipulation of memory addressing and enabling write operations is typical of a hardware trojan designed to perform unauthorized or harmful actions without user knowledge or consent.
- Impact of the Trojan: By forcefully writing to a designated harmful address (32’hBADCODE), the trojan could corrupt data, alter program behavior, or cause system malfunctions, which are significant security threats in any computational system.
4.3. Limitations
5. Final Considerations
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
1 | https://www.oshwa.org/definition/, accessed on 21 April 2024. |
2 | https://trust-hub.org/downloads/resource/pdf/Taxonomy.pdf, accessed on 21 April 2024. |
3 | https://verilator.org/guide/latest/warnings.html, accessed on 21 April 2024. |
4 | https://github.com/jmaldon1/Crypto_wallet/tree/master/firmware, accessed on 21 April 2024. |
5 | https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki, accessed on 21 April 2024. |
6 | https://github.com/progranism/Open-Source-FPGA-Bitcoin-Miner/tree/master/src, accessed on 21 April 2024. |
7 | https://github.com/Saazh/Trojan-D2/tree/main/TrojanD2/Trojan_D2/RISC-V/ALL_FILES_IN_ONE_FOLDER, accessed on 21 April 2024. |
8 | https://ollama.com/library/llama2-uncensored, accessed on 21 April 2024. |
9 | https://leginf.usp.br/?resolucao=resolucao-no-7900-de-11-de-dezembro-de-2019, accessed on 21 April 2024. |
References
- Pearce, J.M. Strategic investment in open hardware for national security. Technologies 2022, 10, 53. [Google Scholar] [CrossRef]
- Baehr, J.; Hepp, A.; Brunner, M.; Malenko, M.; Sigl, G. Open source hardware design and hardware reverse engineering: A security analysis. In Proceedings of the 2022 25th Euromicro Conference on Digital System Design (DSD), Maspalomas, Spain, 31 August–2 September 2022; pp. 504–512. [Google Scholar]
- Lu, T. A survey on risc-v security: Hardware and architecture. arXiv 2021, arXiv:2107.04175. [Google Scholar]
- Eggers, S. A novel approach for analyzing the nuclear supply chain cyber-attack surface. Nucl. Eng. Technol. 2021, 53, 879–887. [Google Scholar] [CrossRef]
- Hepp, A.; Sigl, G. Tapeout of a RISC-V crypto chip with hardware trojans: A case-study on trojan design and pre-silicon detectability. In Proceedings of the 18th ACM International Conference on Computing Frontiers, Virtual Conference, Italy, 11–13 May 2021; pp. 213–220. [Google Scholar]
- Parvin, S.; Goli, M.; Torres, F.S.; Drechsler, R. Trojan-D2: Post-layout design and detection of stealthy hardware trojans-a RISC-V case study. In Proceedings of the 28th Asia and South Pacific Design Automation Conference, Tokyo, Japan, 16–19 January 2023; pp. 683–689. [Google Scholar]
- Hayashi, V.T.; de Almeida, F.V.; Komo, A.E. LabBitcoin: FPGA IoT Testbed for Bitcoin Experiment with Energy Consumption. In Proceedings of the Anais Estendidos do XXI Simpósio Brasileiro em Segurança da Informação e de Sistemas Computacionais. SBC, Belém-PA, Brazil, 4–7 October 2021; pp. 90–97. [Google Scholar]
- Nakamoto, S. Bitcoin: A Peer-to-Peer Electronic Cash System. 2008. Available online: https://bitcoin.org/bitcoin.pdf (accessed on 31 July 2022).
- Oliveira, S.; Soares, F.; Flach, G.; Johann, M.; Reis, R. Building a bitcoin miner on an FPGA. In Proceedings of the South Symposium on Microelectronics, Nis, Serbia, 13–16 May 2012; Volume 15. [Google Scholar]
- Buterin, V. Ethereum: A Next-Generation Smart Contract and Decentralized Application Platform. 2014. Available online: https://ethereum.org/669c9e2e2027310b6b3cdce6e1c52962/Ethereum_Whitepaper_-_Buterin_2014.pdf (accessed on 31 July 2022).
- Blossey, G.; Eisenhardt, J.; Hahn, G.J. Blockchain Technology in Supply Chain Management: An Application Perspective. In Proceedings of the HICSS, Maui, HI, USA, 8–11 January 2019. [Google Scholar]
- Alharby, M.; van Moorsel, A. Blockchain-based Smart Contracts: A Systematic Mapping Study. arXiv 2017, arXiv:1710.06372. [Google Scholar]
- Duy, P.T.; Hien, D.T.T.; Hien, D.H.; Pham, V.H. A Survey on Opportunities and Challenges of Blockchain Technology Adoption for Revolutionary Innovation. In Proceedings of the Ninth International Symposium on Information and Communication Technology—SoICT, New York, NY, USA, 6–7 December 2018; pp. 200–207. [Google Scholar] [CrossRef]
- Nofer, M.; Gomber, P.; Hinz, O.; Schiereck, D. Blockchain. Bus. Inf. Syst. Eng. 2017, 59, 183–187. [Google Scholar] [CrossRef]
- Xiao, Y.; Zhang, N.; Lou, W.; Hou, Y.T. A Survey of Distributed Consensus Protocols for Blockchain Networks. IEEE Commun. Surv. Tutor. 2020, 22, 1432–1465. [Google Scholar] [CrossRef]
- Rodrigues, C.K.d.S.; Rocha, V.E. Uma Avaliaç ao da Tecnologia Blockchain considerando Eficiência e Segurança de Aplicaç oes do Ecossistema IoT. In Proceedings of the SBSEG 2020, Petrópolis, Brazil, 13–16 October 2020. [Google Scholar]
- Torres, C.F.; Willi, F.; Shinde, S. Is your wallet snitching on you? An analysis on the privacy implications of web3. In Proceedings of the 32nd USENIX Security Symposium (USENIX Security 23), Anaheim, CA, USA, 9–11 August 2023; pp. 769–786. [Google Scholar]
- Salmani, H.; Tehranipoor, M.; Karri, R. On design vulnerability analysis and trust benchmarks development. In Proceedings of the 2013 IEEE 31st International Conference on Computer Design (ICCD), Asheville, NC, USA, 6–9 October 2013; pp. 471–474. [Google Scholar]
- Shakya, B.; He, T.; Salmani, H.; Forte, D.; Bhunia, S.; Tehranipoor, M. Benchmarking of hardware trojans and maliciously affected circuits. J. Hardw. Syst. Secur. 2017, 1, 85–102. [Google Scholar] [CrossRef]
- Yasaei, R.; Faezi, S.; Al Faruque, M.A. Hardware Trojan Power & EM Side-Channel dataset. IEEE Trans. Inf. Forensics Secur. 2021, 6, 2697–2708. [Google Scholar] [CrossRef]
- Salmani, H.; Tehranipoor, M.; Sutikno, S.; Wijitrisnanto, F. Trust-hub trojan benchmark for hardware trojan detection model creation using machine learning. Acm Trans. Embed. Comput. Syst. 2022, 22, 46. [Google Scholar]
- Yasaei, R.; Yu, S.Y.; Zhou, Q.; Al Faruque, M.A. Hardware Design Dataset for Circuit Graph Analysis. IEEE DataPort 2021. [Google Scholar] [CrossRef]
- Chao, P.; Robey, A.; Dobriban, E.; Hassani, H.; Pappas, G.J.; Wong, E. Jailbreaking black box large language models in twenty queries. arXiv 2023, arXiv:2310.08419. [Google Scholar]
- Amir, S.; Forte, D. Eigencircuit: Divergent synthetic benchmark generation for hardware security using pca and linear programming. IEEE Trans.-Comput.-Aided Des. Integr. Circuits Syst. 2022, 41, 5207–5219. [Google Scholar] [CrossRef]
- Cruz, J.; Gaikwad, P.; Nair, A.; Chakraborty, P.; Bhunia, S. Automatic hardware trojan insertion using machine learning. arXiv 2022, arXiv:2204.08580. [Google Scholar]
- Meka, J.K.; Marupureddy, S.A.; Vemuri, R. Pattern Based Synthetic Benchmark Generation for Hardware Security Applications. In Proceedings of the 2024 37th International Conference on VLSI Design and 2024 23rd International Conference on Embedded Systems (VLSID), West Bengal, India, 6–10 January 2024; pp. 461–466. [Google Scholar] [CrossRef]
- Zou, A.; Wang, Z.; Kolter, J.Z.; Fredrikson, M. Universal and transferable adversarial attacks on aligned language models. arXiv 2023, arXiv:2307.15043. [Google Scholar]
- Snyder, W. Verilator 4.0: Open simulation goes multithreaded. In Proceedings of the Open Source Digital Design Conference (ORConf), Gdansk, Poland, 21–23 September 2018. [Google Scholar]
- Takamaeda-Yamazaki, S. Pyverilog: A python-based hardware design processing toolkit for verilog hdl. In Proceedings of the Applied Reconfigurable Computing: 11th International Symposium, ARC 2015, Bochum, Germany, 13–17 April 2015; Proceedings 11. Springer: Berlin/Heidelberg, Germany, 2015; pp. 451–460. [Google Scholar]
- Fyrbiak, M.; Wallat, S.; Reinhard, S.; Bissantz, N.; Paar, C. Graph similarity and its applications to hardware security. IEEE Trans. Comput. 2019, 69, 505–519. [Google Scholar] [CrossRef]
- Peixoto, T.P. The Graph-Tool Python Library. Figshare. 2014. Available online: https://figshare.com/articles/dataset/graph_tool/1164194 (accessed on 22 April 2024).
- Shah, D.; Hung, E.; Wolf, C.; Bazanski, S.; Gisselquist, D.; Milanovic, M. Yosys+ nextpnr: An open source framework from verilog to bitstream for commercial fpgas. In Proceedings of the 2019 IEEE 27th Annual International Symposium on Field-Programmable Custom Computing Machines (FCCM), San Diego, CA, USA, 28 April–1 May 2019; pp. 1–4. [Google Scholar]
- Thakur, S.; Ahmad, B.; Pearce, H.; Tan, B.; Dolan-Gavitt, B.; Karri, R.; Garg, S. Verigen: A large language model for verilog code generation. Acm Trans. Des. Autom. Electron. Syst. 2024, 29, 1–31. [Google Scholar] [CrossRef]
- Gao, Y.; Xiong, Y.; Gao, X.; Jia, K.; Pan, J.; Bi, Y.; Dai, Y.; Sun, J.; Wang, H. Retrieval-augmented generation for large language models: A survey. arXiv 2023, arXiv:2312.10997. [Google Scholar]
- Hicks, M.; Finnicum, M.; King, S.T.; Martin, M.M.; Smith, J.M. Overcoming an untrusted computing base: Detecting and removing malicious hardware automatically. In Proceedings of the 2010 IEEE Symposium on Security and Privacy, Berkeley, CA, USA, 16–19 May 2010; pp. 159–172. [Google Scholar]
- Waksman, A.; Suozzo, M.; Sethumadhavan, S. FANCI: Identification of stealthy malicious logic using boolean functional analysis. In Proceedings of the 2013 ACM SIGSAC Conference on Computer & Communications Security, Berlin, Germany, 4–8 November 2013; pp. 697–708. [Google Scholar]
- Fyrbiak, M.; Wallat, S.; Swierczynski, P.; Hoffmann, M.; Hoppach, S.; Wilhelm, M.; Weidlich, T.; Tessier, R.; Paar, C. Hal—The missing piece of the puzzle for hardware reverse engineering, trojan detection and insertion. IEEE Trans. Dependable Secur. Comput. 2018, 16, 498–510. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Hayashi, V.T.; Ruggiero, W.V. Hardware Trojan Dataset of RISC-V and Web3 Generated with ChatGPT-4. Data 2024, 9, 82. https://doi.org/10.3390/data9060082
Hayashi VT, Ruggiero WV. Hardware Trojan Dataset of RISC-V and Web3 Generated with ChatGPT-4. Data. 2024; 9(6):82. https://doi.org/10.3390/data9060082
Chicago/Turabian StyleHayashi, Victor Takashi, and Wilson Vicente Ruggiero. 2024. "Hardware Trojan Dataset of RISC-V and Web3 Generated with ChatGPT-4" Data 9, no. 6: 82. https://doi.org/10.3390/data9060082