Leonid
Leonid

Reputation: 1157

Protecting source code of a DLL

I have a library written in C#. I want to distribute it as a DLL. But it seems that .NET allows for comfortable decompilation of it, so the algorithms can be easily stolen.

I can rewrite it in C++, but I'm new to .NET. So, the main problem would be to write an interface to C#. The library is not too big and uses threads, network and some math

Is there a way to build a DLL that can by disassembled only? Or I better need to just write everything in C++ and provide an interface to C#? Is it much harder to decompile C++ than C#?

Upvotes: 1

Views: 2062

Answers (2)

Joseph Willcoxson
Joseph Willcoxson

Reputation: 6040

If you are really worried about the intellectual property of your algorithm, then you have some options.

1) Patent the algorithm. I can hear the howls, but that is how you protect intellectual property in a legal manner.

2) Do not give the DLL with the algorithm to the users. Host the algorithm in the cloud and only allow customers to access it that way.

Some of the rest i don't understand. You say you can write C++, but don't know how to write an interface to C#? Use COM. C# can use COM libraries. Or, export your function in C++ and write a .NET interop library that calls the C++ DLL using PInvoke.

Upvotes: 1

keithwill
keithwill

Reputation: 2044

Everything distributed to end users can be reverse engineered. You can increase the amount of effort that takes, but it will always be possible. If your algorithm is truly critical, proprietary and valuable and you are still doing application design and the result of your algorithm is either not performance critical or can be chunked...then maybe you could consider a web service approach. You could then use some of the strongest industry standard protections for access to your calculations.

Upvotes: 2

Related Questions