An effective method for encrypting a license file?

前端 未结 9 1537
走了就别回头了
走了就别回头了 2021-01-29 18:58

For a web application, I would like to create a simple but effective licensing system. In C#, this is a little difficult, since my decryption method could be viewed by anyone wi

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-29 19:27

    RE: Do not include the whole key in your code. Use sn -p to extract the public part to a file. Use that in your code you distribute to verify the license.

    Using the code from the MSDN articles, I created a small app (LicMaker) to facilitate this. The app is signed with the full key pair. The input is an unsigned .XML license file. The output is the original XML + signature in a signed .LIC file. My product is also signed by the same full key pair file as well. The product verifies the .LIC file has not been tampered with. Works Great. I did not use sn -p for this solution.

提交回复
热议问题