number-theory-and-cryptography

number-theory-and-cryptography is a skill for Claude Code, Codex from hamzabellouch/agent-skills. It costs 77 tokens per session (704 once invoked), scanned A, original, MIT.

A guide to number theory and basic cryptography, the study of integers, primes, divisibility, and arithmetic with remainders. It includes the mathematical ideas behind RSA and elliptic-curve cryptography.

In plain words
What is it for?
Use it for greatest common divisors, congruences, prime tests, Diophantine equations, the Chinese remainder theorem, RSA, and elliptic-curve basics.
Why use it?
It helps solve integer and modular-arithmetic problems and explains why common public-key encryption methods work.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for greatest common divisors, congruences, prime tests, Diophantine equations, the Chinese remainder theorem, RSA, and elliptic-curve basics.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hamzabellouch/agent-skills/number-theory-and-cryptography
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add hamzabellouch/agent-skills --skill number-theory-and-cryptography
Clone the repo
git clone --depth 1 https://github.com/hamzabellouch/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for number-theory-and-cryptography

README.md
[![agentmods](https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/number-theory-and-cryptography/github.svg)](https://agentmods.dev/skills/hamzabellouch/agent-skills/number-theory-and-cryptography)
Your own site
<a href="https://agentmods.dev/skills/hamzabellouch/agent-skills/number-theory-and-cryptography"><img src="https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/number-theory-and-cryptography/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for number-theory-and-cryptography

Your own site · 80×15
<a href="https://agentmods.dev/skills/hamzabellouch/agent-skills/number-theory-and-cryptography"><img src="https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/number-theory-and-cryptography.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 704 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00077 $0.00704
Opus 5.5 $0.00031 $0.00282
Sonnet 5.5 $0.00015 $0.00141
Haiku 4.5 $0.00008 $0.00070

Measured today against content hash 549702544a72, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

number-theory-and-cryptography scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/number_theory.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Math/Math_Master_Library/number-theory-and-cryptography/SKILL.md · 29 lines

How it starts

The opening of the file, as written. The whole thing — 29 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Number Theory & Cryptography

Basics

  • Fundamental theorem of arithmetic; gcd via Euclid; Bezout ax + by = gcd (extended Euclid); lcm = ab/gcd.
  • Modular arithmetic: a == b (mod n); inverse of a mod n exists iff gcd(a,n) = 1; solve ax == b via inverse.
  • Chinese Remainder Theorem for pairwise coprime moduli.
  • Fermat: a^(p-1) == 1 (mod p) for p prime, p not dividing a. Euler: a^phi(n) == 1 for gcd(a,n) = 1; phi(n) = n prod (1 - 1/p). Wilson: (p-1)! == -1 (mod p).
  • Multiplicative functions: tau, sigma, mu, phi; Moebius inversion; Dirichlet convolution.
  • Order of an element, primitive roots (exist mod 1, 2, 4, p^k, 2p^k).
  • Quadratic residues: Legendre symbol, Euler's criterion, quadratic reciprocity, Jacobi symbol; sums of two squares (p == 1 mod 4), Lagrange four squares.
  • Diophantine: linear ax + by = c solvable iff gcd | c; Pythagorean triples (m^2 - n^2, 2mn, m^2 + n^2); Pell x^2 - Dy^2 = 1 via continued fractions; Fermat's Last Theorem (Wiles); infinite descent; lifting-the-exponent lemma; Zsigmondy.
  • Valuations: v_p(n!) = sum floor(n/p^k) (Legendre).

Primes

  • Sieve of Eratosthenes; primality tests: Miller-Rabin (probabilistic), AKS (deterministic polynomial); prime number theorem pi(x) ~ x/ln x; Dirichlet's theorem on primes in progressions; twin prime, Goldbach, Riemann hypothesis as open problems.

Cryptography

  • RSA: n = pq, e coprime to phi(n), d = e^{-1} mod phi(n); encrypt c = m^e mod n, decrypt m = c^d mod n. Security rests on factoring hardness; use OAEP padding and 2048+ bit keys in practice.
  • Diffie-Hellman key exchange, discrete log problem; ElGamal; elliptic curves y^2 = x^3 + ax + b over F_p (group law), ECDH/ECDSA; post-quantum lattice-based (Kyber, Dilithium) as Shor-resistant alternatives; hash functions and signatures.
  • Never implement your own crypto in production; use vetted libraries.

Script

scripts/number_theory.py: egcd, modular inverse, CRT, Miller-Rabin, factorization (Pollard rho), phi, primitive root, RSA toy demo.

Read the full file on GitHub · 29 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 29 lines · 77 tokens per session scan A 549702544a72

Subscribe to this mod's changes

number-theory-and-cryptography is a skill published in the GitHub repository hamzabellouch/agent-skills (8 stars, last pushed today), licensed MIT. It adds 77 tokens to every session and 704 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-17.

Related

Other skills, from other repositories

polya-docs

Phase 6 of the Pólya Heuristic Coder: Technical Documentation via Diátaxis Framework (Tutorials, How-To Guides, Reference, Explanation).

GulajavaMinistudio/awesome-copilot-id · 37 tokens

agricultural-sciences-professor

Use when a task needs the judgment of a tenure-track or tenured Agricultural Sciences faculty member at a land-grant university — deciding whether to submit a grant this cycle versus wait, allocating time across the teaching/research/extension appointment split, diagnosing a stalled graduate student or field trial, or…

wonsukchoi/domain-experts · 75 tokens

adapted-physical-education-specialist

Use when a task needs the judgment of an Adapted Physical Education Specialist — writing a legally-defensible PE present level and annual goal from motor/fitness assessment data, choosing the right test battery and alternate items for a student's mobility profile, recommending a placement step on the PE…

wonsukchoi/domain-experts · 84 tokens

area-ethnic-cultural-studies-professor

Use when a task needs the judgment of an Area, Ethnic, or Cultural Studies Professor — designing a joint-appointment course load across two departments, prepping a tenure or mid-tenure review file for interdisciplinary scholarship, deciding whether a course survives an enrollment or political-pressure threat…

wonsukchoi/domain-experts · 89 tokens

art-drama-music-professor-postsecondary

Use when a task needs the judgment of a Postsecondary Art, Drama, or Music Professor — diagnosing a jury/crit score that contradicts a semester of formative work, building a studio-art or performance tenure dossier around exhibitions and productions instead of publications, staffing applied one-on-one lessons or crit…

wonsukchoi/domain-experts · 94 tokens

career-technical-education-teacher-postsecondary

Use when a task needs the judgment of a Career/Technical Education Teacher, Postsecondary — defending a shrinking trade or health-science program against a cutback decision, backward-mapping a shop or lab curriculum to an industry credential's exam blueprint, resolving a competency-based grading dispute where a…

wonsukchoi/domain-experts · 91 tokens