NET C#
Recently, the company requested the development of an authorization system for web projects. The demand is 1. After the project is deployed, it must be bound to the server. Prevent malicious deployments. 2. The tool can be specified for a specified period, and the web project exceeds the specified period and needs to be authorized by the tool to be used normally. 3. Authorize through authorization documents.
According to the requirements and the comparison of relevant encryption algorithms, it was decided to use RSA encryption for authorization. The following is the tool interface:
The idea of the tool is roughly as follows: 1. Pass. The RSA help class for .NET encapsulation generates public and private keys. 2. Generate a unique machine code string. 3. RSA encryption is carried out through the generated public key and machine code string, and a license file is formed. 4. Place the license file in the bin folder of the web project. 5. By judging whether to authorize the web project code, the code is as follows:
The tool can be used for web projects as well as Winform project authorization
Tourists, if you want to see the hidden content of this post, please Reply
|