How this scripts are encrypted and protected?

Hello, I Just came across a script that Is protected like this:

пдиуияуфутушыоиетдыутяраруегыяеешхшуееяаятяяхоххгдгугяхафтдгдадесгсусеаадтпгпоптодооояпхитпгуоуеыгыуиттаурргыореедеоеяшаштршяоеехдхухегагуфгяшфегддудясфстагаоарпдсупяоаоиигисиепыууиеыаытыетотхрдрурятает

some random unreadable code, Is there any way to encrypt It? How can I do this without anyone encrypting? I do not know much about this, but any information will be helpful, Thank you! :slight_smile:

2 Likes

I’m not a scripter or anything, but I don’t think that script is “protected.” Looks to me like a backdoor or virus of some sort. I would remove that from your game asap.

(Please correct me if I’m wrong about that)

This is a script that was obfuscated using MoonSec (note the _msec variable).

image

Its either a backdoor or just encrypted code, either way, obfuscators are illegal third party software as mentioned by Roblox so you should not use this anywhere and best would be to report it.

Correction: If the obfuscated code is public, it’s breaking the rules.

image

Yes, but mainly because it’s unclear what the underlying behavior is. It’s generally a good idea to not use untrusted scripts, obfuscated or not. Much like how you shouldn’t enter vehicles you don’t trust.

No, It is not a virus, I bought the product, I did not run the script or anything, I am just curious how this thing works! Thank you! :slight_smile:

I understand what you are trying to say, but let’s say you created a script for someone, and he wants to leak that that script, I know It’s not the perfect way to protect or “save” the script from leaking, but at least they could not edit and resell It or something like that! :slight_smile:

That is the exact reason you have “obfuscated” code. Its to keep people out from editing your code and claiming it as your own or stealing bits of it. While this isn’t perfect and can be deobfuscated it is a decent way to deter most people. The code is meant to be changed in a way where it is unreadable by humans and can only be read by a Program, in this case Roblox’s Engine. While Obfuscating does increase Security, it comes at the cost of performance. Having heavy (long) scripts obfuscated can cause a toll on the Client Or Server (Which ever is reading the script/running).

Thank you for your explanation! That helped me a lot! while I am still looking for a way to keep people from stealing the scripts and leaking Them, I did not find many details for It, also I want to know how to encrypt the code or protect it (not with some free websites, where you can just paste the code and crypt and encrypt It) any details are appreciated! :slight_smile:

Don’t bother.

It’s a fight that you’ll always lose, and the bad actors will always win on this front.

To put things into perspective:

  • It takes up to an hour to deobfuscate a script, or decompile its bytecode into Luau.
  • It takes 15 minutes to find a tool that can extract your game (or rather, what the client will see in their game)
  • It takes 15 seconds to find those assets directly.

Rather than worrying that your client-facing code (and in extension, your assets) would get leaked, you should not show anything sensitive to your clients in the first place.

Just put anything important, be it game logic or assets, on the server. It’s the only thing you can do.