Documentation

GloxAuth provides a high-performance, secure authentication system for your software. Our API handles everything from HWID locking to global variable management.

Quick Start

To start using GloxAuth, create an application in your dashboard and get your Application ID and Secret Key.

// Initialize GloxClient
var client = new GloxClient("YOUR_APP_ID", "YOUR_SECRET");
client.Initialize();

C# Integration

Implementing the GloxAuth C# SDK is highly secure and robust. Add the following code snippet inside a file named GloxAuth.cs in your project.

πŸ“‚ GloxAuth.cs
// ╔══════════════════════════════════════════════════════════════╗
// β•‘           GloxAuth SDK  β€”  C# Integration                    β•‘
// β•‘  NuGet: Install-Package Newtonsoft.Json                      β•‘
// β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
using System;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Win32;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

public static class GloxAuth
{
    private const string APP_NAME   = "YOUR_APP_NAME";       
    private const string APP_SECRET = "YOUR_APP_SECRET";    
    private const string API_URL = "https://wdwlvfbvatpacucozmhc.supabase.co/functions/v1/v1-auth";

    public static string GetHWID()
    {
        string hwid = "UNKNOWN";
        try {
            using (var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Cryptography")) {
                if (key != null) hwid = key.GetValue("MachineGuid")?.ToString() ?? "UNKNOWN";
            }
        } catch { }

        if (hwid == "UNKNOWN") hwid = Environment.MachineName + Environment.UserName;
        hwid = hwid.Replace("-", "").ToUpper();

        using (SHA256 sha = SHA256.Create()) {
            byte[] hash = sha.ComputeHash(Encoding.UTF8.GetBytes(hwid));
            return BitConverter.ToString(hash).Replace("-", "").ToUpper();
        }
    }

    public static async Task<bool> Login(string licenseKey)
    {
        try
        {
            string hwid = GetHWID();
            Console.WriteLine("[GloxAuth] Üretilen Bilgisayar Kimliği (HWID): " + hwid);
            
            string requestId = Guid.NewGuid().ToString("N").Substring(0, 16);
            string timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString();

            var payload = new { type = "license", key = licenseKey, hwid = hwid, timestamp = timestamp };
            string payloadJson = JsonConvert.SerializeObject(payload);
            
            string encryptedPayload = Encrypt(payloadJson, APP_SECRET);
            string hmacSignature = SignHMAC(encryptedPayload, requestId, APP_SECRET);

            var requestBody = new {
                app_name = APP_NAME,
                payload = encryptedPayload,
                hmac = hmacSignature,
                request_id = requestId
            };

            using (var http = new HttpClient() { Timeout = TimeSpan.FromSeconds(10) })
            {
                var content = new StringContent(JsonConvert.SerializeObject(requestBody), Encoding.UTF8, "application/json");
                var response = await http.PostAsync(API_URL, content);
                string raw = await response.Content.ReadAsStringAsync();
                
                var json = JObject.Parse(raw);
                if (json["error"] != null) {
                    Console.WriteLine("[GloxAuth] Server Rejection: " + json["error"].ToString());
                    return false;
                }

                string serverHmac = SignHMAC(json["data"].ToString(), requestId, APP_SECRET);
                if (serverHmac != json["hmac"].ToString().ToLower()) {
                    Console.WriteLine("[GloxAuth] Server Spoofing Detected!");
                    return false;
                }

                string decryptedText = Decrypt(json["data"].ToString(), APP_SECRET);
                var responseData = JObject.Parse(decryptedText);

                bool success = responseData["success"]?.Value<bool>() ?? false;
                if (!success) {
                    Console.WriteLine("[GloxAuth] License Error: " + responseData["status"]?.ToString());
                }
                return success;
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("[GloxAuth] Connection Error: " + ex.Message);
            return false;
        }
    }

    private static string Encrypt(string text, string secret)
    {
        byte[] key = SHA256.Create().ComputeHash(Encoding.UTF8.GetBytes(secret));
        byte[] iv = new byte[16];
        using (var rng = new RNGCryptoServiceProvider()) rng.GetBytes(iv);
        using (Aes aes = Aes.Create())
        {
            aes.Key = key; aes.IV = iv; aes.Mode = CipherMode.CBC;
            using (var ms = new MemoryStream())
            {
                ms.Write(iv, 0, iv.Length);
                using (var cs = new CryptoStream(ms, aes.CreateEncryptor(), CryptoStreamMode.Write))
                {
                    byte[] bytes = Encoding.UTF8.GetBytes(text);
                    cs.Write(bytes, 0, bytes.Length);
                }
                return Convert.ToBase64String(ms.ToArray());
            }
        }
    }

    private static string Decrypt(string encrypted64, string secret)
    {
        byte[] data = Convert.FromBase64String(encrypted64);
        byte[] iv = data.Take(16).ToArray();
        byte[] ct = data.Skip(16).ToArray();
        byte[] key = SHA256.Create().ComputeHash(Encoding.UTF8.GetBytes(secret));
        using (Aes aes = Aes.Create())
        {
            aes.Key = key; aes.IV = iv; aes.Mode = CipherMode.CBC;
            using (var dec = aes.CreateDecryptor())
            {
                byte[] res = dec.TransformFinalBlock(ct, 0, ct.Length);
                return Encoding.UTF8.GetString(res);
            }
        }
    }

    private static string SignHMAC(string data, string requestId, string secret)
    {
        using (var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret)))
        {
            byte[] hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(data + requestId));
            return BitConverter.ToString(hash).Replace("-", "").ToLower();
        }
    }
}

