Agent skill · security · yaklang

rsa-attack-techniques

RSA attack playbook for CTF and real-world cryptanalysis. Use when given RSA parameters (n, e, c) and need to recover plaintext by exploiting weak keys, small exponents, shared factors, or padding oracles.

Why this skill is useful

Adds executable scripts and detailed attack methodologies for various RSA vulnerabilities that are not commonly known or documented.

What it needs

Requires gmpy2, sympy installed locally. About 8k tokens when loaded. Last updated 2026-06-16. 1,563 stars on the source repository.

What this skill does

SKILL: RSA Attack Techniques — Expert Cryptanalysis Playbook AI LOAD INSTRUCTION: Expert RSA attack techniques for CTF and authorized security assessments. Covers factorization attacks, small exponent exploits, lattice-based approaches (Wiener/Boneh-Durfee/Coppersmith), broadcast attacks, common modulus, padding oracles, and fault attacks. Base models often suggest attacks that don't match the given parameters or miss the correct attack selection based on what's known. 0. RELATED ROUTING lattice-crypto-attacks for deep lattice theory behind Coppersmith/Boneh-Durfee hash-attack-techniques when RSA signature forgery involves hash weaknesses symmetric-cipher-attacks when RSA protects a symmetric key (hybrid encryption) Advanced Reference Also load RSAATTACKCATALOG.md when you need: Detailed SageMath/Python implementation for each attack Step-by-step mathematical derivation Edge cases and failure conditions per attack Quick attack selection Given / Observable Attack Tool --- --- --- Small n (< 512 bits) Direct factorization factordb, yafu, msieve e = 3, small message Cube root gmpy2.iroot Multiple (n, c) same small e Hastad broadcast CRT + iroot Very large e or very small d Wiener / Boneh-Durfee SageMath, RsaCtfTool Partial p knowledge Coppersmith small roots SageMath Same n, different e Common modulus Extended GCD Multiple n values Batch GCD (shared factor) Python/SageMath Padding error oracle Bleichenbacher Custom script LSB parity oracle LSB oracle attack Custom script Fault in CRT computation RSA-CRT fault Single faulty signature --- 1. FACTORIZATION ATTACKS 1.1 Direct Factorization (Small n) When: n < ~512 bits, or known to be in factordb. 1.2 Fermat's Factorization Works when p and q are close together: p - q is small. 1.3 Pollard's p-1 Works when p-1 has only small prime factors (B-smooth). 1.4 Batch GCD (Multiple n share a factor) --- 2. …

How to use it

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

@skills yaklang/rsa-attack-techniques

View the source on GitHub

Browse the @skills marketplace