osec Signup Checks: Breached-password and throwaway-email API
One API call tells you if a password is in a known breach (k-anonymity, we never see it) and if an email is disposable, has no mail server or is a role address.
What it does
- Have I Been Pwned's 600M+ breached passwords
- 9,000+ disposable email domains
- MX record, role-address and free-provider flags
- NIST 800-63B: block known-breached passwords
- Free to try without an account: 20 checks a day
What goes in, what comes out
- What goes in
- An email address, or the SHA-1 of a password (the full 40 characters, or only the first 5 so the hash never leaves your server).
- What comes out
- For an email: disposable, mail server found, role address, free provider and a verdict of accept or reject. For a password: whether it is in a known breach.
- Example
- curl -X POST https://api.osec.one/tools/check/email -H "X-Osec-Secret: oss_..." -H "Content-Type: application/json" -d '{"email": "someone@mailinator.com"}' returns {"disposable": true, "mx": true, "role": false, "verdict": "reject"}
- Limits
- 20 checks a day on this page without an account. With a site key each call counts as 1 request. It does not say whether a mailbox exists, only whether the domain can receive mail.
How to set it up
- Create a site key; use its secret from your server.
- Before creating an account, check the email and the password's SHA-1.
- Reject verdict=reject emails and pwned passwords; ask for another.
bash
# email: disposable, MX, role address, free provider
curl -X POST https://api.osec.one/tools/check/email -H "X-Osec-Secret: oss_..." \
-H "Content-Type: application/json" -d '{"email": "someone@mailinator.com"}'
# {"disposable": true, "mx": true, "role": false, "verdict": "reject", ...}python: breached password (k-anonymity)
import hashlib, requests
sha1 = hashlib.sha1(password.encode()).hexdigest().upper()
r = requests.post("https://api.osec.one/tools/check/password", headers={"X-Osec-Secret": SECRET},
json={"sha1_prefix": sha1[:5]}).json()
pwned = any(s["suffix"] == sha1[5:] for s in r["suffixes"]) # only 5 chars left your serverGood to know
- Send sha1 (40 chars) for a simple yes/no, or sha1_prefix (5 chars) so the full hash never leaves your server.