简体   繁体   English

保护Winform应用程序/ Sql数据库免受复制

[英]Protect Winform Application/Sql Database From Copying

I am using c# (VS2010 FrameWork:v4.0) and SqlServer 2012 to build an application. 我正在使用c#(VS2010 FrameWork:v4.0)和SqlServer 2012构建应用程序。 I searched online to find ways to prevent copying this system and I thought the only part that needs to be protected from copying is the database. 我在网上搜索以查找防止复制该系统的方法,并且我认为需要保护以防止复制的唯一部分是数据库。

I would like you to provide me with some advises about the issue. 我希望您向我提供有关此问题的一些建议。 And I need answers/opinions about the following : 我需要有关以下方面的答案/意见:

  1. Do I need to protect also the application (executive file) from copying with the database? 我是否还需要保护应用程序(执行文件)以免与数据库一起复制? If yes, does this mean I have to provide the user with a new copy to install it if the user looses the application files? 如果是,这是否意味着如果用户丢失应用程序文件,我是否必须向用户提供一个新副本以进行安装?

  2. One Idea I have in my mind to protect the DB is to save some passwords/keys in DB (in the form of varbinary ) and when the device is logged in (runs the app) the application checks for (the MAC address ) of the device if it is not saved then the app asks for a key. 我想保护数据库的一个想法是在数据库中保存一些密码/密钥 (以varbinary的形式),当设备登录(运行应用程序)时,应用程序将检查数据库的( MAC地址 )设备(如果未保存),则应用会要求输入密钥。 once the key is used, the device mac address is saved with the key. 使用密钥后,设备的mac地址将与密钥一起保存。 Is this a right thing to do? 这是对的事吗? is there any advice about it? 有什么建议吗?

  3. If I need to protect the app part from copying, is there any idea how to do it? 如果我需要保护应用程序部分免受复制,是否有想法该怎么做?

  4. I have also read about installing SQLExpress on client PC and That should protect the DB files from manipulation, so I have to provide a way to upgrade/ update DB scripts in the future rather than replacing client's DB with a new one. 我还阅读了有关在客户端PC上安装SQLExpress的信息,这应该可以保护数据库文件免遭操纵,因此我必须提供一种在将来升级/更新数据库脚本的方法,而不是用新的脚本替换客户端的数据库。 And I thought to provide a form in the app protected by a password, and I can write a script in a textbox in the form (__For Example: Alter Proc_ ...), and Save it. 我想在应用程序中提供一个受密码保护的表单,并且我可以在表单中的文本框中编写脚本(例如,____:Alter Proc_ ...),然后保存它。 Can I do this? 我可以这样做吗? or would that be a stupid thing to do? 还是那是一件愚蠢的事情?

Thanks in advance 提前致谢

You cannot. 你不能。 Any claim to the contrary is snake oil. 任何相反的说法都是蛇油。

The only way to protect your application is to offer it as a service, hosted on hosts you own/control. 保护应用程序的唯一方法是将其作为服务提供,托管在您拥有/控制的主机上。

To find a way to prevent user from using APP+DB without my permission(for example registering using keys) 寻找一种防止用户未经我许可而使用APP + DB的方法(例如,使用密钥进行注册)

It is possible to create licensing schemes where the application runs only on the designated hardware. 可以创建许可方案,其中应用程序仅在指定的硬件上运行。 Your application takes the host fingerprint (eg. net MAC), uploads it to a service you host, you sign the fingerprint with a private key and provide the signature to the application, then the application validates the fingerprint signature using the embedded public key and runs the application. 您的应用程序将获取主机指纹(例如,net MAC),将其上传到您托管的服务,然后使用私钥对指纹进行签名,然后将签名提供给应用程序,然后应用程序将使用嵌入式公钥验证指纹运行该应用程序。 While this sounds doable, there is a number of ways this can and often does go wrong. 尽管这听起来可行,但是有很多方法可以做到,而且经常会出错。 Users change the fingerprint frequently (eg. hardware update). 用户经常更换指纹(例如,硬件更新)。 Fingerprints are difficult to enforce on virtualized environments (VMs can edit their MAC). 指纹很难在虚拟化环境中执行(VM可以编辑其MAC)。 It is very difficult to harden application code against a moderate hacker willing to attack and bypass your protection, and basically impossible to harden it against a skilled hacker. 针对愿意攻击并绕过您的保护的中度黑客来强化应用程序代码是非常困难的,而针对熟练的黑客则很难对其进行强化。

But you have also asked about the database and tagged the question sql-server . 但是您还询问了数据库,并标记了问题sql-server To that part I can only double down on my previous answer: It is impossible to protect a database against being accessed and/or modified by a on-site administrator, at will. 关于这一点,我只能加倍回答我以前的回答: 不可能保护数据库以防现场管理员随意访问和/或修改。 There are secure ways to audit access and modifications to the database, so you can prove tampering and act accordingly (refuse support or charge extra). 有一些安全的方法可以审核对数据库的访问和修改,因此您可以证明被篡改并采取相应的措施(拒绝支持或收取额外费用)。 But you cannot prevent it. 但是你不能阻止它。

Ultimately what you're asking for is DRM . 最终,您需要的是DRM

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用连接字符串从Winform应用程序连接到Godaddy中的SQL Server数据库 - How to connect to SQL Server database in Godaddy from a winform application using connection string Winform应用程序中的数据库安全 - Database Security in Winform application 如何使用sql所需的库发布数据库winform应用程序 - how to publish a database winform application with sql required libraries 具有Microsoft SQL Server数据库的C#Winform应用程序 - C# winform application with Microsoft SQL Server database 努力将记录从我的C#WinForm应用程序插入“ SQL Server Compact 4.0数据库”。 (我正在使用VS 2010) - Struggling to insert record into “SQL Server Compact 4.0 Database” from my C# WinForm Application. (I'm using VS 2010)) 从C#.NET Winform应用程序重新定位SQL Server中的查询 - Repitition of a query in sql server from C#.NET Winform application 从WinForm保存到数据库 - Saving to database from WinForm 从C#Winform锁定和解锁SQL数据库中的行 - Locking and unlocking rows in sql database from C# winform SQL Server数据库,WCF和WinForm - SQL Server database, wcf and WinForm 无法使用实体框架连接到 C# asp mvc 应用程序中的 Sql 数据库,但相同的代码适用于 Winform 应用程序 - Can not connect to Sql database in C# asp mvc application with Entity Framework BUT the same code works with Winform application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM