Official NightAuth Rust SDK & Reference Client Suite (Modern Desktop UI in Win32 Pure GDI and Interactive Terminal CLI). Protect your high-performance native Rust software against reverse engineering, piracy, and tampering with zero-trust cloud licensing, HWID locking, realtime encrypted chat, and secure in-memory payload streaming in minutes.
Official Portal: https://nightauth.org
Documentation: https://nightauth.org/docs
Technical Architecture Benchmark: NightAuth vs KeyAuth vs Auth.gg
Languages / Idiomas / Langues / Sprachen:
English β’ EspaΓ±ol β’ FranΓ§ais β’ Deutsch β’ Italiano β’ PortuguΓͺs β’ Π ΡΡΡΠΊΠΈΠΉ β’ TΓΌrkΓ§e β’ Polski β’ δΈζ
Note
Official video tutorials and detailed step-by-step guides explaining how to configure applications, plans, subscriptions, cloud variables, webhooks, and licenses in the NightAuth Dashboard will be published soon on our official portal and YouTube channel.
| Start / Authentication Screen | Dashboard & Subscription Management |
|---|---|
![]() |
![]() |
| Terminal Login Screen | Interactive Console Dashboard |
|---|---|
![]() |
![]() |
- Binary Virtualization & Packing: Rust compiles directly to native assembly, but symbols, panic paths, and function boundaries can be analyzed in IDA Pro, Ghidra, or Binary Ninja. For production releases, protect compiled binaries using commercial protectors and code virtualizers such as VMProtect, Themida, or CodeVirtualizer.
- Compiler Hardening & Symbol Stripping: Configure
Cargo.tomlfor hardened production releases:[profile.release] opt-level = 3 lto = "fat" codegen-units = 1 panic = "abort" strip = true
- Compile-Time String Encryption: Never leave raw sensitive strings, API keys, or licensing messages in the
.rdatasection. Use compile-time XOR or ChaCha20 string obfuscation macros to decrypt strings only at the instant they are required. - In-Memory Secure File Execution: When streaming protected payloads or DLLs via
auth.download_file(file_id), never write decrypted bytes to physical storage or disk. Load and execute payloads directly from memory (e.g., reflective PE loading, manual mapping, or in-memory execution) and immediately wipe the buffer withstd::ptr::write_bytesor thezeroizecrate. - Hardware & Integrity Verification: Keep anti-debugging, memory integrity, and process monitoring active in production releases to mitigate runtime hooking, DLL injection, and debugger attachment.
Requires Rust 1.75+ with Cargo.
cargo run --manifest-path console/Cargo.tomlcargo run --manifest-path desktop/Cargo.tomlcargo build --release --manifest-path console/Cargo.toml
cargo build --release --manifest-path desktop/Cargo.tomlAdd the SDK dependency to your project's Cargo.toml:
[dependencies]
nightauth_sdk = { path = "path/to/NightAuth-Rust-SDK/source/sdk" }You must call init() prior to executing any other SDK functions. This establishes an ephemeral Diffie-Hellman (X25519) key exchange and creates an encrypted session:
use nightauth_sdk::Api;
fn main() {
// Define your application credentials from the Manage Apps tab of the NightAuth dashboard
let mut auth = Api::new_simple(
"Your App Name", // Application Name
"YOUR_API_KEY", // Application API Key
"1.0.0" // Application Version
);
// Perform cryptographic handshake
auth.init();
if !auth.response.success {
eprintln!("[ERROR] Initialization failed: {}", auth.response.message);
return;
}
println!("[SUCCESS] Initialized session: {}", auth.session_key().unwrap_or(""));
}Authenticate a user with username, password, and optional TOTP two-factor code:
let success = auth.login("developer_user", "SecurePassword123!", None);
if success {
println!("[SUCCESS] Logged in as: {}", auth.user_data.username);
println!("IP Address: {}", auth.user_data.ip);
println!("HWID Locked: {}", auth.user_data.hwid);
for sub in &auth.user_data.subscriptions {
println!("Active Subscription: {} (Expires: {})", sub.subscription, sub.expiry);
}
} else {
eprintln!("[ERROR] Login failed: {}", auth.response.message);
}Register a new account using a license key and email:
let registered = auth.register(
"new_user",
"SecurePassword123!",
"NIGHT-XXXX-XXXX-XXXX", // License Key
"developer@example.com"
);
if registered {
println!("[SUCCESS] Account registered and license redeemed!");
} else {
eprintln!("[ERROR] Registration failed: {}", auth.response.message);
}For software products that do not require user accounts, authenticate directly with a license key:
let valid = auth.license("NIGHT-XXXX-XXXX-XXXX");
if valid {
println!("[SUCCESS] Valid license! Welcome, {}", auth.user_data.username);
} else {
eprintln!("[ERROR] Invalid or expired license: {}", auth.response.message);
}Extend or upgrade an existing account's tier with a new license key:
let upgraded = auth.upgrade("developer_user", "NIGHT-UPGRADE-KEY");
if upgraded {
println!("[SUCCESS] Plan successfully upgraded!");
}Prevent session expiration and verify that the user's license has not been revoked or paused in the dashboard:
// Verify active session integrity
if auth.check() {
// Send periodic keep-alive heartbeat
auth.heartbeat();
} else {
eprintln!("[CRITICAL] Session invalidated or license suspended remotely!");
}Reset the machine binding for a user account:
let reset = auth.reset_hwid("developer_user", "SecurePassword123!", None);
if reset {
println!("[SUCCESS] HWID reset successful. Machine lock updated.");
}Download proprietary assets, encrypted bytecode, or native DLLs directly into memory without writing to disk:
match auth.download_file("file_id_or_hash") {
Ok(mut payload_bytes) => {
println!("[SUCCESS] Downloaded {} bytes securely in-memory.", payload_bytes.len());
// Execute or process payload in RAM (e.g. reflective loader)
// ...
// Wipe the buffer from memory immediately after execution
unsafe {
std::ptr::write_bytes(payload_bytes.as_mut_ptr(), 0, payload_bytes.len());
}
}
Err(err) => eprintln!("[ERROR] Failed to download payload: {}", err),
}Retrieve server-controlled configuration variables and user-specific data:
// Fetch global application variable
if let Some(var_value) = auth.get_var("min_client_version") {
println!("Global Variable: {}", var_value);
}
// Set user-specific cloud variable
auth.set_var("user_config", "{\"theme\": \"dark\", \"sound\": true}");Send and receive encrypted messages across application channels:
// Send message
auth.send_chat_message("general", "Hello from Rust!");
// Fetch messages
if let Ok(messages) = auth.fetch_chat_messages("general") {
for msg in messages {
println!("[{}] {}: {}", msg.timestamp, msg.author, msg.message);
}
}Configure and activate hardware/software 2FA (Google Authenticator, Authy):
// Step 1: Initiate 2FA setup
if let Some(setup_data) = auth.two_factor_setup() {
println!("2FA Secret Key: {}", setup_data.secret);
println!("Scan QR Code: {}", setup_data.qr_code_url);
// Step 2: Activate with code from authenticator app
let verified = auth.two_factor_activate("123456");
if verified {
println!("[SUCCESS] 2FA is now active on your account!");
}
}Submit operational and security events to the NightAuth Admin Audit Feed:
auth.log("User opened critical trading terminal module.");| Feature | NightAuth | KeyAuth | Auth.gg |
|---|---|---|---|
| Cryptography | End-to-End Curve25519 (X25519) + ChaCha20-Poly1305 | Static AES-CBC (Vulnerable to MITM & Proxy Interception) | Legacy HTTPS / Plain JSON |
| Hardware ID (HWID) | Multi-Component Cryptographic Hash (Anti-Spoofing) | Raw WMI Strings (Easily Spoofed) | Simple Registry / MAC |
| Edge Network Latency | < 35ms Global Anycast Edge | Single-Origin VPS (Frequent Outages) | Unmaintained / High Latency |
| Reseller System & Bots | Built-in Multi-Tier Balances + Discord & Telegram Bots | Manual API / Third-Party Scripts | Incomplete / Deprecated |
| In-Memory Streaming | Zero-Disk Decryption & Buffer Wiping | Disk Writes Required | Not Supported |
| Internationalization | 10 Languages Supported Out of the Box | English Only | English Only |
Read the full architectural benchmark: NightAuth vs KeyAuth vs Auth.gg
This project is licensed under the Elastic License 2.0.
- You may not provide the software to third parties as a hosted or managed service.
- You may not move, change, disable, or circumvent the license key functionality.
- You may not alter, remove, or obscure any licensing or copyright notices.
See the LICENSE file for the full legal text.



