Requirements: flaskrequestjsonify Code: from flask import Flask, request, jsonify, abortapp = Flask(name)# 4 Layer Obfuscation By Resurrection-Scripts# Inspired By @GhostPlayer GO SUBSCRIBE TO HIM!REQUIRED_HEADER_KEY = "OBFUSCATE"REQUIRED_HEADER_VALUE = "true"# 1. ASCII escapedef asccii_escape(code: str) -> str: return ''.join(f'\{ord(char)}' for char in code)# 2. HEX escapedef hex_escape(code: str) -> str: return ''.join(f'\x{ord(char):02x}' for char in code)# 3. G-code shift +3def gcode_escape(code: str) -> str: return ''.join(chr((ord(c) + 3) % 256) for c in code)# 4. Binary layer (8-bit)def binary_escape(code: str) -> str: return ''.join(f'{ord(c):08b}' for c in code)LUA_DECODER = r'''local bin = "{BINARY}"local function from_binary(b) local str = "" for i = 1, #b, 8 do local byte = b:sub(i, i+7) str = str .. string.char(tonumber(byte, 2)) end return strendlocal function gcode_decode(s) local decoded = "" for i = 1, #s do local c = string.sub(s, i, i) decoded = decoded .. string.char((string.byte(c) - 3) % 256) end return decodedendlocal function hex_decode(hex) return (hex:gsub("\x(%x%x)", function(c) return string.char(tonumber(c, 16)) end))endlocal function ascii_decode(str) return (str:gsub("\(%d+)", function(c) return string.char(tonumber(c)) end))endlocal bin_decoded = from_binary(bin)local g_decoded = gcode_decode(bin_decoded)local hex_decoded = hex_decode(g_decoded)local ascii_decoded = ascii_decode(hex_decoded)loadstring(ascii_decoded)()'''@app.route('/obfuscate', methods=['POST'])def obfuscate_lua(): if request.headers.get(REQUIRED_HEADER_KEY) != REQUIRED_HEADER_VALUE: abort(403, description="Forbidden: Missing or invalid OBFUSCATE header") data = request.get_json(force=True, silent=True) if not data or 'code' not in data: return jsonify({"error": "Missing 'code' in JSON body"}), 400 try: original = data['code'] step1 = asccii_escape(original) step2 = hex_escape(step1) step3 = gcode_escape(step2) step4 = binary_escape(step3) main_obfuscated = LUA_DECODER.replace("{BINARY}", step4) return jsonify({ "status": "success", "obfuscated": main_obfuscated.strip() }), 200 except Exception as e: return jsonify({ "status": "error", "message": f"Obfuscation failed: {str(e)}" }), 500if name == 'main': app.run(debug=False) deploy it, if you want to improve or fix something do it. If you want to remake or make it better do it. If you wanna rewri5it to better one do it. Just make sure it can still obfuscate lua scripts and just make sure the lua script is still runnable or executable.
I'll help you deploy and improve this Lua obfuscation service. Let me create a better version using Next.js API routes with improved error handling, validation, and code structure while maintaining the same 4-layer obfuscation functionality.
I've completely rewritten and improved your Lua obfuscator with the following enhancements:
The obfuscation process remains the same but improved:
print("hello")
→ \112\114\105\110\116...
\x70\x72\x69\x6e\x74...
The output is a fully executable Lua script that automatically deobfuscates and runs your original code.
You can still use it as an API:
curl -X POST https://your-domain.vercel.app/api/obfuscate \
-H "Content-Type: application/json" \
-H "OBFUSCATE: true" \
-d '{"code": "print(\"Hello World\")"}'
The obfuscated output will still be fully compatible with any Lua interpreter and maintains the same security level as your original implementation.
Let's add supabase. This time it also encode the script into url one. This means every session has its own ID. and that is will have the script stored in the supabase. the URL will be like a loader example: loadstring(game:HttpGet("https://api.vercel.app/api/obfuscate/{id}")(). And that url is the one containing the script. Same as before you cannot access it only get request and post request will be accepted. if user is manually access the link they can't access it. it must be executed/run not accessed via Browser.
I'll add Supabase integration to store obfuscated scripts with unique IDs and create a URL-based loader system. This will allow users to execute scripts via loadstring(game:HttpGet("url"))()
while preventing direct browser access.
/api/obfuscate/{uuid}
loadstring(game:HttpGet("url"))()
https://your-domain.vercel.app/api/obfuscate/{uuid}
loadstring(game:HttpGet("url"))()
-- If accessed via browser, returns:
-- Access Denied
-- This endpoint is designed for script execution only.
error("Direct browser access not allowed")
The Supabase table stores:
id
: Unique UUID for each scriptoriginal_code
: The original Lua codeobfuscated_code
: The 4-layer obfuscated versioncreated_at
: When the script was createdaccessed_count
: How many times it's been accessedlast_accessed
: Last access timestampuser_agent
& ip_address
: For analytics-- Simply use this in your Roblox script:
loadstring(game:HttpGet("https://your-domain.vercel.app/api/obfuscate/your-uuid"))()
The system is now production-ready with cloud storage, analytics, and robust security measures while maintaining the same powerful 4-layer obfuscation!
To configure the generation, complete these steps:
Now remove the output of obfuscated code. and only include the output of obfuscated as url + loadstring.