Skip to main content

Official Python client for the Ethoryx prime-generation API (RSA, FHE, zk-SNARK, and NTT primes).

Project description

ethoryx

Official Python client for the Ethoryx prime-generation API — structurally-guided primes for RSA, FHE, zk-SNARKs, and NTT, backed by the Ethoryx C/GMP core. Fewer Miller–Rabin tests, fewer candidates, same cryptographic strength.

Install

pip install ethoryx

Quick start

import ethoryx

client = ethoryx.Client(api_key="tg_your_key")   # or set ETHORYX_API_KEY

# Generate primes
prime = client.generate(bits=2048)
rsa   = client.generate_rsa(bits=2048)
pair  = client.generate_rsa_pair(bits=2048)      # matched (p, q)
ntt   = client.generate_ntt(bits=256)
fhe   = client.generate_fhe(bits=2048)           # Starter tier or above

# Public endpoints — no API key required
ethoryx.verify(999983)                           # {"is_prime": true, ...}
ethoryx.optimize_next(last_prime=999983, last_gap=6)  # -> predicted_next, confidence
ethoryx.status()                                 # version, benchmarks

Get a free key (100 calls/month) at https://ethoryx.io/register.

Authentication

Pass your key to the client, or set it once in the environment:

export ETHORYX_API_KEY="tg_your_key"
client = ethoryx.Client()                 # picks up ETHORYX_API_KEY

The public endpoints (verify, optimize_next, predict_gap, status) work without a key. Everything under generate* and account* requires one.

API

Method Endpoint Auth
client.generate(bits=, method=) GET /v1/generate 🔑
client.generate_rsa(bits=) GET /v1/generate/rsa 🔑
client.generate_rsa_pair(bits=) GET /v1/generate/rsa-pair 🔑
client.generate_ntt(bits=) GET /v1/generate/ntt 🔑
client.generate_fhe(bits=) GET /v1/generate/fhe 🔑 Starter+
client.generate_ecc(bits=) GET /v1/generate/ecc 🔑
client.verify(n) GET /v1/verify public
client.optimize_next(last_prime=, last_gap=) GET /v1/optimize/next public
client.predict_gap(...) GET /v1/predict/gap public
client.account() GET /v1/account 🔑
client.usage_history() GET /v1/usage/history 🔑
client.status() GET /v1/status public

Every method returns the parsed JSON response as a dict.

Errors

from ethoryx import EthoryxError, AuthError, RateLimitError, APIError

try:
    client.generate(bits=2048)
except AuthError:
    ...        # missing/invalid key, or tier too low (401/403)
except RateLimitError:
    ...        # 429 — back off and retry
except APIError as e:
    print(e.status, e.response)
except EthoryxError:
    ...        # network/other

License

MIT © Ethoryx Research

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ethoryx-0.1.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ethoryx-0.1.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file ethoryx-0.1.1.tar.gz.

File metadata

  • Download URL: ethoryx-0.1.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for ethoryx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1e93ab3a49b9396e25000588f5201c29adc3935dbb47c5031572bc7d38b8c3b6
MD5 04bf40de88d326400dc0ebf2a7223682
BLAKE2b-256 57eeafcc81dd8ec35b9c4493b64971c1609268955584dfcedb6bf5d6ad9e4819

See more details on using hashes here.

File details

Details for the file ethoryx-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ethoryx-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for ethoryx-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d8fec5bbf490e366a51f0133208dfa045cc7d2fa7d7e067a72dcf358f0c5f1ec
MD5 f87934238c4dca82b7b15fb8b3b43b6b
BLAKE2b-256 b596283cfb95b0fb2e9ae6d3e1b22f61d2fc7afda8a53a3cac2df3d303562655

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page