Simple implementation of shared software registration section

Source: Internet
Author: User

At present, many shareware use the registration code to achieve the protection of the software. A registration code is a set of strings that relate to specific information about the user, such as user name, computer hardware, and so on. Because the registration code is relatively simple to transmit and is easy to verify (relative to disk, CD-ROM, etc.), the registration code is now increasingly widely used, even some commercial software, such as Windows XP, uses a similar mechanism (Microsoft is called Windows Product activation).

When talking about the registration code, you must mention the Registrar. A registrar is a program used to generate a registration code, whose computational logic is usually consistent with a protected application. The registration number obtained by the same as the protected application, or by the predefined calculation logic, determines the behavior of the protected application, such as displaying "software is not registered", disabling certain features, or displaying the name of the registrant in the About dialog box, and so on.

Where the end user submits its registration information in some way, such as the name of his (or his organization), or even the extreme, provides some information that can determine someone's identity, such as the CPU ID of the Pentium III CPU, the serial number of the hard disk, the MAC address of the NIC, and so on. Then, the registry server, or the service person in the call center, calculates a registration number based on the information provided by the user and tells the end user.

In general, because human operations can cause errors, we want the registration process to be automatically implemented by the computer. But this poses a problem: why should users believe that our program does not disclose his personal privacy? In response to this problem, the current practice is to provide a number of options, including telephone registration, network registration, and the registration of ordinary mail, and so on, and the content of the program submitted to the user.

In addition, some information related to the user's computer, such as configuration and so on, should not be used in plaintext transmission. This is partly because the user may be unwilling to disclose this information to us, on the other hand, the transmission of information in clear text may result in the interception of information by third parties such as cracker. The current popular approach is to encode and then send the information that we do not need, but determine the identity of the user, using some sort of hashing algorithm. Of course, we can use SSL encryption in the process of sending, or some other methods to ensure security, due to the main content of this article is not closely related to this, the reader can refer to the relevant books.

User information that needs to be kept secret → hash Algorithm → secure transmission (e.g. SSL) → Server

In the author's personal experience, the calculation of registration code and verification of the registration code using different algorithms, to some extent, can improve the security of the registration process. Of course, any security measures can not be guaranteed not to be decrypted, "the world does not open the lock", decryption is only a matter of time, in the construction of the registration code algorithm, as long as the cost of decryption is greater than the value of software, do not have to do too complex.

As a user, he doesn't want to be too complicated, no matter what the registration method is. The way to register directly through a computer is undoubtedly the most convenient, but many users may be unwilling to do so. As a user, to register this way by telephone, to say their own registration ID (usually includes information such as Product ID, user's name, etc.), and enter the registration code should be the most troublesome type of registration.

The Registration ID and registration code should have the following characteristics:

(1) Easy to identify and input. The registration code is not a password, it is not necessary to use a large number of special symbols, case combination. Therefore, the registration code and the registration ID should not contain letters of different capitalization, as well as easily confusing numbers (1-i,0-o,2-z).

(2) with error-checking ability. Statistics show that when you enter the registration code, the wrong order (such as 1234 input into 1243), keystroke errors is the most common error. The more commonly used method is to divide the registration code into sections, each section includes a check code, so that the registration code has error-checking ability.

To reflect the above requirements, I have constructed an algorithm like this:

(1) Compute the user name entered and calculate and follow the following rules:

Set the result to be a, preset to 0

Sequentially takes the ASCII value of each character of the username string, multiplied by the upper number to a.

For example:

J a s o n L i

1 2 3 4 5 6 7 8

In this way, a= (char) ' J ' + ((char) ' a ') *2+ ((char) ' s ') *3+ ...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.