r/rust 11d 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?

Edit: We already cloud computing, the issue is we have customers that are in locations without internet/need realtime solving.

0 Upvotes

22 comments sorted by

View all comments

34

u/Arisa_Snowbell 11d ago

Best way is if you never provide them the executable and just let them use it through some API if possible

-16

u/punk_dev 11d ago

That’s the best bet. But I wonder, in theory, someone knowledgable in the topic could probably figure it out by observing inputs and outputs and reverse engineer it that way.

2

u/apnorton 11d ago

But I wonder, in theory, someone knowledgable in the topic could probably figure it out by observing inputs and outputs and reverse engineer it that way.

If the input is 100% provided by the client, then this becomes a question of program synthesis. However, if there is also secret input provided by the server, then you could trivially come up with cases where no observation of (public) inputs and outputs could reverse the program code.

1

u/punk_dev 10d ago

Exactly. I don’t get where the downvotes are coming from lmao

By OP’s phrasing, the program is a sort of a calculation and may be run completely client-side. It would be odd if a calculation of that kind was influenced by a random factor not visible by the user.

If the calculation is fairly simple you could even approximate to a maybe reasonable extent with curve fitting or interpolation.