Trace Copilot: Automatically Locating Cryptographic Operations in Side-Channel Traces by Firmware Binary Instrumenting

Authors

  • Shipei Qu School of Electronic Information and Electrical Engineering, Shanghai Jiao Tong University, Shanghai, China; State Key Laboratory of Cryptology, P.O. Box 5159, Beijing, 100878, China
  • Yuxuan Wang School of Electronic Information and Electrical Engineering, Shanghai Jiao Tong University, Shanghai, China; State Key Laboratory of Cryptology, P.O. Box 5159, Beijing, 100878, China
  • Jintong Yu School of Electronic Information and Electrical Engineering, Shanghai Jiao Tong University, Shanghai, China; State Key Laboratory of Cryptology, P.O. Box 5159, Beijing, 100878, China
  • Chi Zhang School of Electronic Information and Electrical Engineering, Shanghai Jiao Tong University, Shanghai, China; State Key Laboratory of Cryptology, P.O. Box 5159, Beijing, 100878, China
  • Dawu Gu School of Electronic Information and Electrical Engineering, Shanghai Jiao Tong University, Shanghai, China; State Key Laboratory of Cryptology, P.O. Box 5159, Beijing, 100878, China

DOI:

https://doi.org/10.46586/tches.v2025.i1.128-159

Keywords:

Side-channel analysis, Software/Hardware co-analysis, Binary instrumentation, Locating of cryptographic operations

Abstract

A common assumption in side-channel analysis is that the attacker knows the cryptographic algorithm implementation of the victim. However, many labsetting studies implicitly extend this assumption to the knowledge of the source code, by inserting triggers to measure, locate or align the Cryptographic Operations (CO) in the trace. For real-world attacks, the source code is typically unavailable, which poses a challenge for locating the COs thus reducing the effectiveness of many methods. In contrast, obtaining the (partial) binary firmware is more prevalent in practical attacks on embedded devices. While binary code theoretically encapsulates necessary information for side-channel attacks on software-implemented cryptographic algorithms, there is no systematic study on leveraging this information to facilitate side-channel analysis. This paper introduces a novel and general framework that utilizes binary information for the automated locating of COs on side-channel traces. We first present a mechanism that maps the execution flow of binary instructions onto the corresponding side-channel trace through a tailored static binary instrumentation process, thereby transforming the challenge of locating COs into one of tracing cryptographic code execution within the binary. For the latter, we propose a method to retrieve binary instruction addresses that are equivalent to the segmenting boundaries of the COs within side-channel traces. By identifying the mapping points of these instructions on the trace, we can obtain accurate segmentation labeling for the sidechannel data. Further, by employing the well-labeled side-channel segments obtained on a profiling device, we can readily identify the locations of COs within traces collected from un-controllable target devices. We evaluate our approach on various devices and cryptographic software, including a real-world secure boot program. The results demonstrate the effectiveness of our method, which can automatically locate typical COs, such as AES or ECDSA, in raw traces using only the binary firmware and a profiling device. Comparison experiments indicate that our method outperforms existing techniques in handling noisy or jittery traces and scales better to complex COs. Performance evaluation confirms that the runtime and storage overheads of the proposed approach are practical for real-world deployment.

Downloads

Published

2024-12-09

Issue

Section

Articles

How to Cite

Trace Copilot: Automatically Locating Cryptographic Operations in Side-Channel Traces by Firmware Binary Instrumenting. (2024). IACR Transactions on Cryptographic Hardware and Embedded Systems, 2025(1), 128-159. https://doi.org/10.46586/tches.v2025.i1.128-159