Is Obfuscation the correct term for what I intend. And what options are available for this, what is the correct term for this in regards to JavaScript?
Asked
Active
Viewed 61 times
0
-
1What does "protected from copying" mean? – luk2302 Jan 03 '21 at 12:49
-
What are you trying to protect from what and why? – luk2302 Jan 03 '21 at 12:49
-
first of all I try to protect business logic from plagiarism. But the intention behind that I want to create a layer, so that the user does not find out how I achieve the result that I present to him. – Andreas Bosch Jan 03 '21 at 13:30
-
Can I put the business logic on the server, node.js server, and run it and then output the results, these results can be copied. The logic that presents the results does not necessarily have to be protected. Because it then outputs what has already been created on the server, so only the results. – Andreas Bosch Jan 03 '21 at 13:37
-
Does this answer your question? [How can I obfuscate (protect) JavaScript?](https://stackoverflow.com/questions/194397/how-can-i-obfuscate-protect-javascript) – Mike Szyndel Jan 03 '21 at 15:25
1 Answers
0
It depends on what protect means! If you do not want anyone to see your code and uses it or discovers your logic, then the answer is no!
If you have secrets like an API key or password in your code, your approach is wrong, and you should not have any hardcoded sensitive data in your code!
JavaScript is an interpreted language, not a compiled language, so you do not have the luxury of converting your files to DLL, EXE, or whatever format! Even compiled files can still be unwrapped, so again we go back to the fundamental question of why you want to protect your code!

Mehran
- 100
- 1
- 6
-
I was thinking that if I write I want to protect it from being copied, then it's obvious. Either way, do not copy. So that no one uses my invention as his own. Protect intellectual property on the one hand and on the other hand, so that the savvy user does not harm himself by making the code worse. And since you mention it, passwords and so on should also be protected. I have the feeling that when I ask this, I have to be ashamed of the fact that I want to hide my code. Well, what if I use node.js on the server and the server provides the private code to a browser script via "require module"? – Andreas Bosch Jan 03 '21 at 13:21
-
Ok, the code is then dumped anyway and can be read clearly right? – Andreas Bosch Jan 03 '21 at 13:26
-
@AndreasBosch Obfuscated code cannot be read by a human without some effort, but in can be reversed. Other people are not allowed to take / copy your code as long as you do not give them explicit permission to do so, e.g. via some license. If in two years you see your code being used somewhere involve a lawyer, end of story. – luk2302 Jan 03 '21 at 13:35
-
You do not need to be ashamed if you want to hide your code as your intellectual property. If you want to hide your logic from users that are using your frontend, then definitely you need to have a backend service that runs on your own machine/cloud, and the frontend must only make calls to get what it needs – Mehran Jan 04 '21 at 14:07
-
The frontend must not have business logic; it should only care about showing data and information to the user. For example, if you want to block a user from login into the system, this decision must be made on the back-end and front-end-only calls API to pass the parameters and get the response. – Mehran Jan 04 '21 at 14:12