astraguard
Official AstraGuard SDK for Rust - license validation, HWID binding, anti-debug, and offline grace-period cache.
Features
- License key validation and activation via the AstraGuard API
- Hardware ID (HWID) derivation and binding
- AES-256-GCM encrypted offline cache with a configurable grace period
- HMAC-SHA256 response authentication (fail-closed)
- Background heartbeat for continuous license verification
- Anti-debug detection (Windows):
IsDebuggerPresent,NtQueryInformationProcess, Frida pipe/DLL check, timing check - Anti-VM detection (Windows, x86_64): CPUID vendor string, VM driver files, process names, MAC OUI check
- XOR-obfuscated sensitive string constants (prevents trivial
stringsextraction) - Automatic update checks via
/check-update
Installation
[]
= "1"
= { = "1", = ["full"] }
Quick Start
use AstraGuardClient;
async
Response Authentication
Protect against MITM response spoofing by enabling HMAC verification:
let client = new?
.with_response_auth;
When set, responses without a valid x-astraguard-hmac header are rejected (fail-closed).
Security Checks
let mut client = new?;
client.set_auto_enforce_security; // enables anti-debug + anti-VM on every verify_license call
Or start the background anti-debug monitor explicitly:
start_background_monitor;
// thread runs forever, calls process::exit(1) silently if a debugger is detected
Heartbeat
client.start_heartbeat;
Update Check
let update = client.check_for_updates.await?;
if update.has_update
Platform Support
| Feature | Windows | Linux | macOS |
|---|---|---|---|
| License validation | ✅ | ✅ | ✅ |
| Offline cache | ✅ | ✅ | ✅ |
HWID via MachineGuid |
✅ | - | - |
| HWID fallback (hostname+user) | ✅ | ✅ | ✅ |
| Anti-debug (IsDebuggerPresent, NtQuery, Frida) | ✅ | - | - |
| Anti-VM (CPUID, processes, files, MAC) | ✅ (x86_64) | - | - |
License
MIT - see LICENSE.
Links
- Docs: https://docs.astraguard.io
- Dashboard: https://www.astraguard.io/dashboard
- Discord (live help): https://discord.gg/Zkcyy5GnQd
- Email: support@astraguard.io