Better Hexadecimal

Is there any sort of better hexadecimal obfuscation in Lua? For example:

function th(str)
    return str:gsub(".", function(c)
        r = c:byte()
        return string.format("%02X", r)

people can easily deobfuscate this. Is there a way better version that requires hard deobfuscation? and if so, please PM me a method. Thank you.

What are you trying to obfuscate?

“Hexadecimal obfuscation” is a bit of a strange term: hexadecimal is a very specific thing: as long as you convert something to hexadecimal directly then it can always be decoded easily.
In short: hexadecimal has NOTHING to do with obfuscation/encryption.

What you are looking for is encryption.

Eg this is a very simple but a easy to hack way of doing, you might need to search for better encryption algos if needed:

It’s not lua, but I’m thinking of making a custom VM with C#. this can help. Thank you!