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(prime=999983, gap=6) # next-prime prediction
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(prime=, 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ethoryx-0.1.0.tar.gz.
File metadata
- Download URL: ethoryx-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9a1c27723858c818703e5ca16a62f7d8e84d4c258772a4d3f19f5fff29916b4
|
|
| MD5 |
1c0f870b6e67f86339f69f31cf2aedcf
|
|
| BLAKE2b-256 |
7c4d9f5c1a46c0674334cc32d238f8333a7d3b6340d1cd5617220cc15faa3da0
|
File details
Details for the file ethoryx-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ethoryx-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a2e45f37bb1a9e48abb8d3394b42f8dd092fb8d9143e28bf2b2c2aa3e1d1f93
|
|
| MD5 |
4e1b329c32a75e622aa20e2c640e25ec
|
|
| BLAKE2b-256 |
07f750aaba25367bcf41ebe97c8fd5b087c0068adae042e39f5c92220e3d0619
|