RevEAL: Single-Trace Side-Channel Leakage of the SEAL Homomorphic Encryption Library

Furkan Aydin, Emre Karabulut, Seetal Potluri, Erdem Alkim, Aydin AysuIACR ePrint 2022 · OpenReview

TL;DR

This paper presents the first side-channel attack on homomorphic encryption (HE) using power analysis, specifically targeting Microsoft SEAL's implementation of the BFV protocol. The attack exploits a vulnerability in the Gaussian sampling subroutine, allowing an attacker to extract the entire plaintext message from a single power measurement. This significantly reduces the security of HE systems, highlighting the need for robust defenses as HE adoption grows.

What Problem Does This Paper Address?

Homomorphic encryption (HE) is a revolutionary cryptographic technique that allows computations to be performed on encrypted data without decrypting it. This enables privacy-preserving cloud computing, where sensitive data can be processed without revealing it to the cloud provider. However, like any complex cryptographic system, HE implementations can be vulnerable to physical attacks, not just mathematical ones. This paper addresses the critical gap of understanding and demonstrating the practical security risks posed by side-channel attacks on HE, specifically focusing on power consumption analysis. While HE promises enhanced privacy, its real-world deployment hinges on its resilience against such physical leakage. The authors aim to show that even sophisticated HE libraries like Microsoft SEAL, which is widely used, can be vulnerable to a single-trace power analysis attack, potentially compromising the confidentiality of the encrypted data.

Methods

The core of the attack lies in exploiting a vulnerability within the Gaussian sampling subroutine of the SEAL library's BFV encryption implementation. The authors' approach involves several key steps:

  1. Identifying Target Operation: They pinpoint the Gaussian sampling phase as the critical point for attack, as it generates the "noise" polynomials essential for HE security.
  2. Exploiting Control-Flow Leakage: The attack leverages the fact that different branches of conditional statements within the Gaussian sampling code (e.g., for positive, negative, or zero noise values) execute different instructions, leading to distinct power consumption patterns. By analyzing a single power trace, they can determine which branch was taken, thus inferring the sign of the sampled coefficient.
  3. Extracting Coefficient Values: Further analysis of the power trace, specifically focusing on data-flow variations, allows them to recover the actual values of the sampled coefficients with high probability.
  4. BKZ Algorithm for Search Space Reduction: After extracting partial information (sign and approximate values), the Blockwise Korkine-Zolotarev (BKZ) algorithm is employed to efficiently explore the remaining search space and reconstruct the full plaintext message. This is crucial because the sampled coefficients change with each encryption.

This methodology is novel in its application to HE and specifically targets SEAL's implementation, differentiating it from prior side-channel attacks on other cryptographic primitives or different sampling techniques.

Datasets

The paper does not explicitly mention using pre-existing datasets for training or evaluation. Instead, the authors generate their own "datasets" through real-world power measurements. They capture 25,000 power traces for the attack stage after profiling the system with 220,000 power traces to create template profiles of sampled coefficients. This approach is typical for side-channel analysis, where the "dataset" is derived from the actual device under attack.

Key Insights and Ideas

  • HE is Not Immune to Physical Attacks: The most significant insight is that even advanced cryptographic primitives like HE are susceptible to physical side-channel attacks, challenging the assumption that mathematical complexity alone guarantees security.
  • Single-Trace Attack Feasibility: The ability to extract the entire plaintext from a single power measurement trace is a critical finding. This bypasses defenses that rely on averaging multiple traces or masking techniques designed for multi-trace attacks.
  • Gaussian Sampling is a Weak Link: The Gaussian sampling subroutine, a fundamental component of many HE schemes, is identified as a specific vulnerability point. The conditional logic within this process leaks information about the sampled coefficients.
  • Sign Leakage is Key: The distinct power signatures of different control-flow branches (positive, negative, zero) provide a reliable way to determine the sign of the sampled coefficients, which is a crucial first step in the attack.
  • Practical Security Reduction: The attack demonstrates a dramatic reduction in the effective security level of HE, moving from a theoretical 128-bit security to a much lower level (equivalent to 4.4 bits in one scenario).

Key Results

The paper reports a successful single-trace side-channel attack on Microsoft SEAL (version prior to v3.6) that implements the Brakerski/Fan-Vercauteren (BFV) protocol.

  • Message Extraction: The attack can extract the entire plaintext message with a single power measurement.
  • Security Reduction: For a SEAL-128 parameter set, the attack reduces the plaintext encryption security level from $2^{128}$ to $2^{4.4}$.
  • Sign Guessing Accuracy: The attack achieves 100% success rate in guessing the sign of the coefficients.
  • FPGA Implementation: The attack was successfully demonstrated on a RISC-V FPGA implementation of SEAL v3.2.

Limitations and Future Work

  • Specific SEAL Version: The attack targets SEAL versions prior to v3.6. Microsoft has since updated the sampling algorithm in SEAL v3.6 and later, which may introduce different vulnerabilities or mitigate this specific one. The authors suggest that future work should investigate these newer versions.
  • Template Attacks: The attack relies on template attacks, which require profiling the target device and having access to its configuration. This might limit its applicability in scenarios where such profiling is not feasible.
  • Platform Dependence: The attack was performed on a specific FPGA platform at a controlled frequency (1.5 MHz). Attacking devices with higher clock frequencies or different architectures might require more advanced equipment and techniques.
  • Other Vulnerabilities: The authors acknowledge that other parts of the HE encryption process (e.g., NTT, polynomial multiplication) could also be vulnerable to side-channel attacks, and their work focuses specifically on Gaussian sampling.
  • Future Work: The authors encourage developers to incorporate countermeasures like shuffling or other forms of randomization. They also suggest exploring defenses against newer versions of SEAL and investigating the impact of higher security levels (e.g., 196-bit or 256-bit) on the attack's effectiveness.

Summary updated

Abstract

This paper demonstrates the first side-channel attack on homomorphic encryption (HE), which allows computing on encrypted data. We reveal a power-based side-channel leakage of Microsoft SEAL prior to v3.6 that implements the Brakerski/Fan-Vercauteren (BFV) protocol. Our proposed attack targets the Gaussian sampling in the SEAL’s encryption phase and can extract the entire message with a single power measurement. Our attack works by (1) identifying each coefficient index being sampled, (2) extracting the sign value of the coefficients from control-flow variations, (3) recovering the coefficients with a high probability from data-flow variations, and (4) using a Blockwise Korkine-Zolotarev (BKZ) algorithm to efficiently explore and estimate the remaining search space. Using real power measurements, the results on a RISC-V FPGA implementation of the SEAL (v3.2) show that the proposed attack can reduce the plaintext encryption security level from 2ˆ128 to 2ˆ4.4. Therefore, as HE gears toward real-world applications, such attacks and related defenses should be considered.
BibTeX
@article{aydin2022reveal,
  author = {Furkan Aydin and Emre Karabulut and Seetal Potluri and Erdem Alkim and Aydin Aysu},
  title = {{RevEAL: Single-Trace Side-Channel Leakage of the SEAL Homomorphic Encryption Library}},
  journal = {IACR Cryptol. ePrint Arch.},
  year = {2022},
  url = {https://openreview.net/forum?id=nDBcIzoykH},
}
Figure