How to protect source code in an electronic project

I am creating my first electronic application, but now I am wondering how to protect the source code for viewing by other developers.

The white paper says:

To protect your application resources and source code from users, you can choose to pack your application into an asara archive with a small change to the source code.

So far, the best I can come up with is the ugliness of the source code and packing it into an asar file, but the asar file is just an archive and can be easily extracted. I don’t see how to make the code "user protected"

Any ideas?

+8
copy-protection electron
source share
3 answers

There is currently no official way to protect against copying your code, sorry - if you want to do this, you will have to invent your own way (or just do not worry about it)

+4
source share

It is impossible to completely protect the code, no matter how you pack it, to run it, it must be accessible and decrypted, which means that the key must be stored locally.

Consider this scenario;

The authors of the electronic system and the asar file format implement encryption similar to password protected zip and give you the opportunity to specify the archive password at compile time so that it is "safely" stored inside the .exe and the asar file cannot be opened / read without it.

The hacker could still understand the key by compiling the electron itself with some test keys, such as AAAA and AAAB, then comparing the resulting binary to determine the location of the key string inside it. As soon as they learn how to extract the key from exe, the game is over.

I think the strongest protection you can do is change the source code of the electron to store and retrieve the key, but even then the attacker can decompile the code, compare it with the decompiled standard version of the electron, find out where your code changes start and reconstruct until they figure out how you store the key.

Again, at the moment when they have a key, the game ends, and in order for the electron to run any code, it had to read it, which means that it must have an accessible key locally. Catch 22.

+2
source share

I got one exe file packed by Electron, but how to unzip this exe file? Could you show a few ways? Thank you

0
source share

All Articles