A Unity anti-cheat and asset protection toolkit.
Encrypt builds. Guard sessions. Block exploiters.
Three scripts. Zero excuses.
Download the Atlas Auth package for one-click setup, or drop in the individual C# scripts. No extra dependencies beyond PlayFab.
Complete authentication system for Unity — import directly and get a fully integrated auth flow with PlayFab session management, no manual script setup required.
using UnityEngine; using PlayFab; using PlayFab.ClientModels; public class AtlasProtection : MonoBehaviour { [Header("ATLAS PROTECTION")] public bool quitInEditor = false; void Start() { Invoke(nameof(CheckPlayFabID), 0.5f); } void CheckPlayFabID() { if (!PlayFabClientAPI.IsClientLoggedIn()) { ForceClose("PlayFab client not logged in."); return; } if (string.IsNullOrEmpty(PlayFabSettings.staticPlayer.PlayFabId)) { ForceClose("Missing PlayFab ID."); return; } Debug.Log("[ATLAS] PlayFab ID verified."); } void ForceClose(string reason) { Debug.LogError("[ATLAS PROTECTION] " + reason); #if UNITY_EDITOR if (quitInEditor) UnityEditor.EditorApplication.isPlaying = false; #else Application.Quit(); #endif } }
using UnityEngine; using System.IO; using System.Security.Cryptography; public static class AtlasAssetLoader { private static readonly byte[] KEY = System.Text.Encoding.UTF8.GetBytes("A7L4S_32_BYTE_INTERNAL_KEY_123"); private static readonly byte[] IV = System.Text.Encoding.UTF8.GetBytes("A7L4S_16_BYTE_IV!"); public static byte[] LoadBytes(string relativePath) { string path = Path.Combine( Application.streamingAssetsPath, relativePath + ".bin"); if (!File.Exists(path)) { Debug.LogError("Atlas: Encrypted asset missing: " + relativePath); return null; } byte[] encrypted = File.ReadAllBytes(path); return Decrypt(encrypted); } private static byte[] Decrypt(byte[] data) { using (Aes aes = Aes.Create()) { aes.Key = KEY; aes.IV = IV; using (MemoryStream ms = new MemoryStream()) using (CryptoStream cs = new CryptoStream( ms, aes.CreateDecryptor(), CryptoStreamMode.Write)) { cs.Write(data, 0, data.Length); cs.Close(); return ms.ToArray(); } } } }
using UnityEditor; using UnityEngine; using System.IO; using System.Security.Cryptography; public class AtlasObbPacker { private static readonly byte[] KEY = System.Text.Encoding.UTF8.GetBytes("A7L4S_32_BYTE_INTERNAL_KEY_123"); private static readonly byte[] IV = System.Text.Encoding.UTF8.GetBytes("A7L4S_16_BYTE_IV!"); [MenuItem("Tools/Prepare StreamingAssets")] public static void EncryptStreamingAssets() { string root = Path.Combine(Application.dataPath, "StreamingAssets"); if (!Directory.Exists(root)) { Debug.Log("Atlas: No StreamingAssets folder."); return; } foreach (string file in Directory.GetFiles(root, "*", SearchOption.AllDirectories)) { if (file.EndsWith(".bin")) continue; byte[] raw = File.ReadAllBytes(file); byte[] enc = Encrypt(raw); File.WriteAllBytes(file + ".bin", enc); File.Delete(file); } AssetDatabase.Refresh(); Debug.Log("Atlas: StreamingAssets encrypted for build."); } private static byte[] Encrypt(byte[] data) { using (Aes aes = Aes.Create()) { aes.Key = KEY; aes.IV = IV; using (MemoryStream ms = new MemoryStream()) using (CryptoStream cs = new CryptoStream( ms, aes.CreateEncryptor(), CryptoStreamMode.Write)) { cs.Write(data, 0, data.Length); cs.Close(); return ms.ToArray(); } } } }
Every protection layer ships inside three scripts — nothing extra to install or configure.
.bin before your build ships — players can never extract raw assets from the APK or build folder.Tools → Prepare StreamingAssets in the Unity Editor to encrypt all assets in one click before every build.Start() — giving the SDK time to initialise before Atlas evaluates the session state.quitInEditor flag lets you test enforcement in the Unity Editor without killing your play session during development.Enable Custom Authentication in your Photon server settings, then paste this as your auth URL:
https://michaelservices.pythonanywhere.com/auth
.cs files from GitHub and drop them anywhere in your Unity project's Assets/ folder.AtlasProtection as a component on a persistent GameObject in your first scene.Tools → Prepare StreamingAssets before every build to encrypt your assets automatically.