Encrypting files

Is it possible for me to encrypt a lua file so others cant read it but the server can still read and run the code just fine?

No. Nobody can read serverside files anyways.

There are other people that work on the server that i do and i dont want them stealing my code, I know there is a way to do it i just dont know how. I have looked at one of the files in the !cake anticheat and the code looks uncompleted and when i use the arrow keys there are a lot of chars in a empty space i know this because it take about 5+ click of the right/left arrow key to pass a empty space

No, there is no way to encrypt lua files. I have to wonder though why are you working with people on a server that you don’t even trust. The best way to keep your files secure is to only give people who you trust access to them.

Encrypting code is a bad and shady practice, but it is in theory possible.

One way that has been used before is by creating a module that hides code within it, and then calling that code using a function from within the module. The only way to access the code would be to reverse engineer the module.

You could always encrypt the code and just decrypt it whenever you run it.

That actually sounds like a good solution, but how can you decrpyt a module, is it easy?

You could use lua obfusctators, makes your code unreadable.

You can’t decompile nor decrypt a module, the most you can do is use Hex-Rays or IDA and get the assembly of the module, and i’m pretty sure none of the staff on your server know how to do that. (Sorry for the rude post insulting server staff) Also, why would you give your server files to people you don’t trust?

It’s fully completed, but obfuscated by adding invisible/empty chars for variable, function, and _G backups.

[editline]8th October 2015[/editline]

Obfuscating your code is bad, don’t do that. Unless you have a state of the art anticheat with check methods that you don’t want cheaters to bypass, don’t obfsucate your code.

You sure at 100%?

EDIT: Reduced pngs

Are these images not loading for anyone else too? Malwayrebytes says the site isn’t safe and if I disable it the image is missing anyways.

Back on topic: C++ dlls are very hard to decrypt/decompile. If it was so easy people would be decompiling shit like Photoshop, removing any anti-piracy, and distributing that.

On the topic of obfuscation are you refering to client files? The clients “shouldn’t” have access to server files though some exploits have existed in the past. If you want to make the clients not have access to client files that might be a bit more difficult. You can’t really stop it but you can make it a pain in the ass. Make your code one massive ass line, give everything wierd names, do shit in hex if you want. Anything to make it a pain in the ass really. In the end they can see your code, it’s just a matter of how determined they are.

Apperently its something to do with imgur, I just disabled my website protection :v:

Hex-Rays is the company that made IDA, hex-rays is not a program you can use.

Did you just google “C++ decompiler” and Boomerang was the first result? It’s really not very useful program.

C++ can not be decompiled, whatever compiler you used to compile it, information is lost that will never be returned via any decompiler you can find. This is the same for any language that compiles into processor instructions directly.

You didn’t decrypt neither really decompile it. You just read the function names out of the exe’s pdb (debug) file.

Disabling the file on module compilation will make your program output garbage.
And reading the c/c++ instructions of the output of your software isn’t really easy. Information is always lost on compilation into machine code.

Seriously, just what boxvader said.

Still better than reading assembly language for somes.

No and I known C++ can not be decompiled and informations are lost. I just use Boomerang sometimes for basics things (but still inaccurate at somes levels.)

I was just saying that somes dll/programs can be “decompiled” into a readable form of C++.
Most of them are usually basics dll/programs likes modules for GLua.

Of course, for everythings else, it would be IDA like everyone would say.

Regardless none of this helps him with his question. There is no way to have a file encrypted on the server case closed.

Back on the topic:

Work for what? On your code?
If no and you are working under a linux server, you can lock the access of your code for the server and you only.


If your goal is to prevent your nontechnical admins from reading your code then you could probably get away with hiding it by using a module to decrypt it before it is run. Just note that THIS IS NOT A SECURE SOLUTION. It would be equivilent to preventing children from getting at your cookies by putting it on a shelf they can’t reach. Eventually they will realise they can just use a stool to reach them. All your admins would need to do is pay someone like myself or any number of people on this forum alone who would be capable of undoing whatever solution you write up. Really the only decent method of preventing code stealing is obfuscation.

To be fair, it’s also the name of their decompiler.