Crypt source code?
Discussion in 'Rust Development' started by Sir BenSon, Aug 16, 2016.
-
You could make it hard to read, using unintelligible aliases and variables names, but afaik encryption is not possible as the compilers needs an actual legible source code.
May I ask why do you want to encrupt your code ? Its not exactly in the spirit of plugin developement and I doubt one can apply any kind of licence / protection on their work in this context ? -
No, it isn't possible.
You can minify it, but that's it.
To extend your statement, not just the compilers need legible source code, the runtime needs legible byte code and the processor needs legible assembly as well, so even without the compiler it'd still not be possible.
Applying certain licenses is very well possible, as all applications are decompilable (which is for non-bytecode languages almost the equivalent of minification) and most js nowadays is minified, and I doubt that applications like MS Office aren't properly licensed
.
That being said, when you hand any kind of "minified" source code (be it minified source code, byte code, assembly, ...) to a user, you're effectively handing them the source code. You can make it harder for them to reverse engineer, but you can never fully prevent the client from eventually deciphering the source, as the client will always have full control over his PC.
This is why things like DRM and anti hacks are effectively futile and just make it a bunch harder for people to eventually crack stuff. -
You can obfuscate the code. How can I obfuscate my c# code, so it can't be deobfuscated so easily?
-
Wulf Community Admin
Yeah, but that just makes it more challenging to figure out, but not impossible. Look at 7 Days to Die, Minecraft, etc.
