Issues with script protection

Hey Scripters!
I have a question that I need answered.
What are the best ways for protecting my scripts for my product?

My product is SmartOrders, a Cafe and Restaurant system. We are currently in the Beta Testing phases, and we need a way to use script protection. Currently our provider Devable has been going through a lot of changes, and they state that Script Protection is coming soon, but I really need another solution in case it fails. Its a pain that Private Modules are gone

We are selling the product, which is why we are protecting it, so people don’t steal our code and take credit for it.

If it helps, the on-game script protection is what we are using, and its when our scripts are sent to the game as obfuscated bytecode. Their obfuscation is powered by Ironbrew.

I’m no Roblox scripter, so please avoid real technical explanations.

1 Like

I assume you’re referring to protecting your scripts from being leaked by exploiters?

I know minimal regarding this topic. Although, there’s a few things I can tell you. Make sure to put your scripts in the proper place. ServerScriptService for server scripts, not workspace. Descendants of workspace will replicate to clients; including scripts. By placing your core scripts into ServerScriptService, you’re cancelling any replication those scripts will have to clients. Obviously you need some scripts on the client, but just make sure to maximize usage of RemoteEvents and server calls to get the information you need, without exposing important data to the client that they really shouldn’t have complete access to.

I hope this helps, and I hope this was your question. :slight_smile:

We are selling the product which is why we need protection (so no one claims credit for our assets)

I mean, if you’re selling a product then they’ll have full access to your product; which they can then do whatever they want with, which I think is fair if they’re paying you for it.

We’re using Devable Script Protection as we are selling it, but we need alternatives due to timing issues. It’s like @wind_o product CheckMeIn, if we sell a license with the code exposed, they will take the code and claim credit for themself. We need an alternative to devable, for the meantime.

Discussion about selling products with closed-source code has been discussed in great lengths on the forums many times before. It would do you well to search through those threads to see if you can glean over any information that might help you out here.

The long and short of it is that without a medium from a third party or obscuring your code so that reading it is difficult to do, the market for closed-source products has been wiped as per the removal of the ability to require modules by id if they’re private.

No alternatives realistically exist that run with the same effectiveness that the aforementioned removed feature gave. I don’t know of any other mediums that allow you to call code from external sources and if you’re hoping to do it all in Roblox, then there definitely is no way besides not selling your items.

Consider repping a feature request or writing one yourself. Roblox has evidently been implementing more permissions layers to protect against both bad actors and give developers greater control over what outsourced assets in their games can do and they’re definitely aware of the ModuleScript problem, so there’s always room to improve the dynamic and possibly reintroduce closed source materials.

When it comes to securing code, there is no one answer as there used to be and certainly no answer can give you the level of security that closed source modules gave at one point. One thing to ALWAYS steer away from is minifiers posing as script obfuscators, as they are easily by passable with a beautifier.

There are a few ways to go about truly obfuscating your code, the first is self obfuscation. In my own experience simply shortening some variables, removing indentation, combining lines, etc, is a good enough way to self-obfuscate your code. This isn’t always the most secure though it certainly is a viable option.

Alternatively, you could look into opensource script obfuscators (Ironbrew, Xen, etc), though they certainly come with their risks and rewards. From my understanding, Xen is more secure though takes significantly longer to obfuscate code, where-as vice versa for the opposite.

I will offer a question: why not just make a white list? I have made many secured source projects in my day, and using a white list as opposed to pure obfuscation has always made it significantly easier on me. Perhaps I am misunderstanding the goal of obfuscation though.

Your best bet is to use a lua obfuscator. You can look around for them on Google.

The goal of your obfuscation should be to slow down anyone trying to steal your work, and once it becomes popular, a leak will not destroy your business. This is exactly how I did it. If you want more advice, feel free to send me a DM. I’ve spent a lot of time researching this subject.

As for what @TerryMichaelBrunk said, I think a white list is exactly what he’s trying to make here, however, the whitelist will probably be a database that updates automatically when someone buys a ‘license’. With the way modules work right now, they can only be require()'d when the model has the ‘Allow Copying’ setting enabled. Because of this, an attacker could simply take the model and steal the code. This is where the obfuscation comes in.

1 Like

By “whitelist”, I am specifically referring to making the code ONLY work if a name can be found in said database, which, along with the extensively aforementioned obfuscation would make the script practically impenetrable.

Currently from what it looks like (I’m not much of a roblox scripter), the code calls for a User ID in our databases. If it recognizes there is a User ID there, it will look for a value, STAN or ENT. I’m assuming once this value is found it will run the code. We just need to hide that code.

As most people are saying, using a whitelist along with obfustication can go a long way. Another thing I might add that I like to do, although it requires more work, is to put any processing things on HTTP. All the inputs go straight off roblox and onto a secure server. It’s more work and you have to worry about downtime, but if those are not concerns of yours go for it.

And of course be sure to obfuscate and such.

1 Like