More screenshots
Works with the AI Agents you already use
Constant-Time Analysis: Timing Side Channels
Audit crypto code for timing side channels: enumerate risky operations, trace whether a secret actually reaches each one, deliver a verdict per flag, and fix only what leaks.
$5
Constant-Time Analysis: Timing Side Channels
Example session with this skill installed
Run the audit on this excerpt from a session-token service and tell me what actually leaks: (1) if token == stored_token: return session in the Python auth handler, where stored_token is loaded from the session store; (2) slots = len(ciphertext) // 32 in the framing code; (3) a retry jitter using random.random(); (4) a table-driven hex encoder applied to the raw session token before logging a fingerprint of it.
- Read your context and instructions
- Compiled the constant-time analysis
Four flags raised in Pass 1; verdicts after Pass 2 tracing:
FLAG 1 — Early-exit comparison, auth handler. Trace: token == stored_token → both operands are session-token material → input origin: SECRET (bearer token). Verdict: TRUE POSITIVE. Python string equality stops at the first mismatching character, and this check is reachable over the network, so response timing can narrow the token byte by byte. Exposure: remote, attacker-controlled input — fix first. Fix: hmac.compare_digest(token, stored_token), then re-run Pass 1 on the handler to confirm no other comparison of token material remains.
FLAG 2 — Division, framing code. Trace: operand is len(ciphertext) → a length, determined by message size → input origin: PUBLIC. Verdict: FALSE POSITIVE. Reasoning recorded: the divisor is a compile-time constant and the dividend is a public length; nothing about key or plaintext content reaches this operation. No fix; do not re-audit unless the framing changes to derive the length from decrypted content.
FLAG 3 — Weak randomness, retry jitter. Trace: random.random() output → sleep duration only → never used as token, nonce, or key material. Verdict: FALSE POSITIVE, with the standard caveat recorded: if this call is ever reused to generate a token or backoff seed that becomes an identifier, the verdict flips. Fix: none required; a comment at the call site now states the permitted use.
FLAG 4 — Table-driven encoding of secret bytes. Trace: hex encoder indexes a lookup table by each byte of the raw session token → input origin: SECRET. Verdict: TRUE POSITIVE, local exposure (the fingerprint is computed server-side and logged; the measurable channel is weak, so it ranks below Flag 1). Fix: compute the fingerprint with a hash over the token and encode the digest instead, or use a branchless encoder; the log then never touches raw token bytes.
Net result: two real leaks, two cleared flags with reasoning a future auditor can check in minutes — which is the difference between an audit and a grep.
Connects securely to your tools. The creator never sees your data.
About this skill
Timing side channels hide in ordinary code: a division on a key coefficient, a string comparison that stops at the first mismatch, a table lookup indexed by a secret byte. This skill runs a four-pass audit that separates real leaks from noise. Pass 1 enumerates the six risky operation classes — division and modulo, branches on secrets, early-exit comparisons, secret-indexed lookups, table-driven encoding of secret bytes, and weak randomness used for nonces or keys. Pass 2 is the core of the method: every flag gets a written data-flow trace (flag → function → caller → input origin) that decides whether a secret can actually reach the operation. Pass 3 delivers a verdict per flag — true positive, false positive with explicit reasoning, or inconclusive for a second pair of eyes — and orders fixes by exposure, with remotely measurable leaks first. Pass 4 repairs with the constant-time primitive for your language (a full table covers C, Go, Rust, Java, C#, Python, Ruby, and JS/TS) and re-audits the fix so the leak is closed rather than moved. The skill includes compiler and platform discipline — constant-time is a property of the emitted code, so results are recorded per compiler, architecture, and optimization level — plus a finding report template, a triage table, an audit checklist, edge cases (constant divisors, secret-derived lengths, error paths), and reference incidents including KyberSlash and Lucky Thirteen.
- Static inspection cannot catch cache-timing or other microarchitectural channels; dynamic measurement is out of scope.
- Pass 2 data-flow tracing is manual judgment — operands that cannot be traced are reported inconclusive, not cleared.
- A clean result is a configuration claim: it covers the compiler, architecture, and optimization levels recorded, not untested ones.
- It audits for timing channels only, not for correctness of the underlying cryptography.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 24 days ago
Permissions
No special permissions declared or detected