I have a relatively large C# project. I want to allow other developers to collaborate with me on the project. But I'm afraid they will copy the source code verbatim. I want to protect my code. Is there a way I could grant collaborators usage of existing .dll's w/o them able to read the source code? Or grant them temporary access to the .dll's and later when they roll off the project just disable their ability to use the .dll?

有帮助吗?

解决方案

Absolutely, you can give other people DLLs without access to the source code. In most situations like this, you would obfuscate the dll (many tools to do this, I would start with the Dotfuscator included with Visual Studio) so they can't decompile it.

If you want them to be able to see the source, there isn't much you can do to avoid them copying it, same with "disabling their ability to use it". If they have a copy of the file, there isn't much you can stop them from doing (technologically speaking). The only security I can think of for that would be to have all public functions check against some server before executing (thus making the DLL useless if you have that server not allow them to run), but that isn't 100% and would make for a terrible experience for end-users of the code.

其他提示

To add to LordTakkera's answer, the part about licensing.

A variation on licensing is to only allow DLL to run for something like 30 days or so, and the DLL would check local time (or hit a time server) to see if it is past due. Then you can supply time-limited DLLs to your collaborators, and keep them updated every month with a newer copy while they're staying on the project. This is less involved as it won't require to have a license server and maintaining license keys, and necessary cryptology to make sure someone isn't able to fake a license, but is also less secure as clock can be easily manipulated, and updating everyone with monthly build would be quite a discouragement from participation in the project... Oh those trade-off...

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top