篡改强命名程序集有多难?
假设我有一个强命名的 .NET 程序集。只有我可以访问私钥。然后我将程序集分发到某个客户端系统。
客户修改程序集有多难?即:他们需要做什么来修改我的程序集?
Assume I have a .NET assembly which is strong named. Only I have access to the private key. I then distribute the assembly to some client system.
How hard is it for the client to modify the assembly? Ie: what would they need to do to modify my assembly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
强命名不会阻止修改程序集,但它确实可以防止引用强命名程序集的其他应用程序无意中使用修改后的版本。
Strong-naming does not prevent modifying the assembly, but it does prevent other applications which reference a strong-named assembly from inadvertently using a modified version.
这与修改非强类型程序集没有什么不同。唯一真正的区别是,他们必须运行强名称实用程序 (sn.exe) 才能使用修改后的程序集。
It's no different from modifying a non-strongly typed assembly. The only real difference is that they would have to run the strong name utility (sn.exe) in order to use the modified assembly.
正如其他人所说,这很容易。
您可以使用的一种技术是使用程序集的公钥(或令牌)来加密程序集中的重要信息(例如算法参数、连接字符串等)。这样,如果公钥已被更改或删除,解密将失败,并且您的程序集将不再正确运行。 Crypto Obfuscator 等混淆器使用此技术作为保护的一部分。
As others have said, its very easy.
One technique you can use is to use the public key (or token) of your assembly to encrypt important information (such as algorithm parameters, connection strings, etc) in your assembly. This way if the public key has been changed or removed, the decryption will fail and your assembly would no longer run correctly. Obfuscators such as Crypto Obfuscator use this technique as one part of the protection.