r/C_Programming • u/Motor_Bluebird1908 • 1d ago
Protecting source code from reverse engineering
Hi everyone,
I am looking to provide a compiled version of our physics solver to our customers. I understand there are many obfuscation techniques to protect source code but I am wondering if there are some smarter ways?
We already cloud computing, the issue is we have customers that are in locations without internet/need realtime solving.
0
Upvotes
0
u/Daveinatx 1d ago
All code can be decompiled with IDA pro or ghidra. That said, there are ways to try to hide it. Usually you would want to use encryption over essential code, whether it's the application, libraries, or sections of runtime code. Even then, good hackers know what they're looking for at run time even within cache.
Your absolute best way though, is to use keys that are hidden either behind an fpga, USB fob, or possibly within a TPM for key wrapping. Once pages are needed, force it within the cache before decryption. Zero out keys after usage.
I used to get paid a lot for doing this, it's complex to do right. So, it all depends on what level you or your customer wants. But the rest of the details are for you to research.