Authorization acquisition method, software authorization method, terminal equipment and storage medium
By generating an authorization verification file and using hash value calculations combined with user information and device hardware information to perform software authorization, the problem of high requirements for people and environment in existing software authorization control tools is solved, achieving higher security and wider applicability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2026-03-31
AI Technical Summary
Existing software licensing control measures have high requirements for people and the environment, low security, limited applicable scenarios, and pose a risk of leakage.
By generating an authorization verification file, software authorization is performed using hash value calculations combined with user information and device hardware information. The authorization verification file is then generated and verified on the software authorization terminal, avoiding hardware locks and network dependencies.
It improves the security and applicability of software licensing, reduces reliance on hardware and networks, and enhances the security and flexibility of software licensing.
Smart Images

Figure CN121765700A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software security control technology, and in particular to a method for obtaining authorization, a software authorization method, a terminal device, and a storage medium. Background Technology
[0002] The production process of medical consumables typically requires the burning of identification codes and other information onto the consumables. This process involves a PC-based software tool and a tool (which runs independent software that communicates with the consumables) to link to the specific consumable and complete the information burning. Once the software tool is released, the number of copies and installations is difficult to control, posing a significant security risk if leaked. Therefore, it is necessary to implement certain control measures for the authorized use of this software tool.
[0003] However, current licensing control measures for software tools have high requirements for people or the environment. For example, they require an internet connection or the installation of a hardware lock on the PC to license the software.
[0004] Therefore, how to improve the applicable scenarios and security of software licensing has become an urgent problem to be solved. Summary of the Invention
[0005] The main purpose of this application is to provide a method for obtaining authorization, a method for software authorization, a terminal device, and a storage medium, aiming to solve the technical problem of how to improve the applicability and security of software authorization.
[0006] To achieve the above objectives, this application proposes a method for obtaining authorization, which is applied to a software user terminal, and the method includes:
[0007] Obtain the current user information and device hardware information that initiated the authorization request;
[0008] A first hash value is generated based on the first feature string and the current user information;
[0009] A second hash value is generated based on the second feature string and the device hardware information;
[0010] An authorization verification file is generated based on the first hash value and the second hash value, and the authorization verification file is sent to the software authorization terminal so that the software authorization terminal can perform authorization verification based on the authorization verification file.
[0011] In one embodiment, the step of generating an authorization verification file based on the first hash value and the second hash value includes:
[0012] A third hash value is generated based on the first hash value, the second hash value, and the third feature string;
[0013] An authorization verification file is generated based on the first hash value, the second hash value, and the third hash value.
[0014] In one embodiment, the step of generating an authorization verification file based on the first hash value, the second hash value, and the third hash value includes:
[0015] Obtain the randomly generated initial license file;
[0016] The first hash value, the second hash value, and the third hash value are filled into the initial authorization file according to a preset offset allocation rule to obtain the authorization verification file.
[0017] In one embodiment, the step of filling the initial authorization file with the first hash value, the second hash value, and the third hash value according to a preset offset allocation rule to obtain the authorization verification file includes:
[0018] The mapping filling positions corresponding to the first hash value, the second hash value, and the third hash value are determined according to a preset mapping table;
[0019] The first hash value, the second hash value, and the third hash value are filled into the initial authorization file based on the mapping filling position to obtain the authorization verification file.
[0020] In one embodiment, the step of determining the mapping filling positions corresponding to the first hash value, the second hash value, and the third hash value according to a preset mapping table includes:
[0021] Get the current mapping identifier;
[0022] The mapping filling positions corresponding to the first hash value, the second hash value, and the third hash value are determined based on the current mapping identifier and the preset mapping table.
[0023] In one embodiment, the step of obtaining the current mapping identifier includes:
[0024] Obtain the current mapping index corresponding to the initial authorization file;
[0025] Perform stepwise offset mapping on the current mapping index to obtain intermediate mapping values;
[0026] Perform a verification operation on the intermediate mapping value to obtain the mapping verification value;
[0027] Perform a preset modulo operation on the mapping verification value to obtain the current mapping identifier.
[0028] In one embodiment, the step of filling the initial authorization file with the first hash value, the second hash value, and the third hash value based on the mapping filling position to obtain the authorization verification file includes:
[0029] Obtain the current offset identifier corresponding to the initial authorization file;
[0030] Perform a step-by-step offset mapping on the current offset identifier to obtain the filling offset;
[0031] The target filling position is determined based on the mapped filling position and the filling offset;
[0032] The first hash value, the second hash value, and the third hash value are filled into the initial authorization file according to the target filling position to obtain the authorization verification file.
[0033] Furthermore, to achieve the above objectives, this application also proposes a software licensing method, which is applied to a software licensing terminal, and the method includes:
[0034] Receive the authorization verification document described in any of the above items;
[0035] Parse the target user information and target hardware information from the authorization verification file;
[0036] Determine whether the target user information and the target hardware information match preset authorization conditions;
[0037] If so, then authorize the request.
[0038] In addition, to achieve the above objectives, this application also proposes a terminal device, the device comprising: a memory, a processor, and a program stored in the memory and executable on the processor, the program being configured to implement the steps of any of the methods described above.
[0039] In addition, to achieve the above objectives, this application also proposes a storage medium on which a program is stored, which, when executed by a processor, implements the steps of the method as described in any of the preceding claims.
[0040] This application provides a method for obtaining authorization, a software authorization method, a terminal device, and a storage medium. The method for obtaining authorization includes: receiving current user information and device hardware information sent by a software authorization terminal; generating a first hash value based on a first feature string and the current user information; generating a second hash value based on a second feature string and the device hardware information; generating an authorization verification file based on the first and second hash values; and sending the authorization verification file to the software authorization terminal so that the software authorization terminal can perform authorization verification based on the authorization verification file. Compared with existing software authorization methods that rely on manual control or hardware locks, this application can perform software authorization by generating an authorization file. This authorization verification file is generated based on user information and device hardware information through hash string operations, thereby improving the security of software authorization. Furthermore, compared with existing network control and hardware lock control methods, this application does not require additional network or hardware locks, expanding the applicable scenarios for software authorization. Attached Figure Description
[0041] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0042] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 This is a first flowchart illustrating the first embodiment of the method for obtaining authorization under this application;
[0044] Figure 2 This is a second flowchart illustrating the first embodiment of the method for obtaining authorization under this application;
[0045] Figure 3 This is a first flowchart illustrating the second embodiment of the method for obtaining authorization under this application;
[0046] Figure 4 This is a schematic diagram of the hash byte arrangement of the second embodiment of the method for obtaining authorization in this application;
[0047] Figure 5 This is a schematic diagram of the preset mapping table arrangement for the second embodiment of the method for obtaining authorization in this application;
[0048] Figure 6 This is a second flowchart illustrating a second embodiment of the method for obtaining authorization under this application;
[0049] Figure 7This is a schematic diagram of the initial license file layout structure of the second embodiment of the method for obtaining a license in this application;
[0050] Figure 8 This is a schematic diagram illustrating the process of generating the current mapping identifier in the second embodiment of the method for obtaining authorization in this application;
[0051] Figure 9 This is a schematic diagram illustrating the process of determining the fill offset in the second embodiment of the method for obtaining authorization under this application;
[0052] Figure 10 This is a schematic diagram of the module structure of the terminal device in an embodiment of this application.
[0053] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0054] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0055] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0056] The main solution of this application is: receiving current user information and device hardware information sent by the software authorization terminal; generating a first hash value based on a first feature string and the current user information; generating a second hash value based on a second feature string and the device hardware information; generating an authorization verification file based on the first hash value and the second hash value, and sending the authorization verification file to the software authorization terminal so that the software authorization terminal can perform authorization verification based on the authorization verification file.
[0057] Currently, there are three main methods for controlling the licensing of software tools:
[0058] 1) Manual control: The software tool is installed on a designated computer, which is then managed by a designated person. The disadvantage of this method is its high dependence on people and the environment, and the risk of leakage due to personnel turnover or management negligence.
[0059] 2) Network control: The software tool must connect to the internet and a server on the network to verify its identity before it can be used normally. The disadvantage is that it requires a network, a server, and corresponding network authentication services. Some production workshops may not have a network, or for management purposes, the computers in the production workshop cannot be connected to the network. Furthermore, connecting the software tool to the network could potentially lead to its leakage, posing a security risk.
[0060] 3) Hardware lock control: A hardware lock is inserted into the USB port of the device tool software. After the tool software starts, it reads the authorization information of the hardware lock and determines whether to start and run based on the authorization information. The disadvantage is that a hardware lock is required, but the hardware lock also has the risk of being lost and the problem of uncontrolled use.
[0061] Therefore, existing software authorization verification methods suffer from low security and limited applicability.
[0062] To address the aforementioned issues, this application first performs a hash operation on the requester's personal information (name or password) collected by the software user terminal, generating a first hash value based on the current user information and a randomly generated first characteristic string. Next, it performs a hash operation on the device hardware information collected by the software user terminal, generating a second hash value based on the device hardware information and a randomly generated second characteristic string. Finally, it generates an authorization verification file based on the current user information and device hardware information, and sends this file back to the software authorization terminal for software authorization verification. Therefore, this application can bind device characteristic information with the applicant's personal information during software authorization, making the authorization object both the device and the individual. Thus, even if the authorization verification software is copied to another device, software authorization cannot be performed. Furthermore, under the control of the requester's current user information, unauthorized personnel using the software authorization terminal will not result in uncontrolled use of the device software. Accidental password leaks can be corrected by changing the current user information to generate a new authorization verification file for re-authorization, thereby improving the security of software authorization.
[0063] Furthermore, since this application can directly use the authorization verification file stored in the software authorization terminal for software authorization verification, it saves on hardware components for hardware lock control, thus reducing costs. Moreover, this application does not require a network connection for authorization verification, saving server overhead and eliminating the need for manual control. Therefore, this application requires no additional network or hardware requirements, expanding the applicable scenarios for software authorization.
[0064] It is important to understand that the development environment for the PC-side tool software in this application can be Microsoft Visual Studio, the development language can be C#, and the authorization control technology originates from its internal string hashing method. This application uses a mapping and scattering insertion method to write hash values generated based on user information and device information into an authorization file to generate an authorization verification file, thereby achieving the goal of software authorization control based on the authorization verification file. The control process of using the authorization file can include three stages: requesting authorization, generating the authorization file, and using the authorization file. These three stages can be set on a single terminal or on different terminals or different terminal devices. When software authorization needs to be performed through different terminals, the software authorization process may involve two terminals. Specifically, the requesting authorization stage and the using the authorization file stage can be performed on the software authorization terminal, and the generating the authorization file stage can be performed on the software usage terminal.
[0065] It should be noted that the executing entity in this embodiment can be the aforementioned software user terminal, or a terminal device with data processing, network communication, program execution functions, and the ability to generate authorization verification files, such as a tablet computer, personal computer, or mobile phone. This embodiment does not specifically limit the type of device. The following description uses the software user terminal as the executing entity to illustrate this embodiment and the subsequent embodiments.
[0066] Based on this, the embodiments of this application provide a method for obtaining authorization, referring to... Figure 1 , Figure 1 This is a first flowchart illustrating the first embodiment of the method for obtaining authorization under this application.
[0067] In this embodiment, the method for obtaining authorization includes steps S10 to S40:
[0068] Step S10: Obtain the current user information and device hardware information that initiated the authorization request;
[0069] Step S20: Generate a first hash value based on the first feature string and the current user information;
[0070] Step S30: Generate a second hash value based on the second feature string and the device hardware information;
[0071] It should be noted that, in this embodiment, during the authorization file generation stage, the software terminal can receive the user's current user information and device hardware information when initiating the authorization request. The current user information may include the user's login name and password, while the device hardware information may include the CPU serial number, hard drive serial number, and motherboard MAC address corresponding to the device running the software tool (e.g., the software tool for burning information). Therefore, the software terminal can perform hash value calculations based on the current user information to generate a first hash value related to personal information, and generate a second hash value related to computer characteristic information based on the device hardware information.
[0072] Step S40: Generate an authorization verification file based on the first hash value and the second hash value, and send the authorization verification file to the software authorization terminal so that the software authorization terminal can perform authorization verification based on the authorization verification file.
[0073] It is easy to understand that the first hash value and the second hash value mentioned above can be a 32-bit value. In this embodiment, the software terminal can convert it into character form and save it to a file to generate an authorization verification file. The first feature string and the second feature string mentioned above can be randomly generated strings of any length (usually 20 characters are sufficient), used to obfuscate plaintext information. It should be understood that although the first feature string and the second feature string mentioned above are randomly generated strings, they still need to be saved in the authorization verification file after generation. The software authorization terminal must use the same strings for authorization verification when using the authorization verification file subsequently.
[0074] In this embodiment, compared with the existing manual control and hardware lock control methods, software authorization can be performed using an authorization file. This authorization file can be generated by hash string operation based on user information and device hardware information, thereby improving the security of software authorization. At the same time, compared with the existing network control and hardware lock control methods, this embodiment does not require an additional network or hardware lock. Software authorization verification can be performed simply by loading the authorization verification file in the software authorization terminal, thus expanding the applicable scenarios for software authorization.
[0075] In one feasible implementation, refer to Figure 2 , Figure 2 This is a second flowchart illustrating the first embodiment of the method for obtaining authorization under this application. In this embodiment, step S40 may include steps A1 to A2:
[0076] Step A1: Generate a third hash value based on the first hash value, the second hash value, and the third feature string;
[0077] Step A2: Generate an authorization verification file based on the first hash value, the second hash value, and the third hash value.
[0078] It is easy to understand that, in order to further improve the reliability of software licensing, in addition to the first and second hash values generated based on inherent information, this embodiment can also generate a third hash value based on the first hash value, the second hash value, and a randomly generated third feature string. Specifically, this application can concatenate the first hash value, the second hash value, and the randomly generated third feature string to generate a third hash value, and generate a fixed-size (e.g., 1MB) byte cache space filled with random data. Then, the first to third hash values generated above are filled into the byte cache space to generate the licensing verification file.
[0079] In this embodiment, an authorization verification file can be further generated based on the first hash value, the second hash value, and the third hash value, thereby further improving the software authorization security based on the randomly generated third feature string.
[0080] This embodiment provides an authorization acquisition method, which includes: acquiring current user information and device hardware information sent by a software authorization terminal; generating a first hash value based on a first feature string and the current user information; generating a second hash value based on a second feature string and the device hardware information; generating a third hash value based on the first hash value, the second hash value, and a third feature string; generating an authorization verification file based on the first hash value, the second hash value, and the third hash value; and sending the authorization verification file to the software authorization terminal so that the software authorization terminal can perform authorization verification based on the authorization verification file. Compared with existing software authorization methods that rely on manual control or hardware lock control, this embodiment uses an authorization file for software authorization. This authorization file can be generated by performing hash string operations based on user information and device hardware information, thereby improving the security of the authorization file. Furthermore, compared with network control and hardware lock control methods, this embodiment does not require additional network or hardware locks; software authorization verification can be performed simply by loading the authorization file into the device, expanding the applicable scenarios. In addition, this embodiment can further generate an authorization verification file based on the first hash value, the second hash value, and the third hash value, thereby further improving software authorization security based on a randomly generated third feature string.
[0081] Based on the first embodiment of this application, in the second embodiment of this application, the same or similar content as the first embodiment described above can be referred to the above description, and will not be repeated hereafter.
[0082] Based on the first embodiment, please refer to Figure 3 , Figure 3This is a first flowchart illustrating a second embodiment of the method for obtaining authorization under this application. In one feasible implementation, step A2 may include steps A21 to A22:
[0083] Step A21: Obtain the randomly generated initial license file;
[0084] Step A22: Fill the initial authorization file with the first hash value, the second hash value and the third hash value according to the preset offset allocation rule to obtain the authorization verification file.
[0085] It should be noted that the aforementioned initial authorization file can be a fixed-size byte cache space pre-filled with random numbers. In this embodiment, the software terminal can fill the generated first to third hash values into the initial authorization file according to a certain rule, namely the aforementioned preset offset allocation rule, to generate the authorization verification file. In this embodiment, after generating the third hash value, the software terminal can arrange the three hash values into a 12-byte row to form a hash string. The arrangement of this hash string can be as follows: Figure 4 As shown, Figure 4 This is a schematic diagram of the hash byte arrangement for a second embodiment of the method for obtaining authorization under this application. Figure 4 Each small square corresponds to a hash byte, and hash bytes of different colors represent different hash values. The software then uses a terminal to randomly fill the 12-byte hash bytes according to a preset offset allocation rule, thereby further enhancing the confidentiality and security of the authorization verification file that randomly fills the first to third hash values.
[0086] In one feasible implementation, step A22 may include steps B1 to B2:
[0087] Step B1: Determine the mapping filling positions corresponding to the first hash value, the second hash value, and the third hash value according to the preset mapping table;
[0088] It should be understood that this application can pre-set several mapping and filling methods with shuffled order for the first to third hash values, combine the several mapping and filling methods into the above-mentioned preset mapping table, and determine the actual mapping and filling positions corresponding to the first to third hash values according to the preset mapping table.
[0089] Therefore, in one feasible implementation, in this embodiment, step B1 may include steps B11 to B12:
[0090] Step B11: Obtain the current mapping identifier;
[0091] Step B12: Determine the mapping filling positions corresponding to the first hash value, the second hash value, and the third hash value based on the current mapping identifier and the preset mapping table.
[0092] It is easy to understand that the above-mentioned preset mapping table contains several mapping fill methods, and each mapping fill method has a corresponding mapping identifier. In practice, the software user terminal can determine the actual mapping fill method to be used based on the selected current mapping identifier. For ease of understanding, let's take... Figure 5 Let's take an example to illustrate this. Figure 5 This is a schematic diagram of the preset mapping table arrangement for the second embodiment of the method for obtaining authorization in this application. For example... Figure 5 As shown, since the first to third hash values mentioned above in this embodiment can be arranged into 12 bytes, the initial verification file can contain 12 data blocks to store each hash byte. Therefore, each mapping scheme in the preset mapping table can also contain 12 numbers from 0 to 11, corresponding to the 12 bytes representing the first to third hash values. These 12 numbers can be randomly shuffled and arranged in a row, thus forming a mapping filling scheme in the preset mapping table. Figure 5 The existence of mapping tables 0 to 15 indicates that... Figure 5 The preset mapping table shown can contain 16 mapping filling schemes.
[0093] Therefore, as Figure 5 As shown, the top row can be an arranged hash string (composed of the first, second, and third hash values), and below it can be 16 mapping filling methods. If the software uses the terminal to determine that the current mapping identifier is mapping table 0, then it can use... Figure 5 The mapping scheme corresponding to mapping table 0 determines the corresponding mapping and filling positions of each byte in the first to third hash values in the initial license file. Specifically, in the mapping and filling scheme corresponding to mapping table 0, the first byte of the first hash value is inserted into block 8, the second byte into block 3, the third byte into block 11, and the fourth byte into block 5; the first byte of the second hash value is inserted into block 2, the second byte into block 7, the third byte into block 10, and the fourth byte into block 0; the first byte of the third hash value is inserted into block 6, the second byte into block 4, the third byte into block 9, and the fourth byte into block 1. It is easy to understand that the specific mapping and filling positions of the first to third hash values for other mapping schemes can be deduced accordingly.
[0094] In one feasible implementation, refer to Figure 6 , Figure 6 This is a second flowchart illustrating a second embodiment of the method for obtaining authorization under this application. In this embodiment, step B11 may include steps B111 to B114:
[0095] Step B111: Obtain the current mapping index corresponding to the initial authorization file;
[0096] Step B112: Perform a step-by-step offset mapping on the current mapping index to obtain an intermediate mapping value;
[0097] Step B113: Perform a verification operation on the intermediate mapping value to obtain a mapping verification value;
[0098] Step B114: Perform a preset modulo operation on the mapping verification value to obtain the current mapping identifier.
[0099] It should be noted that although the initial license file is filled with random numbers, there may be a fixed cache space part in the initial license file to indicate the selection of the mapping scheme. The current mapping index can be determined based on the random numbers in this part, and thus the current mapping representation can be determined.
[0100] For ease of understanding, Figure 7 Let's take an example to illustrate this. Figure 7 This is a schematic diagram of the initial license file layout structure for a second embodiment of the method for obtaining a license under this application. (See diagram below.) Figure 7 As shown, in this embodiment, a pre-generated random initial license file (i.e. Figure 7 The space in the licence.dat file can be divided into 16 functional blocks. Blocks 0 to 11 can be used to store the 12 hash bytes corresponding to the first to third hash values, i.e., one hash byte is inserted into each block; block 14 can be used to determine the offset of the hash value insertion position from the corresponding block; block 15 can be used to determine which mapping table to use (i.e., mapping tables 0 to 15 in the preset mapping table). At this time, the software terminal can determine the current mapping index based on the data in block 15 of the initial license file. It is easy to understand that... Figure 7 The layout shown is only an illustrative layout of the functional blocks in the initial license file of this embodiment. This embodiment does not limit the specific arrangement of each functional block in the initial license file.
[0101] Specifically, with Figure 7 For example, in this embodiment, the values of index 0 and index 1 (i.e. the first and second bytes) in the 15th block of the initial authorization file can be used as the current mapping index. The current mapping index is then mapped and retrieved a certain number of times to obtain intermediate mapping values. Finally, the intermediate mapping values are checked and preset modulo operations are performed to obtain the final current mapping identifier.
[0102] In this embodiment, CRC checksum is preferred for verification to ensure data integrity and accuracy. The preset modulo operation can be determined based on the total number of mapping schemes stored in the preset mapping table. For example, if there are 16 mapping schemes in the preset mapping table, the software terminal can perform a modulo 16 operation on the mapping checksum; if there are 20 mapping schemes in the preset mapping table, the software terminal can perform a modulo 20 operation on the mapping checksum.
[0103] For ease of understanding, Figure 8 The process of obtaining the current mapping identifier in this embodiment will be illustrated by example. Figure 8 This is a schematic diagram illustrating the process of generating the current mapping identifier in the second embodiment of the method for obtaining authorization under this application. Assuming that the software uses the terminal to perform six mappings and value retrievals during the progressive offset mapping, the process for generating the current mapping identifier can be as follows:
[0104] Step 1: Take the current mapping index. Use the two bytes at index 0 and index 1 of block 15 of the initial license file to form a 16-bit value. This value can be the base of the progressive offset mapping. If the base value is 0, then use 0x5555 as the replacement base.
[0105] Step 2: First mapping and value retrieval. Take the base from step 1 as the offset within this block, and take the value at this address and the address before it to form a 16-bit value. This value is called the first mapping value.
[0106] Step 3: Second mapping and value retrieval. The mapping value from step 2 is used as the offset within this block. The value at this address and the address before it are combined to form a 16-bit value, which is called the second mapping value.
[0107] Step 4: Third mapping and value retrieval. The mapping value from step 3 is used as the offset within this block. The value at this address and the address before it are combined to form a 16-bit value, which is called the third mapping value.
[0108] Step 5: Fourth mapping and value retrieval. The mapping value from step 4 is used as the offset within this block. The value at this address and the address before it are combined to form a 16-bit value, which is called the fourth mapping value.
[0109] Step 6: 5th mapping and value retrieval. Take the mapping value from step 5 as the offset within this block, and take the value at this address and the address before it to form a 16-bit value. This value is called the 5th mapping value.
[0110] Step 7: 6th mapping and value retrieval. Take the mapping value from step 6 as the offset within this block, and take the value at this address and the address before it to form a 16-bit value. This value is called the 6th mapping value.
[0111] Step 8: Extract values. Combine the first, second, third, fourth, fifth, and sixth mapping values into a 12-byte row to obtain the intermediate mapping value.
[0112] Step 9: Calculate the check value of the mapped value row, and calculate the CRC16 value (x16+x15+x2+1) of the 12 bytes in Step 8;
[0113] Step 10: Count the mapping value. Divide the CRC16 value obtained in Step 9 by 16 and take the remainder (i.e., mapping value = CRC16 value mod 16) to obtain the selected mapping table value, which is the current mapping identifier mentioned above.
[0114] Step B2: Based on the mapping filling position, fill the first hash value, the second hash value, and the third hash value into the initial authorization file to obtain the authorization verification file.
[0115] It should be understood that this embodiment can initially obfuscate the block filling order of the first to third hash values based on a preset mapping table and the current mapping identifier, shuffling the order of each hash byte before filling it into each filling block in the hash value storage area of the initial authorization file. To further improve confidentiality, this embodiment can also make the filling position of the hash bytes within each filling block unfixed, performing random offset filling on the hash bytes within each filling block. Therefore, in a feasible implementation, step B2 in this embodiment may include steps B21 to B24:
[0116] Step B21: Obtain the current offset identifier corresponding to the initial authorization file;
[0117] Step B22: Perform a step-by-step offset mapping on the current offset identifier to obtain the filling offset;
[0118] Step B23: Determine the target filling position based on the mapped filling position and the filling offset;
[0119] Step B24: Fill the initial authorization file with the first hash value, the second hash value, and the third hash value according to the target filling position to obtain the authorization verification file.
[0120] It is easy to understand that in this embodiment, after determining the mapping filling position, the software can further determine the random offset of the hash value in each filling block, and then determine the final hash value filling method based on the determined filling offset and mapping filling position.
[0121] It is important to understand that, in combination Figure 7It is understood that the initial authorization file may also contain a cache space block containing a random number to determine the hash value insertion offset. The random number stored in this cache space block can be the aforementioned current offset identifier. In this embodiment, the padding offset corresponding to each hash byte can be obtained by performing a step-by-step offset mapping based on the current offset identifier.
[0122] For ease of understanding, Figure 9 The process of obtaining the fill offset in this embodiment will be illustrated by example. Figure 9 This is a schematic diagram illustrating the process of determining the filling offset in the second embodiment of the method for obtaining authorization under this application. Assuming that the software uses the terminal to perform three mappings and value retrievals in the progressive offset mapping of the current offset identifier, the process for generating the current mapping identifier can be as follows:
[0123] Step 1: Obtain the current offset identifier, and use the two bytes at index 0 and index 1 of block 14 of the initial license file to form a 16-bit value, which is called the base; if the base value is 0, then use 0xAAAA as the base;
[0124] Step 2: First mapping and value retrieval. Take the base from step 1 as the offset within this block, and take the value at this address and the address before it to form a 16-bit value. This value is called the first mapping value.
[0125] Step 3: Second mapping and value retrieval. The mapping value from step 2 is used as the offset within this block. The value at this address and the address before it are combined to form a 16-bit value, which is called the second mapping value.
[0126] Step 4: Third mapping and value retrieval. The mapping value from step 3 is used as the offset within this block. The value at this address and the address before it are combined to form a 16-bit value, which is called the third mapping value.
[0127] Step 5: Take the offset base address and use the mapping value obtained in step 4 as this value. If this value is less than 50, increase it by 50 as the offset base address.
[0128] Step 6: Calculate the actual offset address. Actual offset address = offset base address - 24;
[0129] Step 7: Take the actual offset. Take 24 consecutive bytes of data from the actual offset address in step 6 as the actual offset. Sequentially arrange two bytes to form a 16-bit offset value, resulting in a queue of 12 offsets, which is the padding offset mentioned above.
[0130] Understandably, this offset queue corresponds one-to-one with the hash value insertion block, that is, the 0th offset corresponds to the 0th block, the 1st offset corresponds to the 1st block, the 2nd offset corresponds to the 2nd block, and so on, so as to obtain the offset of the hash byte in all filling blocks inserted into the filling block. This allows the software to use the terminal to combine the initial mapped filling position and the filling offset to determine the final target filling position.
[0131] Therefore, the software terminal can ultimately determine the actual filling positions of the first hash value, second hash value, and third hash value into the initial authorization file based on the target filling position, and obtain the multi-encrypted authorization verification file.
[0132] In summary, this embodiment discloses a specific method for determining the actual filling positions of the first to third hash values. Specifically, this embodiment generates an authorization verification file based on a randomly generated initial authorization file and multiple random number mappings, resulting in a large amount of data in the final generated authorization verification file, strong randomness, and different data in each generated authorization verification file, making it difficult to crack and highly secure.
[0133] This embodiment obtains a randomly generated initial authorization file; obtains the current mapping index corresponding to the initial authorization file; performs a step-by-step offset mapping on the current mapping index to obtain an intermediate mapping value; performs a verification operation on the intermediate mapping value to obtain a mapping verification value; and performs a preset modulo operation on the mapping verification value to obtain the current mapping identifier. Based on the current mapping identifier and a preset mapping table, the mapping filling positions corresponding to the first hash value, the second hash value, and the third hash value are determined. The current offset identifier corresponding to the initial authorization file is obtained; a step-by-step offset mapping is performed on the current offset identifier to obtain a filling offset; the target filling position is determined based on the mapping filling position and the filling offset; and the first hash value, the second hash value, and the third hash value are filled into the initial authorization file according to the target filling position to obtain an authorization verification file. This embodiment discloses a specific method for determining the actual filling positions of the first to third hash values. That is, this embodiment can generate an authorization verification file based on a randomly generated initial authorization file and multiple random number mappings, resulting in a large data volume, strong randomness, and different data in each generated authorization verification file, making it difficult to crack and highly secure.
[0134] Based on the first and second embodiments of this application, in the third embodiment of this application, the same or similar content as in the first embodiment can be referred to the above description, and will not be repeated hereafter.
[0135] It should be noted that the executing entity in this embodiment can be the aforementioned software licensing terminal, or a terminal device with data processing, network communication, program execution functions, and software licensing verification capabilities, such as a tablet computer, personal computer, or mobile phone. This embodiment does not specifically limit the type of device. The following description uses a software licensing terminal as the executing entity to illustrate this embodiment and the subsequent embodiments.
[0136] Therefore, based on the first and second embodiments, a software licensing method is proposed. In this embodiment, the software licensing method is applied to a software licensing terminal, and the method includes steps C1 to C4:
[0137] Step C1: Receive the authorization verification file described in any of the above items;
[0138] Step C2: Parse the target user information and target hardware information from the authorization verification file;
[0139] Step C3: Determine whether the target user information and the target hardware information match the preset authorization conditions;
[0140] Step C4: If yes, then authorize the request.
[0141] Understandably, during the authorization request phase, the applicant can request authorization on the software terminal, and the applicant will enter the current user information accordingly. The software terminal will then generate an authorization request file based on the current user information and device hardware information, and send this file to the software authorization terminal. Then, during the authorization file usage phase, the software authorization terminal can parse the target user information and target hardware information in the authorization verification file, and match them with the data pre-stored in the database to perform authorization verification.
[0142] Specifically, in this embodiment, the software authorization terminal may have a preset database storing users and hardware that can use the software. The software authorization terminal can match the parsed target user information and target hardware information with the preset database. When both match successfully, it can determine that the preset authorization conditions are met, authorize the request, and allow the current request to use the software. Subsequently, when the applicant requests to use the device software, the software authorization terminal can verify the applicant's identity based on the authorization verification document.
[0143] It is easy to understand that only applicants who have completed the above authorization request steps can subsequently open the corresponding tool software on the software authorization terminal and perform corresponding operations (such as information burning) based on the generated authorization verification file. Software login users without the corresponding authorization verification file will only see prompts such as "unauthorized," "failed to start," or "cannot run normally" when they open the tool software on the software authorization terminal or other devices, and will not be able to perform related operations, thereby improving the security of software authorization.
[0144] It should be noted that when the software authorization terminal needs to verify the authorization of the software login user, the verification can be divided into two processes: first, opening the authorization verification software to verify its own authorization; and second, verifying the correctness of the login information entered by the software login user through the authorization verification file. Furthermore, it should be understood that this verification process requires the use of the first to third characteristic strings contained in the authorization file for authorization verification. The specific process of device software authorization verification is as follows:
[0145] 1) Verify whether the software authorization terminal is authorized:
[0146] It's easy to understand that, due to the security risk of software tools being easily copied, the software tool should first verify whether the software authorization terminal is authorized upon startup. Specifically, the software authorization terminal can first check whether the authorization verification file exists in the specified folder of the software tool when it is opened. If it does not exist, the software tool will display a message such as "Unauthorized, startup failed". If it exists, the authorization verification file will be opened and the first, second, and third hash values, as well as the first to third characteristic strings, will be read from the file.
[0147] Simultaneously, the software authorization terminal can read its own hardware information and calculate the hash value 2 corresponding to its CPU serial number + hard drive serial number + motherboard MAC address + second characteristic string. If the calculated hash value 2 matches the second hash value in the authorization verification file, the software authorization terminal verifies the information, and the login interface will be displayed in the tool software; otherwise, a pop-up window will display "Unauthorized, startup failed".
[0148] The steps for obtaining the first to third hash values in the authorization verification file during this process can be as follows:
[0149] Step 1: Obtain the current mapping identifier based on the data in block 15 of the authorization verification file;
[0150] Step 2: Determine the hash value offset based on the data in block 14 of the authorization verification file;
[0151] Step 3: Based on the offset obtained in Step 2, find the 12-byte hash value in blocks 0 to 11;
[0152] Step 4: Determine the specific mapping filling method based on the preset mapping table and the current mapping identifier determined in Step 1;
[0153] Step 5: Based on the mapping and filling method in Step 4, assemble the 12-byte hash value obtained in Step 3 into 3 hash values, corresponding to the first hash value, the second hash value, and the third hash value respectively.
[0154] 2) Verify that the login information is correct:
[0155] Once the authentication software successfully authorizes the terminal, it generates a hash value 1 based on the user's login information and the first characteristic string contained in the authentication file. Simultaneously, it performs a hash calculation using this hash value 1, the hash value 2 determined during the previous computer authentication step, and the third characteristic string from the authentication file to obtain a hash value 3. Finally, it compares hash value 1 with the first hash value, hash value 3 with the third hash value, to see if they are simultaneously equal. If they are equal, the authentication is successful and the operation interface is displayed; otherwise, it displays "Incorrect username or password." The authentication process ends after successful user login authentication.
[0156] Compared to existing software licensing methods that rely on manual control or hardware locks, this application allows for software licensing by generating a license file. This license verification file is generated through hash string operations based on user information and device hardware information, thereby improving the security of software licensing. Furthermore, compared to existing network control and hardware lock control methods, this application does not require additional network or hardware locks. Software licensing verification can be performed simply by loading the license verification file into the software licensing terminal, thus expanding the applicable scenarios for software licensing.
[0157] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the method of obtaining authorization for this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0158] This application also provides a terminal device, the device comprising: a memory, a processor, and a program stored in the memory and executable on the processor, the program being configured to implement the steps of any of the above-described methods for obtaining an authorization or software authorization.
[0159] The following is for reference. Figure 10The diagram illustrates a structural schematic of a terminal device suitable for implementing embodiments of this application. The terminal device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 10 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of embodiments one to three of this application.
[0160] like Figure 10 As shown, the terminal device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the terminal device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows terminal devices to communicate wirelessly or wiredly with other devices to exchange data. Although terminal devices with various systems are shown in the figures, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0161] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, Embodiments 1 and / or 2 of this application include a software licensed program product comprising a program carried on a computer-readable medium, the program containing program code for performing the methods shown in the flowcharts. In such embodiments, the program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the program is executed by processing device 1001, it performs the functions defined in the methods of Embodiments 1 and / or 2 of this application.
[0162] The terminal device provided in this application, employing the authorization acquisition method or software licensing method described in the above embodiments, can solve the technical problems of limited applicability scenarios and low security of software licensing. Compared with the prior art, the beneficial effects of the terminal device provided in this application are the same as those of the authorization acquisition method or software licensing method provided in the above embodiments, and other technical features in this terminal device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0163] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0164] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0165] This application also provides a storage medium storing a program, which, when executed by a processor, implements any of the steps of the above-described licensing method or software licensing method.
[0166] The storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0167] The aforementioned storage medium carries one or more programs. When these programs are executed by a software user terminal or a software licensing terminal, they enhance the security of software licensing and expand the applicable scenarios for software licensing.
[0168] Software licensed program code for performing the operations of this application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer may be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0169] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and software licensed product products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0170] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0171] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. An acquisition authorization method, characterized in that, The method is applied to a software use terminal, and the method comprises: obtaining current user information and device hardware information for initiating an authorization request; generating a first hash value according to a first feature string and the current user information; generating a second hash value based on a second feature string and the device hardware information; generating an authorization verification file according to the first hash value and the second hash value, and sending the authorization verification file to a software authorization terminal, so that the software authorization terminal performs authorization verification based on the authorization verification file.
2. The method of claim 1, wherein the authorization is obtained by, The step of generating an authorization verification file according to the first hash value and the second hash value comprises: generating a third hash value based on the first hash value, the second hash value and a third feature string; generating an authorization verification file according to the first hash value, the second hash value and the third hash value.
3. The method of claim 2, wherein the authorization is obtained by, The step of generating an authorization verification file according to the first hash value, the second hash value and the third hash value comprises: obtaining an initial authorization file generated randomly; filling the first hash value, the second hash value and the third hash value into the initial authorization file according to a preset offset allocation rule to obtain an authorization verification file.
4. The method of claim 3, wherein the authorization is obtained by, The step of filling the first hash value, the second hash value and the third hash value into the initial authorization file according to a preset offset allocation rule to obtain an authorization verification file comprises: determining a mapping filling position corresponding to the first hash value, the second hash value and the third hash value according to a preset mapping table; filling the first hash value, the second hash value and the third hash value into the initial authorization file based on the mapping filling position to obtain an authorization verification file.
5. The method of claim 4, wherein the authorization is obtained by, The step of determining a mapping filling position corresponding to the first hash value, the second hash value and the third hash value according to a preset mapping table comprises: obtaining a current mapping identifier; determining a mapping filling position corresponding to the first hash value, the second hash value and the third hash value according to the current mapping identifier and a preset mapping table.
6. The method of claim 5, wherein the authorization is obtained by, The step of obtaining a current mapping identifier comprises: obtaining a current mapping index corresponding to the initial authorization file; performing step-by-step offset mapping on the current mapping index to obtain an intermediate mapping value; performing a check operation on the intermediate mapping value to obtain a mapping check value; performing a preset remainder operation on the mapping check value to obtain a current mapping identifier.
7. The method of claim 6, wherein the authorization is obtained by, The step of filling the first hash value, the second hash value and the third hash value into the initial authorization file based on the mapping filling position to obtain an authorization verification file comprises: obtaining a current offset identifier corresponding to the initial authorization file; performing step-by-step offset mapping on the current offset identifier to obtain a filling offset; determining a target filling position based on the mapping filling position and the filling offset; filling the first hash value, the second hash value and the third hash value into the initial authorization file according to the target filling position to obtain an authorization verification file.
8. A software authorization method characterized by, The method is applied to a software authorization terminal, and the method comprises: receiving the authorization verification file according to any one of claims 1-7; The target user information and the target hardware information in the authorization verification file are parsed out; It is judged whether the target user information and the target hardware information match preset authorization conditions; If yes, the request is authorized.
9. A terminal device, comprising: The device comprises a memory, a processor, and a program stored on the memory and executable on the processor, and the program is configured to implement the steps of the method in any one of claims 1 to 7 or claim 8.
10. A storage medium, characterized by The storage medium has a program stored thereon, and the program is executed by a processor to implement the steps of the method in any one of claims 1 to 7 or claim 8.