C++ Integration

High-performance native integration using LibCURL and OpenSSL. Add the following files to your project.

πŸ“‚ GloxAuth.hpp
#ifndef GLOXAUTH_HPP
#define GLOXAUTH_HPP

#include <iostream>
#include <string>
#include <vector>
#include <openssl/aes.h>
#include <openssl/hmac.h>
#include <openssl/sha.h>
#include <curl/curl.h>

class GloxAuth {
private:
    const std::string APP_NAME = "YOUR_APP_NAME";
    const std::string APP_SECRET = "YOUR_APP_SECRET";
    const std::string API_URL = "https://wdwlvfbvatpacucozmhc.supabase.co/functions/v1/v1-auth";

    std::string SignHMAC(const std::string& data, const std::string& reqId);
    std::string Encrypt(const std::string& plainText);
    std::string Decrypt(const std::string& encrypted64);
    std::string GetHWID();
public:
    bool Login(std::string licenseKey);
};

#endif
πŸ“‚ GloxAuth.cpp
#include "GloxAuth.hpp"
#include <sstream>
#include <iomanip>

using json = nlohmann::json;

static size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp) {
    ((std::string*)userp)->append((char*)contents, size * nmemb);
    return size * nmemb;
}

std::string GloxAuth::SignHMAC(const std::string& data, const std::string& reqId) {
    std::string raw = data + reqId;
    unsigned char result[EVP_MAX_MD_SIZE];
    unsigned int len;
    HMAC(EVP_sha256(), APP_SECRET.c_str(), (int)APP_SECRET.length(),
         (unsigned char*)raw.c_str(), raw.length(), result, &len);
    std::ostringstream ss;
    for (unsigned int i = 0; i < len; i++)
        ss << std::hex << std::setw(2) << std::setfill('0') << (int)result[i];
    return ss.str();
}

std::string GloxAuth::Encrypt(const std::string& plainText) {
    unsigned char key[32], iv[16];
    SHA256((unsigned char*)APP_SECRET.c_str(), APP_SECRET.size(), key);
    RAND_bytes(iv, 16);

    AES_KEY aesKey;
    AES_set_encrypt_key(key, 256, &aesKey);

    int padLen = 16 - (plainText.size() % 16);
    std::string padded = plainText + std::string(padLen, (char)padLen);

    std::vector<unsigned char> encrypted(padded.size());
    unsigned char ivCopy[16];
    memcpy(ivCopy, iv, 16);
    AES_cbc_encrypt((unsigned char*)padded.c_str(), encrypted.data(), padded.size(), &aesKey, ivCopy, AES_ENCRYPT);

    std::vector<unsigned char> out(iv, iv + 16);
    out.insert(out.end(), encrypted.begin(), encrypted.end());

    BIO* bio = BIO_new(BIO_s_mem());
    BIO* b64 = BIO_new(BIO_f_base64());
    bio = BIO_push(b64, bio);
    BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);
    BIO_write(bio, out.data(), (int)out.size());
    BIO_flush(bio);
    BUF_MEM* bptr;
    BIO_get_mem_ptr(bio, &bptr);
    std::string result(bptr->data, bptr->length);
    BIO_free_all(bio);
    return result;
}

