Luau obfuscator · v0.1

Protection that starts at the parser.

TSVOBF compiles Luau into a register IR, encodes it as a binary payload, and emits a seeded interpreter. The original source is not included in the output.

Tests
11 / 11
Opcodes
27
Directives
6
Per build
1 token
12,246 bytes
local OP = {
  SETINDEX=1, FORPREP=2, UNOP=3,
  CLOSURE=4, NIL=5, RETURN=6,
  CLOSE=7, CONCAT=8, SETGLOBAL=9,
  TEST=10, GETUPVAL=11, GETFIELD=12,
  NEWTABLE=13, LEN=14, FORLOOP=15,
  MOVE=16, VARARG=17, BINOP=18,
  GETGLOBAL=19, JMP=20, SETLIST=21,
  SETFIELD=22, CMP=23, SETUPVAL=24,
  LOADK=25, CALL=26, GETINDEX=27
}

local function fnv(data)
  local hash = 5381
  for i = 1, #data do
    hash = math.fmod(hash * 33 + string.byte(data, i), 65521)
  end
  return hash
end
Compiled from 261 bytes of source seed: test-seed

How it works

Three passes, no source wrapper.

The input is parsed before anything is emitted. Comments, strings and member access are preserved as syntax, not concatenated as text.

01

Parse

A hand-written lexer and recursive-descent parser build an AST with declaration identities. Shadowed locals bind to the right declaration, not to a name.

02

Lower

The AST becomes a register IR with typed instructions and explicit call and return arity. A reference interpreter executes the same IR during differential tests.

03

Emit

The IR is packed into a versioned binary payload with a checksum. The emitter writes a Lua interpreter with a seeded opcode permutation, then verifies the payload.

In the artifact

  • Encoded instruction stream and constants
  • Checksum-verified payload reader
  • Seeded interpreter and opcode table
  • Function prototypes with captures

Not in the artifact

  • Original source text or comments
  • Macro directives or policy names
  • Readable function or variable names
  • Any call to loadstring

Pricing

Tokens for builds. Plans for volume.

One token compiles one script. Plans add a monthly token allowance. Checkout on this deployment is a demo — no payment processor is connected.

Free

On signup

$0

5 tokens

  • Full compiler pipeline
  • All macro directives
  • Seed control
Create account

Hobby

Monthly

$12

25 tokens / month

  • Everything in Free
  • Priority build queue
  • Email support

Studio

Monthly

$99

1,000 tokens / month

  • Everything in Pro
  • Highest build priority
  • Direct engineering contact
Token packTokensPrice
Starter10$9
Builder50$29
Studio250$79

Documentation

CLI and directives.

The same compiler runs in the CLI and in the web workspace. Directives are compile-time only and are removed before emission.

Terminalnode 18+
# compile a script with a fixed seed
node dist/cli.js obfuscate input.lua output.lua tsvhub-build

# run the reference interpreter on a sample
node dist/cli.js demo

# run the differential test suite
npm test
Directivescompile-time
NamePurpose
OBX_ATTRSet policy for the file
OBX_STRProtect a string literal
OBX_NUMProtect a numeric literal
OBX_ASSERT_INTEGRITYEmit an integrity check
OBX_BUILD_IDRead the build identifier
OBX_IS_PROTECTEDBranch for protected builds
Example inputbefore compilation
local function protectedCalculation(input)
  OBX_ATTR(VM("STRONG"), PRESET("SECURE"))
  OBX_ASSERT_INTEGRITY()
  local label = OBX_STR("calculation")
  return label, input * OBX_NUM(17), nil
end

Limits

What is verified, and what is not.

Published limits are part of the product. These are the current ones, tracked in the implementation ledger.

  • Verified Differential tests cover arithmetic, shadowing, closures, short-circuiting, loops, tables and multi-value returns.
  • Verified Macro directives are removed from the artifact and return arity is preserved.
  • Known VM("STRONG") and PRESET("SECURE") are parsed and recorded, but do not yet select a different runtime.
  • Known Structural diversity is limited to opcode permutation. Block flattening and instruction fusion are not implemented.
  • Known Differential tests run on Lua 5.1 through Fengari, not on a real Luau compiler.
  • Known Coroutine, yield and metamethod behaviour is not covered by tests. Performance numbers are not published.