Secure algorithm for creating license keys?

后端 未结 2 1947
没有蜡笔的小新
没有蜡笔的小新 2020-12-13 04:45

I would like to distribute an application, but have license key that they can enter to unlock. What is a good algorithm to create a concise key that contains information ab

2条回答
  •  旧时难觅i
    2020-12-13 05:24

    You didn't say what platform you are on, but here's one in Microsoft .Net:

    Really Simple Licensing Scheme for .NET

    This page documents a very simple licensing scheme that you can use with your .NET application. It is intended to be fairly secure, easy to implement and easy to extend. The sample version allows you to provide license files with a client name embedded in them but you can easily extend it to add other identifying information, machine bindings, expiry dates, etc.

    This scheme makes use of Microsoft's RSA library and XML Signing. Basically you put whatever you want into an XML Document and sign that document. Then you can provide that file to your customer and the application can read the license information out of that file. Since the file is digitally signed the license file can NOT be tampered with unless you release your private key (which you really shouldn't do).

提交回复
热议问题