std::string GloxAuth::Decrypt(const std::string& encrypted64) {
    BIO* bio = BIO_new_mem_buf(encrypted64.data(), encrypted64.size());
    BIO* b64 = BIO_new(BIO_f_base64());
    bio = BIO_push(b64, bio);
    BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);
    std::vector<unsigned char> out(encrypted64.size());
    int decodedLength = BIO_read(bio, out.data(), encrypted64.size());
    BIO_free_all(bio);
    out.resize(decodedLength);
    
    if(out.size() < 16) return "";
    unsigned char iv[16];
    memcpy(iv, out.data(), 16);
    std::vector<unsigned char> ciphertext(out.begin() + 16, out.end());
    
    unsigned char key[32];
    SHA256((unsigned char*)APP_SECRET.c_str(), APP_SECRET.size(), key);
    
    AES_KEY aesKey;
    AES_set_decrypt_key(key, 256, &aesKey);
    
    std::vector<unsigned char> decrypted(ciphertext.size());
    AES_cbc_encrypt(ciphertext.data(), decrypted.data(), ciphertext.size(), &aesKey, iv, AES_DECRYPT);
    
    int padLen = decrypted.back();
    if(padLen > 0 && padLen <= 16) decrypted.resize(decrypted.size() - padLen);
    
    return std::string(decrypted.begin(), decrypted.end());
}

bool GloxAuth::Login(const std::string& licenseKey, const std::string& hwid) {
    std::string reqId = "req" + std::to_string(time(nullptr));
    json payload = { {"type", "license"}, {"key", licenseKey}, {"hwid", hwid}, {"timestamp", std::to_string(time(nullptr))} };
    std::string enc = Encrypt(payload.dump());
    std::string sig = SignHMAC(enc, reqId);

    json requestBody = { {"app_name", APP_NAME}, {"payload", enc}, {"hmac", sig}, {"request_id", reqId} };

    std::string responseStr;
    CURL* curl = curl_easy_init();
    if (!curl) return false;

    std::string postData = requestBody.dump();
    struct curl_slist* headers = nullptr;
    headers = curl_slist_append(headers, "Content-Type: application/json");

    curl_easy_setopt(curl, CURLOPT_URL, API_URL.c_str());
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postData.c_str());
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &responseStr);
    curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10L);
    curl_easy_perform(curl);
    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);

    try {
        json res = json::parse(responseStr);
        if (res.contains("error")) {
            std::cout << "[GloxAuth] Server Rejection: " << res["error"] << std::endl;
            return false;
        }
        std::string serverHmac = SignHMAC(res["data"].get<std::string>(), reqId);
        if (serverHmac != res["hmac"].get<std::string>()) {
            std::cout << "[GloxAuth] Server Spoofing Detected!" << std::endl;
            return false;
        }
        
        std::string decryptedStr = Decrypt(res["data"].get<std::string>());
        json decrypted = json::parse(decryptedStr);
        if (!decrypted.contains("success") || !decrypted["success"].get<bool>()) {
            std::cout << "[GloxAuth] License Error: " << (decrypted.contains("status") ? decrypted["status"].get<std::string>() : "Unknown Error") << std::endl;
            return false;
        }
        
        std::cout << "[GloxAuth] Login Successful! Status: " << decrypted["status"] << " | Level: " << decrypted["level"] << std::endl;
        return true;
    } catch (...) { return false; }
}

Python Integration

Lightweight integration using Requests and Cryptography libraries. Install the pre-requisites first: pip install cryptography requests

πŸ“‚ gloxauth.py
import os
import json
import uuid
import time
import hmac
import hashlib
import requests
import base64
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import padding

