如何生成序列号(注册号)?
如何生成用户可以用来注册应用程序的序列号?
我正在考虑以下场景:
- 用户尝试该应用程序。
- 当他们想要购买该应用程序时,他们会选择一个菜单项。
- 该应用程序生成一个代码,然后将该代码传递到网站以购买该应用程序。
- 用户输入从网站返回的代码。
- 应用程序用它生成的代码检查输入的代码。
如果用户丢失了序列号,或者在重新安装操作系统后复制了应用程序,他们将需要向网站提供代码,该网站将返回一个特殊代码,允许应用程序获取为用户计算机生成的原始代码。
How can I generate a serial number users can use to register an application?
I was thinking to the following scenario:
- Users try the application.
- When they want to buy the application, they select a menu item.
- The application generates a code that is then passed to the web site to buy the application.
- Users enter the code returned from the web site.
- The application checks the entered code with the code it generated.
If users lost the serial number, or copied the application after re-installing the OS, they would require the code to the website, which would return a special code that allow the application to get the original code generated for the users' machine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用非对称加密和散列来实现此目的:
You could use asymmetric encryption and hashing, to accomplish this:
有几个开源项目甚至不需要考虑这个问题。您可以专注于编写用户实际购买的商品。有一个名为 Aquatic Prime 的开源框架,用于生成序列号。有许多门户网站可以与 Aquatic Prime 配合使用,例如 Shine。
当有一个完美的解决方案时,我不喜欢写一些“新”的东西(特别是因为这些项目是免费的)
There are several open source projects out there that eliminate the need to even think about this. You can focus on writing what your user will actually purchase. There is an opensource framework called Aquatic Prime for generating serial numbers. There are many web portals that work with Aquatic Prime like Shine.
I dont like writing something "new" when there is a perfectly good solution out there (especially since these projects are free)