Documentation

Protecting your app

Warden makes sure the answers your program gets really come from your server. How hard your program is to crack depends on what it can still do without those answers. This guide covers both.

What Warden protects

  • A fake or emulated auth server: every response is signed with your app's private key, which never leaves Warden.
  • Replayed or stale responses: each one echoes the request's random nonce and carries a timestamp the SDK checks.
  • Sharing a key: with HWID lock on, a key or account only works on the first machine that uses it.
  • Old builds: clients that send a different version are refused and told where to download the update.

What no client check can do

This is true of every licensing system that runs a check on the user's machine, Warden and KeyAuth alike. The program is on their computer, so they can change it.

  • Someone who controls the machine can patch your program to skip the login entirely, or to ignore Warden's answer.
  • The file hash is reported by the client itself, so a patched build can send the original hash. It stops casual edits, not a determined cracker.
  • Anything compiled into your program (strings, logic, assets) can be extracted, whether or not the user logs in.

So the goal isn't an unbreakable login. It's a program that has nothing worth stealing until the server hands it over, and a server that never hands it to someone without a valid, unexpired key on the right machine.

Keep what matters on the server

Ship a small loader. Keep the valuable parts in Warden and deliver them only after a successful login:

  • Variables (Variables page) for configuration, endpoints, offsets, feature flags or decryption keys. Turn on Require login, and the server refuses them to any session that hasn't logged in.
  • Files (Files page) for the real module or payload, downloaded straight into memory with file(). With Require login on, there's nothing to download without a key.
  • Webhooks (Webhooks page) to call your own APIs through Warden. The client only knows the webhook's name; the URL, and any API key in it, stays on the server.
  • User variables for per-user entitlements. Mark them read-only when you set them from the dashboard, so the client can read but not change them.
main.py
from warden_auth import Warden, WardenError

app = Warden(app_id="YOUR_APP_ID", public_key="YOUR_PUBLIC_KEY", version="1.0",
             api_url="https://your-warden-site.com/api/v1")
app.init()
app.license(input("License key: "))

# Only now does the program get the parts that make it worth running.
# Both have "Require login" on, so an unauthenticated session is refused.
config = app.var("config")            # e.g. JSON with endpoints, offsets, feature flags
payload = app.file("YOUR_FILE_ID")    # the real module, downloaded into memory, never shipped

run(payload, config)

If you run a backend of your own (a bot, a storefront, a game server), check licenses there with the Seller API rather than trusting a client that says it logged in:

terminal
# On your server (a Discord bot, a storefront, your API), never in the client:
curl -X POST https://your-warden-site.com/api/seller \
  -H "Authorization: Bearer $SELLER_KEY" \
  -d type=info -d key="$LICENSE_KEY"

Harden the client

None of these stop a determined cracker on their own, but together they raise the cost and catch the casual ones.

  • Check the session regularly. Call check() every few minutes and stop when it returns false, and set a short Session lifetime in Settings. Banning a user or deleting a key then takes effect quickly.
  • Keep HWID lock on (Settings, on by default) so one key can't be passed around. Use Reset HWID on a user when someone genuinely changes machine.
  • Set the version and a download URL (Settings). Old builds, including known cracked ones, are refused and pointed at the update.
  • Enforce the file hash (Settings) with the SHA-256 of your release build (sha256sum, or certutil -hashfile app.exe SHA256 on Windows). It catches casual edits; see the limits above.
  • Ban on tampering. The Warden loader does this for you, with strikes. In your own program, call ban() when you detect a debugger, a hook or a modified file: it bans the user and blacklists their HWID and IP.
  • Obfuscate or pack release builds, and don't keep license keys or downloaded payloads on disk in plain text.
  • Never put the seller key in client code. It can create and delete keys. The application ID and public key are safe to ship.

When something leaks

  • A key is being shared: ban it on the Licenses page (and its user, if you want).
  • A person or machine keeps coming back: add their HWID or IP on the Blacklist page.
  • A cracked build is circulating: bump the Version and ship an update, so the old build stops at init.
  • You need everything to stop right now: Pause application in Settings. Every init fails until you resume.
  • Your seller key leaked: use Rotate seller key in Settings straight away, and update your bots and servers.

Checklist

  • The valuable part of your program (payload, config, offsets, keys) is delivered after login, not shipped.
  • Variables, files and webhooks that matter have Require login turned on.
  • Your own backend checks licenses through the Seller API instead of trusting the client.
  • HWID lock is on (Settings) unless you deliberately allow roaming keys.
  • Version is set, with a download URL, so old builds are refused.
  • Session lifetime is as short as your app allows, and the client calls check() regularly.
  • The client calls ban() when it detects tampering or a debugger.
  • Your release build is obfuscated or packed; the seller key appears nowhere in it.