Algorithm-Aware Side-Channel Analysis Framework for CRYSTALS-Kyber

Aaron Schnacky Independent Researcher, USA

Abstract

Existing side-channel analysis tools such as Valgrind, Cachegrind, and ChipWhisperer provide generalized instrumentation capable of observing timing, memory, and power behavior across arbitrary programs. However, these tools lack semantic awareness of the cryptographic algorithms they instrument, limiting their ability to contextualize observations meaningfully. This paper proposes the design and implementation of an algorithm-aware side-channel analysis framework specifically targeting CRYSTALS-Kyber, a NIST-standardized post-quantum key encapsulation mechanism. By embedding structural knowledge of Kyber's polynomial arithmetic, noise sampling, and encoding operations directly into the analysis harness, this framework can produce precise, actionable vulnerability reports mapped to specific operations and code paths — functionality that general-purpose tools cannot provide.


1. Introduction

The standardization of CRYSTALS-Kyber (now designated ML-KEM under FIPS 203) marks a pivotal shift in cryptographic infrastructure. As deployment accelerates across TLS, secure messaging, and government systems, the correctness of Kyber implementations becomes a matter of national security concern. Side-channel vulnerabilities — particularly timing and cache-based attacks — have historically undermined cryptographic implementations even when the underlying algorithm is mathematically sound.

Current tooling for detecting such vulnerabilities falls into two categories:

Neither category addresses the need for a software-based, algorithm-aware harness that can be run in CI/CD pipelines, evaluated by independent researchers, and tuned specifically for post-quantum primitive behavior. This gap motivates the development of a dedicated framework.


2. Background

2.1 CRYSTALS-Kyber Overview

Kyber is a lattice-based key encapsulation mechanism built on the Module Learning With Errors (MLWE) problem. Its core operations include:

Constant-time behavior is required across all secret-dependent branches and memory accesses. Any deviation in timing, cache access pattern, or branch prediction correlated with secret data constitutes a potential side-channel leak.

2.2 Limitations of Existing Tools

Tool

Approach

Limitation

Valgrind/Memcheck

Memory access tracking

No cryptographic context

Cachegrind

Cache simulation

Cannot distinguish secret vs. public dependent access

ChipWhisperer

Power/EM measurement

Requires hardware; not CI-compatible

dudect

Statistical timing

Generic; no operation-level mapping

ctgrind

Constant-time checking

Taint analysis only; no Kyber-specific heuristics

The absence of algorithm-specific context means these tools either produce noisy, hard-to-interpret output or require substantial manual work to trace observations back to meaningful operations.


3. Proposed Framework

3.1 Design Philosophy

The proposed framework, tentatively named KyberScope, is built on three principles:

3.2 Architecture

KyberScope is composed of four modules:

Module 1: Instrumented Kyber Runtime A Rust implementation of Kyber with fine-grained hooks inserted at each logical operation boundary — polynomial multiplication, NTT transforms, noise sampling, encoding/decoding. Each hook captures timing (via CPU performance counters using the rdtsc instruction), L1/L2 cache miss counts, and branch prediction outcomes.

Module 2: Input Corpus Generator Generates structured input sets designed to exercise secret-dependent code paths. Inputs are crafted to produce known secret values against which timing and memory observations are correlated. This includes:

Module 3: Differential Statistical Engine Runs each input class thousands of times, collecting measurement distributions. Applies:

This is methodologically similar to Test Vector Leakage Assessment (TVLA) but scoped to Kyber's specific operational boundaries.

Module 4: Contextual Report Generator Maps statistically significant findings back to:

3.3 Implementation Stack


4. Research Objectives

The primary research questions this framework is designed to answer:


5. Significance and Novelty

This framework is, to the author's knowledge, the first proposed tool to combine:

General tools miss vulnerabilities because they don't know what to look for. KyberScope knows exactly what constant-time behavior looks like in Kyber — and knows exactly when it isn't there.

At a time when NIST PQC standards are entering production deployment, independent auditing infrastructure of this kind represents a meaningful contribution to the public cryptographic security posture of the United States and its allies.


6. Future Directions


References


This document represents an original research proposal for independent security research. All implementation and vulnerability disclosure will adhere to responsible disclosure standards.