Skip to content

LuaUI Encrypt

wezzzyrek1 edited this page Aug 14, 2026 · 3 revisions

Lua UI - Encrypting scripts

A small Windows tool that turns your plain .lua window scripts into the encrypted .usc files a live client loads, so players never receive readable source. It ships with LuaUI Ext.

In dev mode a client reads plain .lua. A live client reads only .usc - the same scripts, encrypted with your key (see File map). This tool does the encrypting.

Keep your .lua - encryption is one-way

The tool only encrypts. There is no way to turn a .usc back into .lua.

Encrypt a copy and keep the plain .lua as your working source. If you lose it, the script is gone - you would be rewriting it from scratch. Treat the .usc as a build output, never as your only copy.

The key

.usc files are packed with a 32-character key, and it must be the same key the server hands the client - LuaUIScriptKey in Data\Plugins\PluginSettings.ini. If the two differ the client cannot read your scripts, and the window silently does nothing on a live server.

The tool keeps the key in its own config.ini, next to the exe, so you set it once:

[LuaUI]
LuaUIKey=<your 32-character key>

The Key field in the window shows it and writes it back when you change it.

Encrypting

  1. Tick Encrypt .lua as user-script (.usc) with custom key. This is what routes a .lua to .usc with your key.
  2. Check the Key matches your server's LuaUIScriptKey.
  3. Drag your files - or a whole folder - onto the window, or use Choose file. A folder is walked for every script inside and you get one summary at the end, instead of a dialog per file. A single file gives you Open / Copy buttons for the result.

Then drop the .usc into the client's script folder in place of the .lua, and ship without the .lua. On a live server the client loads the .usc; keep the plain .lua on your own machine for dev mode.

Which files to encrypt

Everything a live client requires or auto-loads as a window:

  • UI\UI.lua, UI\Registry.lua, UI\Net.lua, UI\Protocol.lua, UI\Enums.lua
  • UI\Windows\*.lua
  • SimpleXml.lua

Dropping the whole UI\ folder on the tool does all of these in one pass.

Notes

  • .usc is the user-script format - packed with your own key. .lsc (Lua) and .xdc (XML) are the general encrypted formats, packed with a fixed built-in key. With the tick box off a .lua becomes .lsc and an .xml becomes .xdc instead; for Lua UI you want the .usc route, so keep the box ticked.
  • An empty file is reported as "file is empty" rather than a vague failure.

See Also

  • File map - .usc vs .lua, and how the client chooses
  • Lua UI - LuaUIScriptKey and turning the system on

Clone this wiki locally