Implementation of a leakage-resilient ElGamal key encapsulation mechanism

David Galindo, Johann Großschädl, Zhe Liu, Praveen Kumar Vadnala, Srinivas Vivek

Introduction

Embedded security for IoT devices and smart cards faces a persistent threat: side-channel attacks. By monitoring physical characteristics like power consumption or electromagnetic emissions, attackers can extract secret keys during cryptographic operations. While "leakage-resilient" (LR) cryptography offers theoretical proofs of security under such conditions, a significant gap exists between these mathematical models and practical hardware implementations. This paper addresses this gap by proposing a more realistic security model and implementing an improved ElGamal-based key encapsulation mechanism (KEM) on a 32-bit ARM microcontroller.

A Practical Leakage Model

Theoretical LR models often rely on "bounded leakage," assuming an attacker can only learn a fixed number of bits. However, real-world power traces can contain gigabytes of data, making bit-counting models impractical. The authors propose a more flexible model based on min-entropy, requiring only that the secret input retains sufficient uncertainty after leakage occurs. This approach aligns more closely with the realities of side-channel analysis.

The KEM-CCmLA1 security game and leakage oracle definition.

The security of the KEM is evaluated through a formal game, as shown in the figure above, which incorporates a leakage oracle to simulate the information an adversary might gain during decapsulation. By using a different proof technique, the authors achieved a tighter security bound than previous literature, despite using this more relaxed and realistic leakage model.

The BEG-KEM+ Construction

The original Bilinear ElGamal (BEG-KEM) scheme is vulnerable to Simple Power Analysis (SPA) because it uses secret exponentiation for multiplicative blinding. In side-channel defense, operations where a secret bit controls a loop (such as square-and-multiply) are the most dangerous.

To eliminate this "Achilles heel," the authors introduce BEG-KEM+. This variant replaces secret-scalar multiplication with a deterministic encoding method—specifically the Fouque-Tibouchi method—that maps random strings directly to points on an elliptic curve. By avoiding secret-bit-controlled loops during the sensitive "refreshing" phase, the implementation becomes significantly more robust against power analysis. Furthermore, the authors argue that pairing-based cryptography is inherently more robust against SPA because the "secret" is a point on a curve rather than a scalar, making coordinate extraction from power traces significantly more difficult.

Hardware Implementation and Performance

The authors implemented BEG-KEM+ in ANSI C using the MIRACL library on an ARM Cortex-M3 (Arduino Due). They utilized an Ate pairing over a 254-bit Barreto-Naehrig (BN) curve, targeting a security level roughly equivalent to AES-128.

Performance comparison (in millions of clock cycles) between the original BEG-KEM and the hardened BEG-KEM+.

As shown in the table, the "hardened" BEG-KEM+ introduces minimal overhead. Encapsulation remains identical at 34 million cycles, while Decapsulation increases from 131 to 140 million cycles—a mere 6.8% performance penalty for substantially improved side-channel resistance. This work represents the first successful implementation and evaluation of a leakage-resilient public-key scheme from theoretical literature on a resource-constrained 32-bit processor.

Conclusion and Future Work

While the authors provide a strong practical perspective, they acknowledge limitations, such as the reliance on the "Generic Bilinear Group" model for security proofs. Future work should focus on optimizing the pairing operations themselves for microcontrollers, as the pairing remains the most computationally expensive part of the process, consuming approximately 65 million cycles. Nevertheless, this research demonstrates that robust side-channel protection can be achieved with manageable computational costs in real-world embedded systems.

Summary updated

Abstract

Leakage-resilient cryptography aims to extend the rigorous guarantees achieved through the provable security paradigm to physical implementations. The constructions designed on basis of this new approach inevitably suffer from an Achilles heel: a bounded leakage assumption is needed. Currently, a huge gap exists between the theory of such designs and their implementation to confirm the leakage resilience in practice. The present work tries to narrow this gap for the leakage-resilient bilinear ElGamal key encapsulation mechanism (BEG-KEM) proposed by Kiltz and Pietrzak in 2010. Our first contribution is a variant of the bounded leakage and the only-computation-leaks model that is closer to practice. We weaken the restriction on the image size of the leakage functions in these models and only insist that the inputs to the leakage functions have sufficient min-entropy left, in spite of the leakage, with no limitation on the quantity of this leakage. We provide a novel security reduction for BEG-KEM in this relaxed leakage model using the generic bilinear group axiom. Secondly, we show that a naive implementation of the exponentiation in BEG-KEM makes it impossible to meet the leakage bound. Instead of trying to find an exponentiation algorithm that meets the leakage axiom (which is a non-trivial problem in practice), we propose an advanced scheme, BEG-KEM+, that avoids exponentiation by a secret value, but rather uses an encoding into the base group due to Fouque and Tibouchi. Thirdly, we present a software implementation of BEG-KEM+ based on the Miracl library and provide detailed experimental results. We also assess its (theoretical) resistance against power analysis attacks from a practical perspective, taking into account the state-of-the-art in side-channel cryptanalysis.
BibTeX
@article{galindo2016implementation,
  author = {David Galindo and Johann Großschädl and Zhe Liu and Praveen Kumar Vadnala and Srinivas Vivek},
  title = {{Implementation of a leakage-resilient ElGamal key encapsulation mechanism}},
  journal = {J. Cryptogr. Eng.},
  year = {2016},
  doi = {10.1007/s13389-016-0121-x},
}
Figure