constant-time-testing by trailofbits/skills
npx skills add https://github.com/trailofbits/skills --skill constant-time-testing时序攻击利用执行时间的差异从密码学实现中提取秘密信息。与针对理论弱点的密码分析不同,时序攻击利用了实现缺陷——并且它们可以影响任何密码学代码。
时序攻击由 Kocher 于 1996 年提出。此后,研究人员已证明了对 RSA (Schindler)、OpenSSL (Brumley and Boneh)、AES 实现甚至像 Kyber 这样的后量子算法的实际攻击。
| 概念 | 描述 |
|---|---|
| 恒定时间 | 代码路径和内存访问独立于秘密数据 |
| 时序泄漏 | 与秘密相关的可观察执行时间差异 |
| 侧信道 | 从实现而非算法中提取的信息 |
| 微架构 | CPU 级别的时序差异(缓存、除法、移位) |
时序漏洞可以:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
两个先决条件使得利用成为可能:
四种模式导致了大多数时序漏洞:
// 1. 条件跳转 - 最严重的时序差异
if(secret == 1) { ... }
while(secret > 0) { ... }
// 2. 数组访问 - 缓存时序攻击
lookup_table[secret];
// 3. 整数除法(处理器相关)
data = secret / m;
// 4. 移位操作(处理器相关)
data = a << secret;
条件跳转 导致不同的代码路径,从而产生巨大的时序差异。
依赖于秘密的数组访问使得缓存时序攻击成为可能,如 AES 缓存时序研究 所示。
整数除法和移位操作 在某些 CPU 架构和编译器配置下会泄漏秘密。
当无法避免这些模式时,采用 掩码技术 来消除时序与秘密之间的相关性。
模幂运算(用于 RSA 和 Diffie-Hellman)容易受到时序攻击。RSA 解密计算:
$$ct^{d} \mod{N}$$
其中 $d$ 是秘密指数。平方乘幂 优化将乘法次数减少到 $\log{d}$:
$$ \begin{align*} & \textbf{输入: } \text{底数 }y,\text{指数 } d={d_n,\cdots,d_0}_2,\text{模数 } N \ & r = 1 \ & \textbf{for } i=|n| \text{ downto } 0: \ & \quad\textbf{if } d_i == 1: \ & \quad\quad r = r * y \mod{N} \ & \quad y = y * y \mod{N} \ & \textbf{return }r \end{align*} $$
代码根据指数位 $d_i$ 进行分支,违反了恒定时间原则。当 $d_i = 1$ 时,会进行一次额外的乘法运算,增加执行时间并泄漏位信息。
蒙哥马利乘法(常用于模运算)也会泄漏时序:当中间值超过模数 $N$ 时,需要额外的约简步骤。攻击者构造输入 $y$ 和 $y'$,使得:
$$ \begin{align*} y^2 < y^3 < N \ y'^2 < N \leq y'^3 \end{align*} $$
对于 $y$,两次乘法都耗时 $t_1+t_1$。对于 $y'$,第二次乘法需要约简,耗时 $t_1+t_2$。这种时序差异揭示了 $d_i$ 是 0 还是 1。
在以下情况应用恒定时间分析:
在以下情况考虑替代方案:
| 场景 | 推荐方法 | 技能 |
|---|---|---|
| 证明无泄漏 | 形式化验证 | SideTrail, ct-verif, FaCT |
| 检测统计时序差异 | 统计测试 | dudect |
| 在运行时跟踪秘密数据流 | 动态分析 | timecop |
| 查找缓存时序漏洞 | 符号执行 | Binsec, pitchfork |
密码学界开发了四类时序分析工具:
| 类别 | 方法 | 优点 | 缺点 |
|---|---|---|---|
| 形式化 | 对模型进行数学证明 | 保证无泄漏 | 复杂性,建模假设 |
| 符号化 | 符号执行路径 | 具体反例 | 耗时的路径探索 |
| 动态 | 使用标记秘密的运行时跟踪 | 细粒度,灵活 | 覆盖范围限于执行路径 |
| 统计 | 测量实际执行时间 | 实用,设置简单 | 无根本原因,对噪声敏感 |
形式化验证在代码的抽象(模型)上数学证明时序属性。工具从源代码/二进制文件创建模型,并验证其满足指定属性(例如,变量被注释为秘密)。
流行工具:
优点: 无泄漏证明,语言无关(LLVM 字节码) 缺点: 需要专业知识,建模假设可能遗漏实际问题
符号执行分析路径和内存访问如何依赖于符号变量(秘密)。提供具体反例。专注于缓存时序攻击。
流行工具:
优点: 具体反例有助于调试 缺点: 路径爆炸导致执行时间长
动态分析标记敏感内存区域并跟踪执行以检测依赖于时序的操作。
流行工具:
优点: 细粒度控制,针对性分析 缺点: 覆盖范围限于执行路径
详细指南: 有关设置和使用,请参阅 timecop 技能。
使用各种输入执行代码,测量耗时,并检测不一致性。测试包括编译器优化和架构在内的实际实现。
流行工具:
优点: 设置简单,实用的现实世界结果 缺点: 无根本原因信息,噪声掩盖弱信号
详细指南: 有关设置和使用,请参阅 dudect 技能。
Phase 1: Static Analysis Phase 2: Statistical Testing
┌─────────────────┐ ┌─────────────────┐
│ Identify secret │ → │ Detect timing │
│ data flow │ │ differences │
│ Tool: ct-verif │ │ Tool: dudect │
└─────────────────┘ └─────────────────┘
↓ ↓
Phase 4: Root Cause Phase 3: Dynamic Tracing
┌─────────────────┐ ┌─────────────────┐
│ Pinpoint leak │ ← │ Track secret │
│ location │ │ propagation │
│ Tool: Timecop │ │ Tool: Timecop │
└─────────────────┘ └─────────────────┘
推荐方法:
Dudect 测量两个输入类别(固定与随机)的执行时间,并使用 Welch t 检验来检测统计上显著的差异。
详细指南: 有关完整设置、使用模式和 CI 集成,请参阅 dudect 技能。
#define DUDECT_IMPLEMENTATION
#include "dudect.h"
uint8_t do_one_computation(uint8_t *data) {
// Code to measure goes here
}
void prepare_inputs(dudect_config_t *c, uint8_t *input_data, uint8_t *classes) {
for (size_t i = 0; i < c->number_measurements; i++) {
classes[i] = randombit();
uint8_t *input = input_data + (size_t)i * c->chunk_size;
if (classes[i] == 0) {
// Fixed input class
} else {
// Random input class
}
}
}
主要优势:
主要限制:
Timecop 包装 Valgrind 以检测依赖于秘密内存区域的运行时操作。
详细指南: 有关安装、示例和调试,请参阅 timecop 技能。
#include "valgrind/memcheck.h"
#define poison(addr, len) VALGRIND_MAKE_MEM_UNDEFINED(addr, len)
#define unpoison(addr, len) VALGRIND_MAKE_MEM_DEFINED(addr, len)
int main() {
unsigned long long secret_key = 0x12345678;
// Mark secret as poisoned
poison(&secret_key, sizeof(secret_key));
// Any branching or memory access dependent on secret_key
// will be reported by Valgrind
crypto_operation(secret_key);
unpoison(&secret_key, sizeof(secret_key));
}
使用 Valgrind 运行:
valgrind --leak-check=full --track-origins=yes ./binary
主要优势:
主要限制:
识别处理秘密的密码学代码:
快速统计检查:
timeout 600 ./ct_test工具: dudect 预计时间: 1-2 小时(测试套件编写 + 初始运行)
如果 dudect 检测到泄漏:
根本原因调查:
poison() 标记秘密变量工具: Timecop, 编译器输出 (objdump -d)
修复时序泄漏:
重新验证:
集成到 CI 中:
有关 CI 集成示例,请参阅 dudect 技能。
| 漏洞 | 描述 | 检测 | 严重性 |
|---|---|---|---|
| 依赖于秘密的分支 | if (secret_bit) { ... } | dudect, Timecop | 严重 |
| 依赖于秘密的数组访问 | table[secret_index] | Timecop, Binsec | 高 |
| 可变时间除法 | result = x / secret | Timecop | 中 |
| 可变时间移位 | result = x << secret | Timecop | 中 |
| 蒙哥马利约简泄漏 | 中间值 > N 时的额外约简 | dudect | 高 |
漏洞: 执行时间根据是否执行分支而不同。常见于优化的模幂运算(平方乘幂)。
如何使用 dudect 检测:
uint8_t do_one_computation(uint8_t *data) {
uint64_t base = ((uint64_t*)data)[0];
uint64_t exponent = ((uint64_t*)data)[1]; // Secret!
return mod_exp(base, exponent, MODULUS);
}
void prepare_inputs(dudect_config_t *c, uint8_t *input_data, uint8_t *classes) {
for (size_t i = 0; i < c->number_measurements; i++) {
classes[i] = randombit();
uint64_t *input = (uint64_t*)(input_data + i * c->chunk_size);
input[0] = rand(); // Random base
input[1] = (classes[i] == 0) ? FIXED_EXPONENT : rand(); // Fixed vs random
}
}
如何使用 Timecop 检测:
poison(&exponent, sizeof(exponent));
result = mod_exp(base, exponent, modulus);
unpoison(&exponent, sizeof(exponent));
Valgrind 将报告:
Conditional jump or move depends on uninitialised value(s)
at 0x40115D: mod_exp (example.c:14)
相关技能: dudect , timecop
Brumley 和 Boneh (2005) 通过网络从 OpenSSL 中提取了 RSA 私钥。该漏洞利用了蒙哥马利乘法的可变时间约简步骤。
攻击向量: 模幂运算中的时序差异 检测方法: 统计分析(dudect 的前身) 影响: 远程密钥提取
使用的工具: 自定义时序测量 应用的技术: 统计分析、选择密文查询
后量子算法 Kyber 的参考实现包含多项式操作中的时序漏洞。除法操作泄漏了秘密系数。
攻击向量: 依赖于秘密的除法时序 检测方法: 动态分析和统计测试 影响: 后量子密码学中的秘密密钥恢复
使用的工具: 时序测量工具 应用的技术: 差分时序分析
| 技巧 | 为何有帮助 |
|---|---|
将 dudect 固定到隔离的 CPU 核心 (taskset -c 2) | 减少操作系统噪声,提高信号检测 |
| 测试多个编译器(gcc, clang, MSVC) | 优化可能引入或消除泄漏 |
| 长时间运行 dudect(数小时) | 增加统计置信度 |
| 最小化测试套件中的非密码学代码 | 减少掩盖弱信号的噪声 |
检查汇编输出 (objdump -d) | 验证编译器未引入分支 |
在测试中使用 -O3 -march=native | 匹配生产优化级别 |
| 错误 | 为何错误 | 正确方法 |
|---|---|---|
| 仅测试一种输入分布 | 可能遗漏其他模式可见的泄漏 | 测试固定 vs 随机、固定 vs 不同固定等 |
| dudect 运行时间短(< 1 分钟) | 测量不足,无法检测弱信号 | 运行 5-10+ 分钟,高保证性需要更长时间 |
| 忽略编译器优化级别 | -O0 可能隐藏 -O3 中存在的泄漏 | 在生产优化级别测试 |
| 未在目标架构上测试 | x86 与 ARM 具有不同的时序特性 | 在部署平台上测试 |
| 在 Timecop 中标记过多内容为秘密 | 误报,结果不清晰 | 仅标记真正的秘密(密钥,而非公共数据) |
| 技能 | 在恒定时间分析中的主要用途 |
|---|---|
| dudect | 通过 Welch t 检验统计检测时序差异 |
| timecop | 动态跟踪以精确定位时序泄漏位置 |
| 技能 | 何时应用 |
|---|---|
| coverage-analysis | 确保测试输入覆盖密码函数的所有代码路径 |
| ci-integration | 在持续集成流水线中自动化恒定时间测试 |
| 技能 | 关系 |
|---|---|
| crypto-testing | 恒定时间分析是密码学测试的重要组成部分 |
| fuzzing | 模糊测试密码学代码可能触发依赖于时序的路径 |
┌─────────────────────────┐
│ constant-time-analysis │
│ (this skill) │
└───────────┬─────────────┘
│
┌───────────────┴───────────────┐
│ │
▼ ▼
┌───────────────────┐ ┌───────────────────┐
│ dudect │ │ timecop │
│ (statistical) │ │ (dynamic) │
└────────┬──────────┘ └────────┬──────────┘
│ │
└───────────────┬───────────────┘
│
▼
┌──────────────────────────────┐
│ Supporting Techniques │
│ coverage, CI integration │
└──────────────────────────────┘
这些结果必定是假的:恒定时间分析工具的可用性评估 对恒定时间分析工具的全面可用性研究。主要发现:开发人员难以处理误报,需要更好的错误消息,并受益于工具集成。评估了 FaCT、ct-verif、dudect 和 Memsan 在多个密码学实现上的表现。建议改进工具用户体验和更好的文档。
恒定时间工具列表 - CROCS 带有教程的恒定时间分析工具精选目录。涵盖形式化工具(ct-verif, FaCT)、动态工具(Memsan, Timecop)、符号化工具(Binsec)和统计工具(dudect)。包含设置和使用的实用教程。
Paul Kocher: 对 Diffie-Hellman、RSA、DSS 和其他系统实现的时序攻击 介绍时序攻击的原始 1996 年论文。演示了对 RSA 和 Diffie-Hellman 中模幂运算的攻击。理解时序漏洞的重要历史背景。
远程时序攻击是实用的 (Brumley& Boneh) 演示了对 OpenSSL 的实际远程时序攻击。表明网络级时序差异足以提取 RSA 密钥。证明时序攻击在现实网络条件下有效。
对 AES 的缓存时序攻击 表明使用查找表的 AES 实现容易受到缓存时序攻击。演示了通过缓存时序侧信道提取 AES 密钥的实际攻击。
KyberSlash: 除法时序泄漏秘密 最近在 Kyber(NIST 后量子标准)中发现的时序漏洞。表明除法操作泄漏秘密系数。强调即使在现代后量子密码学中,恒定时间问题仍然存在。
每周安装次数
1.1K
代码仓库
GitHub 星标数
3.9K
首次出现
Jan 19, 2026
安全审计
安装于
claude-code951
opencode911
gemini-cli893
codex888
cursor866
github-copilot834
Timing attacks exploit variations in execution time to extract secret information from cryptographic implementations. Unlike cryptanalysis that targets theoretical weaknesses, timing attacks leverage implementation flaws - and they can affect any cryptographic code.
Timing attacks were introduced by Kocher in 1996. Since then, researchers have demonstrated practical attacks on RSA (Schindler), OpenSSL (Brumley and Boneh), AES implementations, and even post-quantum algorithms like Kyber.
| Concept | Description |
|---|---|
| Constant-time | Code path and memory accesses independent of secret data |
| Timing leakage | Observable execution time differences correlated with secrets |
| Side channel | Information extracted from implementation rather than algorithm |
| Microarchitecture | CPU-level timing differences (cache, division, shifts) |
Timing vulnerabilities can:
Two prerequisites enable exploitation:
Four patterns account for most timing vulnerabilities:
// 1. Conditional jumps - most severe timing differences
if(secret == 1) { ... }
while(secret > 0) { ... }
// 2. Array access - cache-timing attacks
lookup_table[secret];
// 3. Integer division (processor dependent)
data = secret / m;
// 4. Shift operation (processor dependent)
data = a << secret;
Conditional jumps cause different code paths, leading to vast timing differences.
Array access dependent on secrets enables cache-timing attacks, as shown in AES cache-timing research.
Integer division and shift operations leak secrets on certain CPU architectures and compiler configurations.
When patterns cannot be avoided, employ masking techniques to remove correlation between timing and secrets.
Modular exponentiation (used in RSA and Diffie-Hellman) is susceptible to timing attacks. RSA decryption computes:
$$ct^{d} \mod{N}$$
where $d$ is the secret exponent. The exponentiation by squaring optimization reduces multiplications to $\log{d}$:
$$ \begin{align*} & \textbf{Input: } \text{base }y,\text{exponent } d={d_n,\cdots,d_0}_2,\text{modulus } N \ & r = 1 \ & \textbf{for } i=|n| \text{ downto } 0: \ & \quad\textbf{if } d_i == 1: \ & \quad\quad r = r * y \mod{N} \ & \quad y = y * y \mod{N} \ & \textbf{return }r \end{align*} $$
The code branches on exponent bit $d_i$, violating constant-time principles. When $d_i = 1$, an additional multiplication occurs, increasing execution time and leaking bit information.
Montgomery multiplication (commonly used for modular arithmetic) also leaks timing: when intermediate values exceed modulus $N$, an additional reduction step is required. An attacker constructs inputs $y$ and $y'$ such that:
$$ \begin{align*} y^2 < y^3 < N \ y'^2 < N \leq y'^3 \end{align*} $$
For $y$, both multiplications take time $t_1+t_1$. For $y'$, the second multiplication requires reduction, taking time $t_1+t_2$. This timing difference reveals whether $d_i$ is 0 or 1.
Apply constant-time analysis when:
Consider alternatives when:
| Scenario | Recommended Approach | Skill |
|---|---|---|
| Prove absence of leaks | Formal verification | SideTrail, ct-verif, FaCT |
| Detect statistical timing differences | Statistical testing | dudect |
| Track secret data flow at runtime | Dynamic analysis | timecop |
| Find cache-timing vulnerabilities | Symbolic execution | Binsec, pitchfork |
The cryptographic community has developed four categories of timing analysis tools:
| Category | Approach | Pros | Cons |
|---|---|---|---|
| Formal | Mathematical proof on model | Guarantees absence of leaks | Complexity, modeling assumptions |
| Symbolic | Symbolic execution paths | Concrete counterexamples | Time-intensive path exploration |
| Dynamic | Runtime tracing with marked secrets | Granular, flexible | Limited coverage to executed paths |
| Statistical | Measure real execution timing | Practical, simple setup | No root cause, noise sensitivity |
Formal verification mathematically proves timing properties on an abstraction (model) of code. Tools create a model from source/binary and verify it satisfies specified properties (e.g., variables annotated as secret).
Popular tools:
Strengths: Proof of absence, language-agnostic (LLVM bytecode) Weaknesses: Requires expertise, modeling assumptions may miss real-world issues
Symbolic execution analyzes how paths and memory accesses depend on symbolic variables (secrets). Provides concrete counterexamples. Focus on cache-timing attacks.
Popular tools:
Strengths: Concrete counterexamples aid debugging Weaknesses: Path explosion leads to long execution times
Dynamic analysis marks sensitive memory regions and traces execution to detect timing-dependent operations.
Popular tools:
Strengths: Granular control, targeted analysis Weaknesses: Coverage limited to executed paths
Detailed Guidance: See the timecop skill for setup and usage.
Execute code with various inputs, measure elapsed time, and detect inconsistencies. Tests actual implementation including compiler optimizations and architecture.
Popular tools:
Strengths: Simple setup, practical real-world results Weaknesses: No root cause info, noise obscures weak signals
Detailed Guidance: See the dudect skill for setup and usage.
Phase 1: Static Analysis Phase 2: Statistical Testing
┌─────────────────┐ ┌─────────────────┐
│ Identify secret │ → │ Detect timing │
│ data flow │ │ differences │
│ Tool: ct-verif │ │ Tool: dudect │
└─────────────────┘ └─────────────────┘
↓ ↓
Phase 4: Root Cause Phase 3: Dynamic Tracing
┌─────────────────┐ ┌─────────────────┐
│ Pinpoint leak │ ← │ Track secret │
│ location │ │ propagation │
│ Tool: Timecop │ │ Tool: Timecop │
└─────────────────┘ └─────────────────┘
Recommended approach:
Dudect measures execution time for two input classes (fixed vs random) and uses Welch's t-test to detect statistically significant differences.
Detailed Guidance: See the dudect skill for complete setup, usage patterns, and CI integration.
#define DUDECT_IMPLEMENTATION
#include "dudect.h"
uint8_t do_one_computation(uint8_t *data) {
// Code to measure goes here
}
void prepare_inputs(dudect_config_t *c, uint8_t *input_data, uint8_t *classes) {
for (size_t i = 0; i < c->number_measurements; i++) {
classes[i] = randombit();
uint8_t *input = input_data + (size_t)i * c->chunk_size;
if (classes[i] == 0) {
// Fixed input class
} else {
// Random input class
}
}
}
Key advantages:
Key limitations:
Timecop wraps Valgrind to detect runtime operations dependent on secret memory regions.
Detailed Guidance: See the timecop skill for installation, examples, and debugging.
#include "valgrind/memcheck.h"
#define poison(addr, len) VALGRIND_MAKE_MEM_UNDEFINED(addr, len)
#define unpoison(addr, len) VALGRIND_MAKE_MEM_DEFINED(addr, len)
int main() {
unsigned long long secret_key = 0x12345678;
// Mark secret as poisoned
poison(&secret_key, sizeof(secret_key));
// Any branching or memory access dependent on secret_key
// will be reported by Valgrind
crypto_operation(secret_key);
unpoison(&secret_key, sizeof(secret_key));
}
Run with Valgrind:
valgrind --leak-check=full --track-origins=yes ./binary
Key advantages:
Key limitations:
Identify cryptographic code handling secrets:
Quick statistical check:
timeout 600 ./ct_testTools: dudect Expected time: 1-2 hours (harness writing + initial run)
If dudect detects leakage:
Root cause investigation:
poison()Tools: Timecop, compiler output (objdump -d)
Fix the timing leak:
Re-verify:
Integrate into CI:
See the dudect skill for CI integration examples.
| Vulnerability | Description | Detection | Severity |
|---|---|---|---|
| Secret-dependent branch | if (secret_bit) { ... } | dudect, Timecop | CRITICAL |
| Secret-dependent array access | table[secret_index] | Timecop, Binsec | HIGH |
| Variable-time division | result = x / secret | Timecop | MEDIUM |
| Variable-time shift | result = x << secret | Timecop | MEDIUM |
The vulnerability: Execution time differs based on whether branch is taken. Common in optimized modular exponentiation (square-and-multiply).
How to detect with dudect:
uint8_t do_one_computation(uint8_t *data) {
uint64_t base = ((uint64_t*)data)[0];
uint64_t exponent = ((uint64_t*)data)[1]; // Secret!
return mod_exp(base, exponent, MODULUS);
}
void prepare_inputs(dudect_config_t *c, uint8_t *input_data, uint8_t *classes) {
for (size_t i = 0; i < c->number_measurements; i++) {
classes[i] = randombit();
uint64_t *input = (uint64_t*)(input_data + i * c->chunk_size);
input[0] = rand(); // Random base
input[1] = (classes[i] == 0) ? FIXED_EXPONENT : rand(); // Fixed vs random
}
}
How to detect with Timecop:
poison(&exponent, sizeof(exponent));
result = mod_exp(base, exponent, modulus);
unpoison(&exponent, sizeof(exponent));
Valgrind will report:
Conditional jump or move depends on uninitialised value(s)
at 0x40115D: mod_exp (example.c:14)
Related skill: dudect , timecop
Brumley and Boneh (2005) extracted RSA private keys from OpenSSL over a network. The vulnerability exploited Montgomery multiplication's variable-time reduction step.
Attack vector: Timing differences in modular exponentiation Detection approach: Statistical analysis (precursor to dudect) Impact: Remote key extraction
Tools used: Custom timing measurement Techniques applied: Statistical analysis, chosen-ciphertext queries
Post-quantum algorithm Kyber's reference implementation contained timing vulnerabilities in polynomial operations. Division operations leaked secret coefficients.
Attack vector: Secret-dependent division timing Detection approach: Dynamic analysis and statistical testing Impact: Secret key recovery in post-quantum cryptography
Tools used: Timing measurement tools Techniques applied: Differential timing analysis
| Tip | Why It Helps |
|---|---|
Pin dudect to isolated CPU core (taskset -c 2) | Reduces OS noise, improves signal detection |
| Test multiple compilers (gcc, clang, MSVC) | Optimizations may introduce or remove leaks |
| Run dudect for extended periods (hours) | Increases statistical confidence |
| Minimize non-crypto code in harness | Reduces noise that masks weak signals |
Check assembly output (objdump -d) | Verify compiler didn't introduce branches |
Use -O3 -march=native in testing | Matches production optimization levels |
| Mistake | Why It's Wrong | Correct Approach |
|---|---|---|
| Only testing one input distribution | May miss leaks visible with other patterns | Test fixed-vs-random, fixed-vs-fixed-different, etc. |
| Short dudect runs (< 1 minute) | Insufficient measurements for weak signals | Run 5-10+ minutes, longer for high assurance |
| Ignoring compiler optimization levels | -O0 may hide leaks present in -O3 | Test at production optimization level |
| Not testing on target architecture | x86 vs ARM have different timing characteristics | Test on deployment platform |
| Marking too much as secret in Timecop | False positives, unclear results | Mark only true secrets (keys, not public data) |
| Skill | Primary Use in Constant-Time Analysis |
|---|---|
| dudect | Statistical detection of timing differences via Welch's t-test |
| timecop | Dynamic tracing to pinpoint exact location of timing leaks |
| Skill | When to Apply |
|---|---|
| coverage-analysis | Ensure test inputs exercise all code paths in crypto function |
| ci-integration | Automate constant-time testing in continuous integration pipeline |
| Skill | Relationship |
|---|---|
| crypto-testing | Constant-time analysis is essential component of cryptographic testing |
| fuzzing | Fuzzing crypto code may trigger timing-dependent paths |
┌─────────────────────────┐
│ constant-time-analysis │
│ (this skill) │
└───────────┬─────────────┘
│
┌───────────────┴───────────────┐
│ │
▼ ▼
┌───────────────────┐ ┌───────────────────┐
│ dudect │ │ timecop │
│ (statistical) │ │ (dynamic) │
└────────┬──────────┘ └────────┬──────────┘
│ │
└───────────────┬───────────────┘
│
▼
┌──────────────────────────────┐
│ Supporting Techniques │
│ coverage, CI integration │
└──────────────────────────────┘
These results must be false: A usability evaluation of constant-time analysis tools Comprehensive usability study of constant-time analysis tools. Key findings: developers struggle with false positives, need better error messages, and benefit from tool integration. Evaluates FaCT, ct-verif, dudect, and Memsan across multiple cryptographic implementations. Recommends improved tooling UX and better documentation.
List of constant-time tools - CROCS Curated catalog of constant-time analysis tools with tutorials. Covers formal tools (ct-verif, FaCT), dynamic tools (Memsan, Timecop), symbolic tools (Binsec), and statistical tools (dudect). Includes practical tutorials for setup and usage.
Paul Kocher: Timing Attacks on Implementations of Diffie-Hellman, RSA, DSS, and Other Systems Original 1996 paper introducing timing attacks. Demonstrates attacks on modular exponentiation in RSA and Diffie-Hellman. Essential historical context for understanding timing vulnerabilities.
Remote Timing Attacks are Practical (Brumley& Boneh) Demonstrates practical remote timing attacks against OpenSSL. Shows network-level timing differences are sufficient to extract RSA keys. Proves timing attacks work in realistic network conditions.
Cache-timing attacks on AES Shows AES implementations using lookup tables are vulnerable to cache-timing attacks. Demonstrates practical attacks extracting AES keys via cache timing side channels.
KyberSlash: Division Timings Leak Secrets Recent discovery of timing vulnerabilities in Kyber (NIST post-quantum standard). Shows division operations leak secret coefficients. Highlights that constant-time issues persist even in modern post-quantum cryptography.
Weekly Installs
1.1K
Repository
GitHub Stars
3.9K
First Seen
Jan 19, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code951
opencode911
gemini-cli893
codex888
cursor866
github-copilot834
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装
NestJS专家服务 | 企业级TypeScript后端开发与架构设计
1,000 周安装
安全代码卫士:AI驱动的安全编码指南与最佳实践,防止SQL注入、XSS攻击
1,000 周安装
ESLint迁移到Oxlint完整指南:JavaScript/TypeScript项目性能优化工具
1,000 周安装
Chrome CDP 命令行工具:轻量级浏览器自动化,支持截图、执行JS、无障碍快照
1,000 周安装
Sanity内容建模最佳实践:结构化内容设计原则与无头CMS指南
1,000 周安装
AI Sprint规划器 - 敏捷团队Scrum迭代计划工具,自动估算故事点与容量管理
1,000 周安装
| Montgomery reduction leak | Extra reduction when intermediate > N | dudect | HIGH |