Agent skill · research science · yaklang

lattice-crypto-attacks

Lattice-based cryptanalysis playbook. Use when attacking RSA via Coppersmith small roots, recovering DSA/ECDSA nonces from bias, solving knapsack problems, or applying LLL/BKZ reduction to cryptographic constructions.

Why this skill is useful

Adds detailed executable scripts for lattice-based cryptanalysis techniques that are not widely known or documented.

What it needs

Requires fpylll, sage installed locally. About 9k tokens when loaded. Last updated 2026-06-16. 1,563 stars on the source repository.

What this skill does

SKILL: Lattice-Based Cryptanalysis — Expert Attack Playbook AI LOAD INSTRUCTION: Expert lattice techniques for CTF and cryptanalysis. Covers LLL/BKZ reduction, Coppersmith's method (univariate and multivariate), Hidden Number Problem for DSA/ECDSA nonce recovery, knapsack attacks, and NTRU analysis. Base models often fail to construct the correct attack lattice (wrong dimensions, missing scaling factors) or misapply Coppersmith bounds. 0. RELATED ROUTING rsa-attack-techniques for RSA-specific attacks that use lattice methods (Coppersmith, Boneh-Durfee) symmetric-cipher-attacks for LCG state recovery via lattice classical-cipher-analysis when lattice methods apply to classical cipher analysis Quick application guide Problem Type Lattice Technique Key Parameter --- --- --- RSA small roots Coppersmith (LLL on polynomial lattice) Root bound X < N^(1/e) RSA small d Boneh-Durfee (multivariate Coppersmith) d < N^0.292 DSA/ECDSA nonce bias Hidden Number Problem → CVP Bias bits known Knapsack cipher Low-density lattice attack Density < 0.9408 LCG truncated output CVP on recurrence lattice Unknown bits per output Subset sum LLL reduction on knapsack lattice Element size vs count NTRU key recovery Lattice reduction on NTRU lattice Dimension and key size --- 1. LATTICE FUNDAMENTALS 1.1 Definitions A lattice L is the set of all integer linear combinations of basis vectors: where b₁, ..., bₙ are linearly independent vectors in ℝᵐ. Key problems: SVP (Shortest Vector Problem): Find the shortest non-zero vector in L CVP (Closest Vector Problem): Given target t, find v ∈ L closest to t SVP is NP-hard in general, but LLL finds an approximately short vector in polynomial time 1.2 Lattice Quality Metrics --- 2. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills yaklang/lattice-crypto-attacks

View the source on GitHub

Browse the @skills marketplace