class GloxAuth:
    def __init__(self):
        self.app_name = "YOUR_APP_NAME"
        self.app_secret = "YOUR_APP_SECRET"
        self.api_url = "https://wdwlvfbvatpacucozmhc.supabase.co/functions/v1/v1-auth"

    def encrypt(self, plain_text):
        key = hashlib.sha256(self.app_secret.encode()).digest()
        iv = os.urandom(16)
        padder = padding.PKCS7(128).padder()
        padded_data = padder.update(plain_text.encode()) + padder.finalize()
        cipher = Cipher(algorithms.AES(key), modes.CBC(iv), backend=default_backend())
        encryptor = cipher.encryptor()
        cipher_text = encryptor.update(padded_data) + encryptor.finalize()
        return base64.b64encode(iv + cipher_text).decode('utf-8')

    def decrypt(self, encrypted_data):
        data = base64.b64decode(encrypted_data)
        iv = data[:16]
        ct = data[16:]
        key = hashlib.sha256(self.app_secret.encode()).digest()
        cipher = Cipher(algorithms.AES(key), modes.CBC(iv), backend=default_backend())
        decryptor = cipher.decryptor()
        padded_data = decryptor.update(ct) + decryptor.finalize()
        unpadder = padding.PKCS7(128).unpadder()
        return (unpadder.update(padded_data) + unpadder.finalize()).decode('utf-8')

    def sign_hmac(self, data, req_id):
        raw = (data + req_id).encode('utf-8')
        return hmac.new(self.app_secret.encode('utf-8'), raw, hashlib.sha256).hexdigest()

    def login(self, license_key, hwid):
        req_id = uuid.uuid4().hex[:16]
        payload = json.dumps({"type": "license", "key": license_key, "hwid": hwid, "timestamp": str(int(time.time()))})
        
        enc_payload = self.encrypt(payload)
        signature = self.sign_hmac(enc_payload, req_id)

        try:
            req_data = {
                "app_name": self.app_name,
                "payload": enc_payload,
                "hmac": signature,
                "request_id": req_id
            }
            res = requests.post(self.api_url, json=req_data, timeout=10)
            res_json = res.json()
            
            if "error" in res_json:
                print(f"[GloxAuth] Server Rejection: {res_json['error']}")
                return False
                
            server_hmac = self.sign_hmac(res_json["data"], req_id)
            if server_hmac != res_json["hmac"].lower():
                print("[GloxAuth] Server Spoofing Detected!")
                return False
                
            dec_text = self.decrypt(res_json["data"])
            dec_data = json.loads(dec_text)
            
            if not dec_data.get("success"):
                print(f"[GloxAuth] License Error: {dec_data.get('status')}")
                return False
                
            print(f"[GloxAuth] Login Successful! Status: {dec_data.get('status')} | Level: {dec_data.get('level')}")
            return True
        except Exception as e:
            print(f"[GloxAuth] Connection Error: {str(e)}")
            return False

Hızlı Başlangıç

GloxAuth'ı kullanmaya başlamak için panelinizden bir uygulama oluşturun ve Uygulama ID'niz ile Gizli Anahtarınızı alın.

// GloxClient'ı başlat
var client = new GloxClient("UYGULAMA_ID", "GIZLI_ANAHTAR");
client.Initialize();

C# Entegrasyonu

GloxAuth C# SDK'yı sisteminize dahil etmek oldukça güvenli ve dayanıklıdır. Aşağıdaki kodu projenizde GloxAuth.cs adında bir dosya oluşturup yapıştırın.

πŸ“‚ GloxAuth.cs
// ╔══════════════════════════════════════════════════════════════╗
// β•‘           GloxAuth SDK  β€”  C# Entegrasyonu                   β•‘
// β•‘  NuGet: Install-Package Newtonsoft.Json                      β•‘
// β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
//
//  β–Ί AdΔ±m 1: Aşağıdaki alanlara kendi bilgilerinizi girin.
//  β–Ί AdΔ±m 2: Bu dosyayΔ± (GloxAuth.cs) projenize ekleyin.
//  β–Ί AdΔ±m 3: Login() fonksiyonunu Γ§ağırΔ±n β€” hepsi bu kadar!

using System;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

public static class GloxAuth
{
    // ════════════════════════════════════════
    //   β–Όβ–Όβ–Ό  BURAYA KENDΔ° BΔ°LGΔ°LERΔ°NΔ°ZΔ° GΔ°RΔ°N  β–Όβ–Όβ–Ό
    // ════════════════════════════════════════
    private const string APP_NAME   = "UYGULAMA_ADINIZ_BURAYA";       
    private const string APP_SECRET = "GIZLI_APP_SECRET_BURAYA";    
    // ════════════════════════════════════════

    private const string API_URL = "https://wdwlvfbvatpacucozmhc.supabase.co/functions/v1/v1-auth";

