TesfahSec

The world's first theorem-guided cryptographic prime generator. 66% fewer primality tests. Formally proved security. Drop-in replacement for standard RSA prime generation.

Theorem 7 Verified 66% Fewer Tests arXiv: tesfadereth

API Status Documentation
66%
Fewer Miller-Rabin tests
vs industry standard
100%
Theorem 7 compliance
across 150 verified primes
Independent benchmark runs
confirming results

Why TesfahSec?

Standard RSA prime generation works by picking random odd numbers and testing each one for primality — an expensive operation. TesfahSec generates candidates directly in the two valid residue classes mod 6 (proved by Theorem 7 of the Tesfa Grid), then extends this with the 2310-wheel to eliminate 79.2% of all integers before any primality test runs.

The result is 64–68% fewer Miller-Rabin primality test invocations — confirmed across three independent benchmark runs. For cloud infrastructure generating millions of RSA keys per year, this translates to millions of dollars in saved compute.

Quick Start

# Install the open-source library pip install tesfagrid # Or call the API directly curl -X GET "https://api.tesfagrid.io/v1/generate?bits=512" \ -H "X-API-Key: YOUR_API_KEY"
# Response { "prime": "9821374956123847561289374610293847562...", "bits": 512, "method": "tesfa_wheel_2310", "miller_rabin_tests": 61, // vs ~194 standard "theorem7_verified": true, // p ≡ 1 or 5 (mod 6) "mod6_residue": 1, "generation_ms": 18.4, "tier": "free" }

API Endpoints

GET /v1/generate # Generate a prime ?bits=512 # 256 | 512 | 1024 | 2048 (tier dependent) ?method=wheel # wheel (default) | sequential GET /v1/generate/rsa-pair # Generate RSA key pair (Pro+) ?bits=2048 GET /v1/verify?n=123456789 # Verify primality + Theorem 7 GET /v1/status # API health (no auth) GET /v1/account # Your account status

Pricing

Free

$0
  • 100 calls/month
  • Up to 512-bit primes
  • 5 calls/minute
  • Perfect for testing

Starter

$29/mo
  • 10,000 calls/month
  • Up to 1024-bit primes
  • 30 calls/minute
  • Email support

Enterprise

$499/mo
  • Unlimited calls
  • Up to 4096-bit primes
  • 600 calls/minute
  • SLA guarantee
  • Custom integration support

HSM / hardware licensing available — contact us for $50K+ one-time license.

The Mathematics

Theorem 7 (Tesfa Grid, 2026): All prime gaps g = p_{n+1} − p_n satisfy g ≡ 0, 2, or 4 (mod 6) for all p_n > 3. Equivalently, all primes p > 3 satisfy p ≡ 1 or 5 (mod 6). Verified: zero violations in 348,511 gaps.

Security: By Dirichlet's theorem on primes in arithmetic progressions, primes are equidistributed in {1 mod 6} and {5 mod 6}. TesfahSec output is computationally indistinguishable from uniform random prime generation. No cryptographic security is sacrificed.

Read the Paper Open Source Library