激活密钥保存在哪里

发布于 2024-08-03 07:03:58 字数 73 浏览 3 评论 0原文

我正在使用 C#,并且有一个用户输入的密钥来激活我的程序。我不希望用户在输入密钥后能够看到密钥。您对如何/在哪里存储它有什么建议吗?

I am using C# and have a key the users enters to activate my program. I do not want the user to be able to see the key once it is entered. Do you have any recommendations for how/where to store it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

2024-08-10 07:03:58

您可以将密钥保存为单独的文件。加密密钥并保存。因此,即使用户试图篡改它,您也可以停用该应用程序。

您可能对 codeplex 中的这个项目感兴趣: http://licenser.codeplex.com/

编辑:一些问题供您检查。

  1. 我应该在哪里存储我的激活密钥

  2. 生成软件激活码的最佳方法?

  3. .NET 应用程序的最佳激活密钥软件?

You can save the key as a seperate file. Encrypt the key and save it. So even if the user tries to tamper with it then you can deactivate the application.

You might be interested in this project in codeplex: http://licenser.codeplex.com/

Edit : Some questions for you to check.

  1. Where should I store my activation key

  2. Best way to generate activation codes for software?

  3. Best activation key software for .NET application?

樱娆 2024-08-10 07:03:58

您当然可以将密钥存储在可执行文件的资源中,其过程相当长,有几个可用的 API,如 OpenResource、GetResourceData 和 UpdateResource,除非您安装了 Visual Studio 工具,否则无法轻松访问资源。

但是您无法修改当前正在运行的可执行文件的资源,但您可以创建不同的激活程序来加载主可执行文件,修改资源并保存它。

You can certainly store a key in the resource of an Excutable, its quite long procedure, there are couple of APIs available like OpenResource, GetResourceData and UpdateResource, resources are not accessible easily unless you have visual studio tools installed.

But you cant modify the resources of the executable that is currently running, but you can create different activation program that can load your main executable, modify resource and save it.

弄潮 2024-08-10 07:03:58

假设 Windows 计算机正在运行您的应用程序,您还可以使用注册表来存储您的加密密钥(也许是 MD5?)。

这样它就不在用户可以查看的“文件”中(尽管用户可以查看/更改/删除它)。
在我看来,用户(标准用户......)往往不会查看注册表 - 您可以在那里隐藏您的密钥。

实际上,@Shoban 的第一个链接 where-should-i-store-my- applications-activation-key 关于这个问题有更多讨论 - 你应该阅读它......

Assuming a Windows machine is running your application, you can also use the registry to store your encrypted key (maybe MD5?).

That way it is not in a "file" that can be viewed by the user (although it can be viewed/changed/deleted by the user).
In my opinion users (standard ones...) tend not to look in the registry - you can hide your key there.

Actually, @Shoban's first link where-should-i-store-my-applications-activation-key has more discussion on this issue - you should read it...

友谊不毕业 2024-08-10 07:03:58

我知道它更像是加密密钥 - 但是 Windows 密钥容器 又如何呢?

I know it's more like for cryptographic keys - but what about windows key container?

烟火散人牵绊 2024-08-10 07:03:58

忘记试图掩盖您保存许可证密钥的位置 - 您将无法阻止确定的用户,并且如果您尝试将许可证信息存储在“奇怪”的地方,您只会惹恼系统管理员。忘记尝试存储在正在运行的可执行文件中的一切,这很难以万无一失的方式做到,并且会触发许多防病毒软件。

如果您想要防篡改的东西,请选择其中一种商业解决方案;很抱歉,如果这听起来很刺耳,但是考虑到您正在问这样的问题,您不会会想出任何难以破解的东西。

Forget about trying to obscure where you save the license key - you won't be able to stop determined users, and you'll only piss off sysadmins if you try to store license information in "strange" places. Forget everything about trying to store in your running executable, it's hard to do in a foolproof way, and will trigger a lot of antivirus software.

If you want something that's tamper-resistant, go for one of the commercial solutions; sorry if this sounds harsh, but you're not going to come up with anything that's even remotely difficult to break, considering you're asking a question like this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文