MaskedNet: A Pathway for Secure Inference against Power Side-Channel Attacks

Anuj Dubey, Rosario Cammarota, Aydin Aysu

Abstract

Differential Power Analysis (DPA) has been an active area of research for the past two decades to study the attacks for extracting secret information from cryptographic implementations through power measurements and their defenses. Unfortunately, the research on power side-channels have so far predominantly focused on analyzing implementations of ciphers such as AES, DES, RSA, and recently post-quantum cryptography primitives. Meanwhile, machine-learning applications are becoming ubiquitous with several scenarios where the Machine Learning Models are Intellectual Properties requiring confidentiality. Expanding side-channel analysis to Machine Learning Model extraction, however, is largely unexplored. This paper expands the DPA framework to neural-network classifiers. First, it shows DPA attacks during inference to extract the secret model parameters such as weights and biases of a neural network. Second, it proposes the first countermeasures against these attacks by augmenting masking. The resulting design uses novel masked components such as masked adder trees for fully-connected layers and masked Rectifier Linear Units for activation functions. On a SAKURA-X FPGA board, experiments show that the first-order DPA attacks on the unprotected implementation can succeed with only 200 traces and our protection respectively increases the latency and area-cost by 2.8x and 2.3x.

Introduction

As Machine Learning (ML) moves to the edge, integrated into IoT devices and smartphones, the underlying models—specifically their weights and biases—represent critical intellectual property. However, when these models execute on physical hardware, they are susceptible to information leakage via power consumption. This paper addresses Differential Power Analysis (DPA) in the context of neural networks. By measuring minute fluctuations in power during mathematical operations, an attacker can correlate power traces with hypothesized weight values. The authors demonstrate that an unprotected Binarized Neural Network (BNN) can be fully compromised with as few as 200 power measurements.

Methods: MaskedNet Architecture

To counter DPA, the authors introduce MaskedNet, which employs an algorithm-level countermeasure known as masking. Instead of processing a secret value $x$ directly, the hardware splits it into two shares: a random mask $r$ and a masked value $(x - r)$. Since the hardware processes these shares independently, the instantaneous power consumption no longer correlates directly with the secret value $x$.

A core innovation of MaskedNet is the Masked Adder Tree, which redesigns standard summation hardware to handle masked shares securely across multiple stages of computation.

Figure 6: Architecture of a Masked Adder Tree, showing the multi-stage summation process designed to prevent power-based leakage of intermediate values.

Furthermore, the authors addressed the "sign-bit" leakage inherent in standard arithmetic masking by integrating Wave Differential Dynamic Logic (WDDL) for sign-bit computations. They also developed masked activation functions using a chain of masked Look-Up Tables (LUTs) to compute the sign of a sum without unmasking intermediate values.

Experimental Results

The researchers evaluated MaskedNet using a 3-layer fully-connected BNN implemented on a SAKURA-X FPGA board, trained on the MNIST dataset. The effectiveness of the DPA attack on unprotected hardware is evident as the correlation for the correct weight hypothesis quickly diverges from the noise as more measurements are collected.

Figure 5: Pearson correlation (ρ) vs. the number of measurements. The colored lines represent the correlation of the correct weight hypothesis, which becomes statistically significant as the number of traces increases.

While the unprotected baseline was broken with only 200 traces, the MaskedNet implementation remained secure against first-order DPA even after 100,000 traces. This security comes at a hardware cost: a 2.8x increase in latency and a 2.3x increase in area utilization (LUTs and Flip-Flops).

Conclusion

MaskedNet represents a significant step toward securing machine learning intellectual property on edge devices. By adapting cryptographic masking techniques to the unique requirements of neural networks—such as non-modular arithmetic and activation functions—the authors provide a robust defense against first-order power side-channel attacks. Future work will explore defenses against higher-order attacks and scaling these techniques to more complex, high-precision models.

Summary updated

Abstract

Differential Power Analysis (DPA) has been an active area of research for the past two decades to study the attacks for extracting secret information from cryptographic implementations through power measurements and their defenses. Unfortunately, the research on power side-channels have so far predominantly focused on analyzing implementations of ciphers such as AES, DES, RSA, and recently post-quantum cryptography primitives (e.g., lattices). Meanwhile, machine-learning, and in particular deep-learning applications are becoming ubiquitous with several scenarios where the Machine Learning Models are Intellectual Properties requiring confidentiality. Expanding side-channel analysis to Machine Learning Model extraction, however, is largely unexplored. This paper expands the DPA framework to neural-network classifiers. First, it shows DPA attacks during inference to extract the secret model parameters such as weights and biases of a neural network. Second, it proposes the $\textit{first countermeasures}$ against these attacks by augmenting $\textit{masking}$. The resulting design uses novel masked components such as masked adder trees for fully-connected layers and masked Rectifier Linear Units for activation functions. On a SAKURA-X FPGA board, experiments show that the first-order DPA attacks on the unprotected implementation can succeed with only 200 traces and our protection respectively increases the latency and area-cost by 2.8x and 2.3x.
BibTeX
@inproceedings{dubey2020maskednet,
  author = {Anuj Dubey and Rosario Cammarota and Aydin Aysu},
  title = {{MaskedNet: A Pathway for Secure Inference against Power Side-Channel Attacks}},
  booktitle = {HOST},
  year = {2020},
  url = {https://openreview.net/forum?id=MX7uHSWg6s},
}
Figure