    public static async Task<bool> Login(string licenseKey, string hwid)
    {
        try
        {
            string requestId = Guid.NewGuid().ToString("N").Substring(0, 16);
            string timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString();

            var payload = new { type = "license", key = licenseKey, hwid = hwid, timestamp = timestamp };
            string payloadJson = JsonConvert.SerializeObject(payload);
            
            string encryptedPayload = Encrypt(payloadJson, APP_SECRET);
            string hmacSignature = SignHMAC(encryptedPayload, requestId, APP_SECRET);

            var requestBody = new {
                app_name = APP_NAME,
                payload = encryptedPayload,
                hmac = hmacSignature,
                request_id = requestId
            };

            using (var http = new HttpClient() { Timeout = TimeSpan.FromSeconds(10) })
            {
                var content = new StringContent(JsonConvert.SerializeObject(requestBody), Encoding.UTF8, "application/json");
                var response = await http.PostAsync(API_URL, content);
                string raw = await response.Content.ReadAsStringAsync();
                
                var json = JObject.Parse(raw);
                if (json["error"] != null) {
                    Console.WriteLine("[GloxAuth] Sunucu Reddi: " + json["error"].ToString());
                    return false;
                }

                if (json["data"] == null || json["hmac"] == null) return false;

                // ─── GΓΌvenlik DoğrulamasΔ± (Sunucu Sahtekarlığı KorumasΔ±) ───
                string serverHmac = SignHMAC(json["data"].ToString(), requestId, APP_SECRET);
                if (serverHmac != json["hmac"].ToString().ToLower()) {
                    Console.WriteLine("[GloxAuth] Sunucu Sahtekarlığı Tespit Edildi!");
                    return false;
                }

                // ─── Veri Çâzme ───
                string decryptedText = Decrypt(json["data"].ToString(), APP_SECRET);
                var responseData = JObject.Parse(decryptedText);

                bool success = responseData["success"]?.Value<bool>() ?? false;
                if (!success) {
                    Console.WriteLine("[GloxAuth] Lisans HatasΔ±: " + responseData["message"]?.ToString());
                }
                return success;
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("[GloxAuth] Bağlantı Hatası: " + ex.Message);
            return false;
        }
    }

    private static string Encrypt(string text, string secret)
    {
        byte[] key = SHA256.Create().ComputeHash(Encoding.UTF8.GetBytes(secret));
        byte[] iv = new byte[16];
        using (var rng = new RNGCryptoServiceProvider()) rng.GetBytes(iv);

        using (Aes aes = Aes.Create())
        {
            aes.Key = key; aes.IV = iv; aes.Mode = CipherMode.CBC;
            using (var ms = new MemoryStream())
            {
                ms.Write(iv, 0, iv.Length);
                using (var cs = new CryptoStream(ms, aes.CreateEncryptor(), CryptoStreamMode.Write))
                {
                    byte[] bytes = Encoding.UTF8.GetBytes(text);
                    cs.Write(bytes, 0, bytes.Length);
                }
                return Convert.ToBase64String(ms.ToArray());
            }
        }
    }

    private static string Decrypt(string encrypted64, string secret)
    {
        byte[] data = Convert.FromBase64String(encrypted64);
        byte[] iv = data.Take(16).ToArray();
        byte[] ciphertext = data.Skip(16).ToArray();

        byte[] key = SHA256.Create().ComputeHash(Encoding.UTF8.GetBytes(secret));
        using (Aes aes = Aes.Create())
        {
            aes.Key = key; aes.IV = iv; aes.Mode = CipherMode.CBC;
            using (var dec = aes.CreateDecryptor())
            {
                byte[] decrypted = dec.TransformFinalBlock(ciphertext, 0, ciphertext.Length);
                return Encoding.UTF8.GetString(decrypted);
            }
        }
    }

    private static string SignHMAC(string data, string requestId, string secret)
    {
        using (var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret)))
        {
            byte[] hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(data + requestId));
            return BitConverter.ToString(hash).Replace("-", "").ToLower();
        }
    }
}

// ═══════════════════════════════════════════════════════════════
//  KULLANIM Γ–RNEĞİ  (Program.cs veya Form1.cs)
// ═══════════════════════════════════════════════════════════════
//  string licenseKey = "LΔ°SANS_ANAHTARINIZ_BURAYA"; 
//  string hwid       = Environment.MachineName; 
//
//  bool ok = await GloxAuth.Login(licenseKey, hwid);
//  if (ok) {
//      Console.WriteLine("Giriş başarılı! Menü açılıyor...");
//  } else {
//      Console.WriteLine("GeΓ§ersiz lisans.");
//  }
// ═══════════════════════════════════════════════════════════════

C++ Entegrasyonu

LibCURL ve OpenSSL kullanarak yΓΌksek performanslΔ± yerel entegrasyon. Tam kodlarΔ± panelinizden kopyalayabilirsiniz.

Python Entegrasyonu

Requests ve Cryptography kΓΌtΓΌphaneleri ile hΔ±zlΔ± entegrasyon. Panelinizdeki dΓΆkΓΌman kΔ±smΔ±nda mevcuttur.