Key algorithm and device for upper computer software permission verification
By using a key algorithm based on MAC address and hard disk serial number in the host computer software, binding the software to the hardware it runs, solving the problem that the existing technology cannot effectively prevent unauthorized copying of software and data leakage, which significantly improves the problem of Software security.
Patent Information
- Application Number
- CN202411591140.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-11
AI Technical Summary
The user management module of existing computer software cannot fully meet the software's security protection needs in special fields or scenarios, especially in preventing unauthorized replication and data leakage.
A key algorithm based on computer hardware to fix unique information MAC address and hard disk serial number is used to bind the software to the computer hardware it runs to generate a key file to verify software permissions.
Effectively prevent the software from being copied to unauthorized computers for use, enhance the software copyright and data protection capabilities, and improve the security of the host computer software.
Smart Images

Figure CN119416198A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of software permission verification, and in particular relates to a key algorithm and a device for upper computer software permission verification. Background Art
[0002] In computer host software development and design, in addition to developing functional performance that meets customer requirements, developers sometimes also need to consider the security of the software itself. Usually based on commercial competition protection or data information confidentiality requirements, developers or customers require that the software can be used normally among a restricted group of people within a restricted range.
[0003] Generally speaking, the above security requirements can be solved by designing a user management module in the upper computer software development and design. The user management module can restrict non-registered users from using and operating the software, and by setting different permission roles in the user management module, it can be used to limit the scope of use of software functions by users with different permissions, and prevent unauthorized operations by unrelated personnel from causing damage to equipment or data.
[0004] However, in some special fields or scenarios, a single user management function module cannot fully meet the security protection needs of the software. For example, developers worry that the software will be copied and used without authorization, causing certain economic losses. Or sometimes users worry that the software will be illegally obtained and analyzed and internal data or parameters will be extracted on other computers, which may cause serious data leakage and unimaginable consequences. A single user management method still has great risks. After all, the user's login password is in the hands of the individual, and the risk of illegal acquisition or accidental leakage is still very high. Summary of the invention
[0005] The present invention aims to solve the above-mentioned problem and provides a key algorithm and device for upper computer software permission verification.
[0006] In a first aspect, the present invention provides a key algorithm for upper computer software permission verification, comprising the following steps: Step 11: Obtain the MAC address and hard disk serial number of the target computer for key calculation; mark the obtained MAC address of the target computer as str_MAC, and the hard disk serial number as str_HDD; Step 12: Convert the obtained MAC address str_MAC and hard disk serial number str_HDD into ASCII characters, and convert all lowercase characters in the character string into uppercase characters to form a character string, which are marked as strCap_MAC and strCap_HDD respectively; Step 13: Convert the strCap_MAC and strCap_HDD strings into 8-bit unsigned arrays arr_MAC and arr_HDD respectively; Traverse the arrays arr_MAC and arr_HDD, subtract 65 from the values of the elements in the range [65:90], and add 48 to the corresponding array element number subtracted by 65, to form new arrays arrMAC_Key and arrHDD_Key; Then, for the arrays arrMAC_Key and arrHDD_Key, the values of the elements whose values are between [48:57] are subtracted by 48, and the other values remain unchanged, and are marked as arrNew_MAC and arrNew_HDD; Step 14: Convert the arrMAC_Key and arrHDD_Key arrays generated in step 13 into ASCII strings and mark them as strMAC_Key and strHDD_Key; Step 15: Generate two unsigned 8-bit integer arrays arrBaseMAC and arrBaseHDD, each containing 36 elements. The array element values are integers between 48 and 90, and the array elements are randomly arranged in an unordered manner. Convert the array into an ASCII string and mark it as strBaseMAC and strBaseHDD; Step 16: Use the numerical values of the arrNew_MAC and arrNew_HDD array elements to index the arrays arrBaseMAC and arrBaseHDD generated in step 15 to obtain two new arrays arrFunc_MAC and arrFunc_HDD respectively; then convert the two new arrays into ASCII strings and mark them as strFuncMAC and strFuncHDD respectively; Step 17: Connect the strings strMAC_Key, strBaseMAC, strFuncMAC related to the MAC address, and the strings strHDD_Key, strBaseHDD, strFuncHDD related to the hard disk serial number through "-" in a preset order to form a key string, and write the key string to a *.log file to form a key file of the target computer host software.
[0007] Furthermore, the key algorithm for upper computer software permission verification of the present invention obtains the hard disk serial number where the upper computer software is installed and the MAC address of the first physical network card when the target computer is installed with multiple network cards or hard disks.
[0008] Furthermore, the key algorithm for upper computer software authority verification described in the present invention, the upper computer software integrates a decoding module; the decoding module is used to read the running computer information and parse the key file.
[0009] Furthermore, the key algorithm for upper computer software permission verification of the present invention, the decoding module reads the running computer information and parses the key file, including the following steps: Step 21: Read the MAC address str_MAC and hard disk serial number str_HDD of the running computer; Step 22: Convert the MAC address str_MAC and the hard disk serial number str_HDD into ASCII characters, and convert all lowercase characters in the character string into uppercase characters to form a character string, marked as strCap_MAC and strCap_HDD; Step 23: Read the key file; decompose the key file string into 6 substrings according to the connector "-", and mark the specific string content according to the encoding order; including the three strings strHDD_Key, strBaseHDD, strFuncHDD contained in the hard disk serial number; the three strings strMAC_Key, strBaseMAC, strFuncMAC contained in the MAC address; Step 24: Convert the string data decomposed in step 23 into an 8-bit unsigned integer array, marked as arrHDD_Key, arrBaseHDD, arrFuncHDD; arrMAC_Key, arrBaseMAC, arrFuncMAC; Step 25: Subtract 48 from the values of the arrMAC_Key and arrHDD_Key array elements, and mark the results as arrMAC_NewKey and arrHDD_NewKey; Step 26: Use the values of arrFuncHDD and arrFuncMAC elements to index the arrays arrBaseMAC and arrBaseHDD, and add 48 to the indexed element values to mark them as arrNewFuncHDD and arrNewFuncMAC; Step 27: Reverse the one-dimensional arrays arrNewFuncHDD and arrNewFuncMAC obtained in step 26 and label them as arrPreFuncHDD and arrpreFuncMAC; Step 28: Use arrMAC_NewKey and arrHDD_NewKey array elements to index the arrpreFuncMAC and arrPreFuncHDD arrays respectively, add 17 to the indexed array element value and then replace the original array element, and mark the replaced arrpreFuncMAC and arrPreFuncHDD arrays as arrMAC and arrHDD respectively.
[0010] Step 29: Convert the arrays arrMAC and arrHDD decoded in step 28 into strings marked as str_MAC and str_HDD, thus completing the parsing of the key file.
[0011] In a second aspect, the present invention provides a key device for upper computer software permission verification, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to implement the key algorithm for upper computer software permission verification as described in the first aspect above when executing the computer program.
[0012] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the key algorithm for upper computer software authority verification as described in the first aspect above is implemented.
[0013] The key algorithm and device for upper computer software permission verification described in the present invention bind the software to the computer hardware on which it runs based on the key algorithm of the MAC address and the hard disk serial number, which are fixed unique information of the computer hardware, and strictly limit the scope of use of the software. This can effectively prevent the software from being copied to an unauthorized computer for use, avoid damage to the rights and interests of developers or users, and can significantly enhance the software copyright and data protection capabilities, thereby improving the security of the upper computer software. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 The figure is a schematic diagram of the upper computer software verification process described in an embodiment of the present invention. DETAILED DESCRIPTION
[0015] The key algorithm and device for upper computer software permission verification described in the present invention are described in detail below through the accompanying drawings and embodiments.
[0016] Embodiment 1 This embodiment discloses a key algorithm for upper computer software permission verification, including the following steps: Step 11: Obtain the MAC address and hard disk serial number of the target computer for key calculation; mark the obtained MAC address of the target computer as str_MAC, and the hard disk serial number as str_HDD; Step 12: Convert the obtained MAC address str_MAC and hard disk serial number str_HDD into ASCII characters, and convert all lowercase characters in the character string into uppercase characters to form a character string, which are marked as strCap_MAC and strCap_HDD respectively; Step 13: Convert the strCap_MAC and strCap_HDD strings into 8-bit unsigned arrays arr_MAC and arr_HDD respectively; Traverse the arrays arr_MAC and arr_HDD, subtract 65 from the values of the elements in the range [65:90], and add 48 to the corresponding array element number subtracted by 65, to form new arrays arrMAC_Key and arrHDD_Key; Then, for the arrays arrMAC_Key and arrHDD_Key, the values of the elements whose values are between [48:57] are subtracted by 48, and the other values remain unchanged, and are marked as arrNew_MAC and arrNew_HDD; Step 14: Convert the arrMAC_Key and arrHDD_Key arrays generated in step 13 into ASCII strings and mark them as strMAC_Key and strHDD_Key; Step 15: Generate two unsigned 8-bit integer arrays arrBaseMAC and arrBaseHDD, each containing 36 elements. The array element values are integers between 48 and 90, and the array elements are randomly arranged in an unordered manner. Convert the array into an ASCII string and mark it as strBaseMAC and strBaseHDD; Step 16: Use the numerical values of the arrNew_MAC and arrNew_HDD array elements to index the arrays arrBaseMAC and arrBaseHDD generated in step 15 to obtain two new arrays arrFunc_MAC and arrFunc_HDD respectively; then convert the two new arrays into ASCII strings and mark them as strFuncMAC and strFuncHDD respectively; Step 17: Connect the strings strMAC_Key, strBaseMAC, strFuncMAC related to the MAC address, and the strings strHDD_Key, strBaseHDD, strFuncHDD related to the hard disk serial number through "-" in a preset order to form a key string, and write the key string to a *.log file to form a key file of the target computer host software.
[0017] It should be noted that when the target computer is installed with multiple network cards or hard disks, the serial number of the hard disk where the host computer software is installed and the MAC address of the first physical network card are obtained.
[0018] In the disclosed embodiment, the host computer software integrates a decoding module; the decoding module is used to read the running computer information and parse the key file.
[0019] In the disclosed embodiment, the decoding module reads the running computer information and parses the key file including the following steps: Step 21: Read the MAC address str_MAC and hard disk serial number str_HDD of the running computer; Step 22: Convert the MAC address str_MAC and the hard disk serial number str_HDD into ASCII characters, and convert all lowercase characters in the character string into uppercase characters to form a character string, marked as strCap_MAC and strCap_HDD; Step 23: Read the key file; decompose the key file string into 6 substrings according to the connector "-", and mark the specific string content according to the encoding order; including the three strings strHDD_Key, strBaseHDD, strFuncHDD contained in the hard disk serial number; the three strings strMAC_Key, strBaseMAC, strFuncMAC contained in the MAC address; Step 24: Convert the string data decomposed in step 23 into an 8-bit unsigned integer array, marked as arrHDD_Key, arrBaseHDD, arrFuncHDD; arrMAC_Key, arrBaseMAC, arrFuncMAC; Step 25: Subtract 48 from the values of the arrMAC_Key and arrHDD_Key array elements, and mark the results as arrMAC_NewKey and arrHDD_NewKey; Step 26: Use the values of arrFuncHDD and arrFuncMAC elements to index the arrays arrBaseMAC and arrBaseHDD, and add 48 to the indexed element values to mark them as arrNewFuncHDD and arrNewFuncMAC; Step 27: Reverse the one-dimensional arrays arrNewFuncHDD and arrNewFuncMAC obtained in step 26 and label them as arrPreFuncHDD and arrpreFuncMAC; Step 28: Use arrMAC_NewKey and arrHDD_NewKey array elements to index the arrpreFuncMAC and arrPreFuncHDD arrays respectively, add 17 to the indexed array element value and then replace the original array element, and mark the replaced arrpreFuncMAC and arrPreFuncHDD arrays as arrMAC and arrHDD respectively.
[0020] Step 29: Convert the arrays arrMAC and arrHDD decoded in step 28 into strings marked as str_MAC and str_HDD, thus completing the parsing of the key file.
[0021] The key algorithm described in this embodiment can generate a key file based on the MAC address and hard disk serial number of the target computer. When designing the host computer software, a corresponding decoding module is added to verify the host computer software to verify whether the operating platform is safe. Figure 1 As shown, when the software is started, the key file is parsed to obtain the computer information required by the key file. If the parsed information is inconsistent with the computer information on which the software is actually running, the software operation is terminated immediately. If the information is consistent, the software is started and run normally, thereby achieving the purpose of protecting the software operating environment and preventing the software from being illegally copied and used.
[0022] In actual applications, the key generation host computer is installed and run on the developer's private confidential computer. It generates a key file based on the user's computer information and copies the key file to the user's computer through a mobile storage tool.
[0023] At the same time, when the network card or hard disk of the computer running the software is replaced, a new key file is generated through the new MAC address and hard disk serial number, and the old key file is replaced by the customer for normal use without modifying or changing the upper computer software. Strictly limiting the scope of use of the software can effectively prevent the software from being copied to unauthorized computers and avoid damage to the rights and interests of developers or users.
[0024] Embodiment 2 The present embodiment discloses a key device for upper computer software permission verification, including a memory and a processor; the memory is used to store a computer program; the processor is used to implement the key algorithm for upper computer software permission verification as described in the above-mentioned embodiment 1 when executing the computer program. The specific algorithm steps are the same as those in the above-mentioned embodiment 1 and will not be repeated here.
[0025] Embodiment 3 This embodiment discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, a key algorithm for upper computer software permission verification as described in the aforementioned embodiment 1 is implemented; the specific algorithm steps are the same as those in the aforementioned embodiment 1 and are not repeated here.
[0026] The computer described in the embodiment of the present application may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. The computer-readable storage medium may be any available medium that a computer can read or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital versatile disc (DVD)) or a semiconductor medium (e.g., a solid-state drive (SSD)), etc. The software formed by the computer storage code may be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, and other mature storage media in the art.
[0027] Each functional module in each embodiment of the present application can be integrated into a processing unit or module, or each module can exist physically separately, or two or more modules can be integrated into one unit or module. In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part.
[0028] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A key algorithm for upper computer software permission verification, characterized in that The following steps are involved: Step 11: Obtain the MAC address and hard disk serial number of the target computer for key calculation; mark the obtained MAC address of the target computer as str_MAC, and the hard disk serial number as str_HDD; Step 12: Convert the obtained MAC address str_MAC and hard disk serial number str_HDD into ASCII characters, and convert all lowercase characters in the character string into uppercase characters to form a character string, which are marked as strCap_MAC and strCap_HDD respectively; Step 13: Convert the strCap_MAC and strCap_HDD strings into 8-bit unsigned arrays arr_MAC and arr_HDD respectively; Traverse the arrays arr_MAC and arr_HDD, subtract 65 from the values of the elements in the range [65:90], and add 48 to the corresponding array element number subtracted by 65, to form new arrays arrMAC_Key and arrHDD_Key; Then, for the arrays arrMAC_Key and arrHDD_Key, the values of the elements whose values are between [48:57] are subtracted by 48, and the other values remain unchanged, and are marked as arrNew_MAC and arrNew_HDD; Step 14: Convert the arrMAC_Key and arrHDD_Key arrays generated in step 13 into ASCII strings and mark them as strMAC_Key and strHDD_Key; Step 15: Generate two unsigned 8-bit integer arrays arrBaseMAC and arrBaseHDD, each containing 36 elements. The values of the array elements are integers between 48 and 90, and the array elements are randomly arranged in an unordered manner. Convert the array into an ASCII string and mark it as strBaseMAC and strBaseHDD; Step 16: Use the numerical values of the arrNew_MAC and arrNew_HDD array elements to index the arrays arrBaseMAC and arrBaseHDD generated in step 15 to obtain two new arrays arrFunc_MAC and arrFunc_HDD respectively; then convert the two new arrays into ASCII strings and mark them as strFuncMAC and strFuncHDD respectively; Step 17: Connect the strings strMAC_Key, strBaseMAC, strFuncMAC related to the MAC address, and the strings strHDD_Key, strBaseHDD, strFuncHDD related to the hard disk serial number through "-" in a preset order to form a key string, and write the key string to a *.log file to form the key file of the target computer host software.
2. The key algorithm for upper computer software authority verification according to claim 1 is characterized in that: When the target computer is installed with multiple network cards or hard disks, the hard disk serial number where the host computer software is installed and the MAC address of the first physical network card are obtained.
3. The key algorithm for upper computer software authority verification according to claim 1 or 2 is characterized in that: The host computer software integrates a decoding module; the decoding module is used to read the running computer information and parse the key file.
4. The key algorithm for upper computer software authority verification according to claim 3 is characterized in that: The decoding module reads the running computer information and parses the key file, including the following steps: Step 21: Read the MAC address str_MAC and hard disk serial number str_HDD of the running computer; Step 22: Convert the MAC address str_MAC and the hard disk serial number str_HDD into ASCII characters, and convert all lowercase characters in the character string into uppercase characters to form a character string, marked as strCap_MAC and strCap_HDD; Step 23: Read the key file; decompose the key file string into 6 substrings according to the connector "-", and mark the specific string content according to the encoding order; including the three strings strHDD_Key, strBaseHDD, strFuncHDD contained in the hard disk serial number; the three strings strMAC_Key, strBaseMAC, strFuncMAC contained in the MAC address; Step 24: Convert the string data decomposed in step 23 into an 8-bit unsigned integer array, marked as arrHDD_Key, arrBaseHDD, arrFuncHDD; arrMAC_Key, arrBaseMAC, arrFuncMAC; Step 25: Subtract 48 from the values of the arrMAC_Key and arrHDD_Key array elements, and mark the results as arrMAC_NewKey and arrHDD_NewKey; Step 26: Use the values of arrFuncHDD and arrFuncMAC elements to index the arrays arrBaseMAC and arrBaseHDD, and add 48 to the indexed element values to mark them as arrNewFuncHDD and arrNewFuncMAC; Step 27: Reverse the one-dimensional arrays arrNewFuncHDD and arrNewFuncMAC obtained in step 26 and label them as arrPreFuncHDD and arrpreFuncMAC; Step 28: Use the arrMAC_NewKey and arrHDD_NewKey array elements to index the arrpreFuncMAC and arrPreFuncHDD arrays respectively, add 17 to the indexed array element value and then replace the original array element, and mark the replaced arrpreFuncMAC and arrPreFuncHDD arrays as arrMAC and arrHDD respectively; Step 29: Convert the arrays arrMAC and arrHDD decoded in step 28 into strings marked as str_MAC and str_HDD, thus completing the parsing of the key file.
5. A key device for upper computer software authority verification, characterized in that: It comprises a memory and a processor; the memory is used to store a computer program; the processor is used to implement the key algorithm for upper computer software authority verification as described in any one of claims 1-4 when executing the computer program.
6. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the key algorithm for upper computer software authority verification as described in any one of claims 1 to 4 is implemented.