K
K
kaktak2552021-10-01 20:35:31
C++ / C#
kaktak255, 2021-10-01 20:35:31

How to encrypt the algorithm inside the program?

It's not about obfuscation.
For example, a small program there considers something back and forth, in general, some kind of algorithm, how can you hide this algorithm so that it would not be clear how it works?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
W
Wataru, 2021-10-01
@kaktak255

No way.
You can only complicate reverse engineering. The most efficient way, if performance is not very important, is to implement your own virtual machine with a bunch of similar, but slightly different instructions, and implement the algorithm on it. You also need to cram all sorts of unimportant actions into the algorithm, like adding 5 to the number here, then it is then multiplied by 2 in the algorithm, then subtract 8 and 2. You can write a translator from a simple scripting language to THIS, otherwise you yourself will get confused.
But all this slows down the program, greatly complicates writing and maintenance, and eventually breaks anyway. In general, an "intruder" can simply copy your algorithm along with the virtual machine. You can only make it harder for him to find the right piece of code.
Here is the same problem that copyists are trying to deal with: the algorithm is information. And if it is, nevertheless, executed on the user's computer, you can in no way forbid him to watch, copy or modify it.
The only reliable enough way is to execute the algorithm on the server and give the client only its result. But that's not at all what you mean.

T
Tony, 2021-10-01
@AntonSazonov

There is a wonderful library. It's called AsmJit.
With its help, you can write a program that, during execution, will create a function you specify with the desired algorithm. Using this library, you can generate code exactly for the set of instructions that is available on the machine being started.
In short, you can achieve maximum performance on any x86 architecture, but it will be much more difficult to disassemble and understand your algorithm.

L
Lolxdxd, 2021-10-03
@Lolxdxd

Themida/Vpmrotect code virtualizer, system call obfuscation. If it is very important directly, then execute the algorithm on your server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question