A software authorization method, system and storage medium
By using RSA keys to sign and obfuscate device and authorization information to generate an authorization file, and then verifying its legality through an authentication module, the security and cost issues of existing software authorization methods are resolved, achieving flexibility and security for offline authorization.
Patent Information
- Application Number
- CN202111283781.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-01
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2041-11-01
AI Technical Summary
Existing software licensing methods suffer from poor security, are unsuitable for devices without key input or interfaces, are costly, and cannot achieve offline licensing.
The device information and authorization information are signed and obfuscated using an RSA key to generate an authorization file. The authorization file is then verified for legality and legitimacy through an authentication module, enabling offline authorization.
It improves the security of software licensing, reduces the cost for users to enter activation codes, simplifies server maintenance, is suitable for devices without key input or interface, supports offline licensing, and reduces reliance on hardware.
Smart Images

Figure CN113987421B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of software licensing technology, and in particular to a software licensing method, system and storage medium. Background Technology
[0002] With the development of the times and the innovation of technology, investment in software research and development is increasing day by day. However, cases of unauthorized use of software after its launch occur frequently, causing losses to software developers. To avoid this situation, it is particularly important to strengthen the management of software usage rights. Currently, traditional software licensing methods include software activation codes, online registration, and dongles. However, software activation codes often only authorize a single device, requiring users to manually enter the activation code (serial number), which is not suitable for devices without key input or a user interface. Moreover, activation codes are easily leaked, resulting in poor security. Online registration is a more ideal method, but it only supports online authorization and does not support offline authorization. Furthermore, the development and continuous maintenance of the authorization server requires high costs. Dongles are relatively more ideal than software activation codes, but they require hardware support and are not compatible with most embedded devices.
[0003] The above problems urgently need to be solved. Summary of the Invention
[0004] To address the related technical problems, this invention provides a software licensing method, system, and storage medium to resolve the issues mentioned in the background section above.
[0005] To achieve the above objectives, the embodiments of the present invention adopt the following technical solutions:
[0006] In a first aspect, embodiments of the present invention provide a software licensing method, comprising the following steps:
[0007] S101. The software licensor receives device information collected by the device manufacturer;
[0008] S102. The software licensor generates an authorization file based on the received device information and corresponding authorization information;
[0009] S103. The software licensor returns the license file and software version to the equipment manufacturer;
[0010] S104. The equipment manufacturer integrates the software version and places the license file as required;
[0011] S105. After the device is running, the software loads the authentication module and performs authorization verification. If the verification is successful, the device will run normally; otherwise, it will stop running.
[0012] Furthermore, step S102 specifically includes:
[0013] S1021. Import / enter license application information and initialize the license file simultaneously;
[0014] S1022. Parse the application information, including but not limited to device information and authorization information, and fill the device information into DEVICE INFO and the authorization information into LICENCE INFO;
[0015] S1023. Generate an RSA key pair;
[0016] S1024. Perform SHA256 calculation on DEVICE INFO and LICENCE INFO, then sign the SHA256 value using the RSA private key and fill it into LICENCE HASH;
[0017] S1025. Modify the RSA public key, perform obfuscation encryption, and then enter the LICENCE KEY;
[0018] S1026. Fill in the instructions in README;
[0019] S1027. Output the license file.
[0020] Furthermore, in step S105, the software loads the authentication module and performs authorization verification, including:
[0021] S1051. Authentication module legality verification;
[0022] S1052. Verification of the validity of the authorization document.
[0023] Furthermore, the authentication module's legality verification in step S1051 specifically includes:
[0024] S10511. Start the software;
[0025] S10512. Proceed to the authorization check process;
[0026] S10513. Generate random code;
[0027] S10514. Call the authentication module initialization interface, that is: transmit the version number of the authentication module corresponding to the current software and the generated random code to the authentication module;
[0028] S10515. The authentication module checks the version number transmitted by the software, extracts and restores the corresponding version's RSA private key;
[0029] S10516. The authentication module uses the RSA private key to sign the random code;
[0030] S10517. The authentication module returns the signature result to the software;
[0031] S10518. The software uses a preset RSA public key to verify the signature result returned by the authentication module. If the verification passes, the software performs a validity check on the authorization file; otherwise, the software considers the authentication module to be invalid and returns an error.
[0032] Furthermore, the authorization document validity verification in step S1052 specifically includes:
[0033] S10521. The authentication module performs a validity check on the authorization file and parses the authorization file;
[0034] S10522. The authentication module returns the result of parsing the authorization file to the software;
[0035] S10523. The software performs information retrieval and validity checks on the information in the parsing results, and returns the final check results to the software;
[0036] S10524. The software decides whether to continue running based on the authentication result.
[0037] Furthermore, the equipment information collected by the equipment manufacturer in step S101 includes, but is not limited to, equipment model, manufacturer information, and network card physical address.
[0038] Furthermore, the authorization information in step S102 includes, but is not limited to, the authorization method selected according to the authorization agreement and the authorization validity period; wherein, the authorization method selected according to the authorization agreement includes, but is not limited to, batch authorization based on device model or single authorization based on network card physical address.
[0039] Secondly, embodiments of the present invention also provide a software licensing system, comprising:
[0040] The equipment information collection unit is used by the software licensor to receive equipment information collected by the equipment manufacturer.
[0041] The authorization file generation unit is used by the software licensor to generate an authorization file based on the received device information and corresponding authorization information;
[0042] The authorization file sending unit is used by the software licensor to return the authorization file and software version to the device manufacturer.
[0043] The license file integration unit is used by equipment manufacturers to integrate the software version and place the license file as required.
[0044] The authorization verification unit is used to perform authorization verification after the device is running. If the verification is successful, the device will run normally; otherwise, it will stop running.
[0045] Furthermore, the authorization verification unit includes:
[0046] The authentication module verification unit is used to verify whether the authentication module is legitimate.
[0047] The license file verification unit is used to verify whether the license file is valid.
[0048] Thirdly, embodiments of the present invention further provide a storage medium on which a computer program is stored, wherein the program, when executed by a processor, implements the above-described software licensing method.
[0049] Compared with existing technologies, the technical solutions of this invention have the following advantages: 1. The authorization file can be pre-set, eliminating the need for users to manually enter activation codes. This method is more suitable for devices without key input or interfaces, simplifies the activation code input process, improves user experience, and reduces user costs. 2. Offline authorization: Compared with online authorization, it simplifies the authorization server process, reduces server development and maintenance costs, and is cost-effective. 3. Flexible authorization methods and usage scenarios: Batch authorization can be performed on device models, manufacturers, software versions, etc., or individual authorization can be performed on chip IDs, network card addresses, etc. of individual devices. 4. Multiple signature verifications (authorization file legality verification, authentication module legality verification) and multiple encryption algorithms (RSA, SHA, obfuscation encryption) are used in authorization and authentication, making it difficult to crack and highly secure. The technical solutions of this invention revolutionize the authorization method for software, especially embedded terminal software. While increasing the cost of software cracking and ensuring software security, it reduces dependence on servers and hardware, saves R&D costs, and is suitable for widespread application. Attached Figure Description
[0050] To more clearly illustrate and understand the technical solutions in the embodiments of the present invention, the accompanying drawings used in the background technology and embodiment descriptions of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the content of the embodiments of the present invention and these drawings without creative effort.
[0051] Figure 1 This is a schematic diagram of the software licensing method provided in Embodiment 1 of the present invention;
[0052] Figure 2 This is a schematic diagram of the authorization file generation process in the software authorization method provided in Embodiment 2 of the present invention;
[0053] Figure 3 This is a schematic diagram of the authorization file verification process in the software authorization method provided in Embodiment 3 of the present invention;
[0054] Figure 4 This is a block diagram of the software licensing system provided in Embodiment 4 of the present invention;
[0055] Figure 5 This is a block diagram of the software licensing system provided in Embodiment 5 of the present invention. Detailed Implementation
[0056] To make the technical problems solved by the present invention, the technical solutions adopted, and the technical effects achieved clearer, the technical solutions of the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] Example 1
[0058] like Figure 1 As shown, Figure 1 This is a schematic diagram of the software licensing method provided in Embodiment 1 of the present invention.
[0059] The software licensing method in this embodiment includes the following steps:
[0060] S101. The software licensor receives device information collected by the device manufacturer;
[0061] S102. The software licensor generates an authorization file based on the received device information and corresponding authorization information;
[0062] S103. The software licensor returns the license file and software version to the equipment manufacturer;
[0063] S104. The equipment manufacturer integrates the software version and places the license file as required;
[0064] S105. After the device starts running, the software loads the authentication module and performs authorization verification. If the verification passes, the device runs normally; otherwise, it stops running. It should be noted that in this embodiment, the preferred setting after the device starts running is to select automatic loading of the authentication module by the software, but it is not limited to this mode. The user can also manually load the authentication module for authorization verification.
[0065] Exemplarily, before step S101 in this embodiment, it further includes: the device manufacturer collects device information; wherein, the device information includes but is not limited to device model, manufacturer information, network card physical address, etc., and it is required that such information can be read out through a standard API (Application Programming Interface), and the read value needs to be consistent with the value displayed on the device interface.
[0066] Exemplarily, in this embodiment, the device manufacturer fills in the device information into the application file template and then submits it to the software licensor. Exemplarily, in this embodiment, the authorization information includes but is not limited to the authorization method and authorization validity period selected by the software licensor according to the authorization agreement; wherein, the authorization method selected according to the authorization agreement includes but is not limited to batch authorization according to the device model, or single authorization according to the network card physical address, etc. Finally, the software licensor selects different authorization methods according to the authorization agreement, such as batch authorization according to the device model, or single authorization according to the network card physical address, and combines the authorization validity period limit to generate one or more authorization files.
[0067] In the technical solution of the embodiment of the present invention, the authorization file can be pre-set, and after pre-setting, there is no need for the user to manually input the activation code. This method is more suitable for devices without button input or interface on the one hand, and simplifies the process of inputting the activation code on the other hand, improving the user experience and reducing the user's usage cost; the technical solution of the embodiment of the present invention adopts an offline authorization method, which simplifies the authorization server link compared with online authorization, reduces the development and maintenance costs of the server, and has low costs; the technical solution of the embodiment of the present invention has flexible authorization methods and usage scenarios; it can perform batch authorization on device models, manufacturers, software versions, etc., and can also perform individual authorization on the chip ID, network card address, etc. of a single device. The technical solution of the embodiment of the present invention realizes the innovation of the software authorization method, especially for embedded terminal software. While increasing the cost of software cracking and ensuring software security, it reduces the dependence on the server and hardware, saves R & D costs, and is suitable for popularization and application.
[0068] Embodiment Two
[0069] The software authorization method in this embodiment includes the following steps:
[0070] S201. The software licensor receives the device information collected by the device manufacturer;
[0071] S202. The software licensor generates an authorization file according to the received device information and the corresponding authorization information;
[0072] S203. The software licensor returns the authorization file and the software version to the device manufacturer;
[0073] S204. The equipment manufacturer integrates the software version and places the license file as required;
[0074] S205. After the device starts running, the software loads the authentication module and performs authorization verification. If the verification passes, the device runs normally; otherwise, it stops running. It should be noted that in this embodiment, the preferred setting after the device starts running is to select automatic loading of the authentication module by the software, but it is not limited to this mode. The user can also manually load the authentication module for authorization verification.
[0075] For example, in this embodiment, before step S201, the method further includes: the device manufacturer collecting device information; wherein, the device information includes, but is not limited to, device model, manufacturer information, network card physical address, etc., and such information is required to be readable through a standard API (Application Programming Interface), and the read value needs to be consistent with the value displayed on the device interface.
[0076] For example, in this embodiment, the device manufacturer fills in the device information into the application document template and submits it to the software licensor. For example, the authorization information in this embodiment includes, but is not limited to, the authorization method and authorization validity period selected by the software licensor according to the authorization agreement; wherein, the authorization method selected according to the authorization agreement includes, but is not limited to, batch authorization based on device model, or single authorization based on network interface card (NIC) physical address, etc. Finally, the software licensor selects different authorization methods according to the authorization agreement, such as batch authorization based on device model, or single authorization based on NIC physical address, and generates one or more authorization files in conjunction with the authorization validity period limit.
[0077] For example, in this embodiment, as Figure 2 As shown, step S202 specifically includes:
[0078] S2021. Import / enter license request information and initialize the license file simultaneously;
[0079] S2022. Parse the application information, including but not limited to device information and authorization information, and fill the device information into DEVICE INFO and the authorization information into LICENCE INFO;
[0080] S2023. Generate an RSA (1024-bit, PKCS#8) key pair;
[0081] S2024. Perform SHA256 calculation on DEVICE INFO and LICENCE INFO, then sign the SHA256 value using the RSA private key and fill it into LICENCE HASH;
[0082] S2025. Modify the RSA public key, perform obfuscation encryption, and then fill in the LICENCE KEY. Among them, modifying the RSA public key in this embodiment specifically includes: modifying the RSA public key according to the agreed rules, that is, replacing, modifying or obfuscating some characters in the public key, and protecting the modification process by using the characteristics that are difficult to decompile with programming languages:
[0083] S2026. Fill in the description content into README.
[0084] S2027. Output the authorization file.
[0085] In the technical solution of the embodiment of the present invention, multiple encryption algorithms such as RSA, SHA, and obfuscation encryption are used in the process of generating the authorization file, which is not easy to crack and has high security. In the technical solution of the embodiment of the present invention, the authorization file can be pre-set, and after pre-setting, the user does not need to manually input the activation code. On the one hand, this method is more suitable for devices without button input or interface. On the other hand, it simplifies the process of inputting the activation code, improves the user experience, and reduces the user's usage cost. The technical solution of the embodiment of the present invention adopts an offline authorization method. Compared with online authorization, it simplifies the authorization server link, reduces the development and maintenance costs of the server, and has low costs. The technical solution of the embodiment of the present invention has flexible authorization methods and usage scenarios. It can perform batch authorization on device models, manufacturers, software versions, etc., and can also perform individual authorization on the chip ID, network card address, etc. of a single device. The technical solution of the embodiment of the present invention realizes the innovation of the software authorization method, especially for embedded terminal software. While increasing the software cracking cost and ensuring software security, it reduces the dependence on the server and hardware, saves R & D costs, and is suitable for popularization and application.
[0086] Embodiment Three
[0087] The software authorization method in this embodiment includes the following steps:
[0088] S301. The software authorizer receives the device information collected by the device manufacturer.
[0089] S302. The software authorizer generates an authorization file according to the received device information and the corresponding authorization information.
[0090] S303. The software authorizer returns the authorization file and the software version to the device manufacturer.
[0091] S304. The device manufacturer integrates the software version as required and places the authorization file.
[0092] S305. After the device starts running, the software loads the authentication module and performs authorization verification. If the verification passes, the device runs normally; otherwise, it stops running. It should be noted that in this embodiment, the preferred setting after the device starts running is to select automatic loading of the authentication module by the software, but it is not limited to this mode. The user can also manually load the authentication module for authorization verification.
[0093] For example, in this embodiment, before step S301, the method further includes: the device manufacturer collecting device information; wherein, the device information includes, but is not limited to, device model, manufacturer information, network card physical address, etc., and such information is required to be readable through a standard API (Application Programming Interface), and the read value needs to be consistent with the value displayed on the device interface.
[0094] For example, in this embodiment, the device manufacturer fills in the device information into the application document template and submits it to the software licensor. For example, the authorization information in this embodiment includes, but is not limited to, the authorization method and authorization validity period selected by the software licensor according to the authorization agreement; wherein, the authorization method selected according to the authorization agreement includes, but is not limited to, batch authorization based on device model, or single authorization based on network interface card (NIC) physical address, etc. Finally, the software licensor selects different authorization methods according to the authorization agreement, such as batch authorization based on device model, or single authorization based on NIC physical address, and generates one or more authorization files in conjunction with the authorization validity period limit.
[0095] For example, in this embodiment, as Figure 2 As shown, step S302 specifically includes:
[0096] S3021. Import / enter license request information and initialize the license file simultaneously;
[0097] S3022. Parse the application information, including but not limited to device information and authorization information, and fill the device information into DEVICE INFO and the authorization information into LICENCE INFO;
[0098] S3023. Generate an RSA key pair;
[0099] S3024. Perform SHA256 calculation on DEVICE INFO and LICENCE INFO, then sign the SHA256 value using the RSA private key and fill it into LICENCE HASH;
[0100] S3025. Modify the RSA public key, perform obfuscation encryption, and then fill in the LICENCE KEY; wherein, in this embodiment, modifying the RSA public key specifically includes: modifying the RSA public key according to the agreed rules, that is, replacing, modifying, or obfuscating certain characters in the public key, and protecting the modification process by taking advantage of the characteristics of programming languages that are difficult to decompile;
[0101] S3026. Fill in the instructions in README;
[0102] S3027. Output the license file.
[0103] For example, in this embodiment, step S305, where the software loads the authentication module and performs authorization verification, includes: S1051. Authentication module validity verification; S1052. Authorization file validity verification. For example, in this embodiment... Figure 3 As shown, the authentication module's legality verification in step S3051 specifically includes:
[0104] S30511. Start the software;
[0105] S30512. Enter the authorization check process;
[0106] S30513. Generate random code;
[0107] S30514. Call the authentication module initialization interface, that is: transmit the version number of the authentication module corresponding to the current software and the generated random code to the authentication module;
[0108] S30515. The authentication module checks the version number transmitted by the software, extracts and restores the corresponding version's RSA private key;
[0109] S30516. The authentication module uses the RSA private key to sign the random code;
[0110] S30517. The authentication module returns the signature result to the software;
[0111] S30518. The software uses a preset RSA public key to verify the signature result returned by the authentication module. If the verification passes, the software performs a validity check on the authorization file; otherwise, the software considers the authentication module to be invalid and returns an error.
[0112] For example, in this embodiment, the authorization file validity verification in step S3052 specifically includes:
[0113] The authentication module checks the legality of the authorization file and parses the authorization file; among them, the "legality check" includes checking whether the file content is complete, whether the content format conforms, calculating the hash of the authorization-related content, and then using the RSA key to verify the hash result to determine whether the authorization-related content has been tampered with. After the legality check passes, the authorization file is parsed;
[0114] The authentication module returns the result of parsing the authorization file to the software;
[0115] Exemplarily, in this embodiment, the authentication module returns the result of parsing the authorization file to the software, specifically including: the authentication module returns the result of parsing the authorization file to the software in a predefined format, where "returning to the software in a predefined format" includes assembling and returning device information, module name, expiration date, etc. in the format of json or xml to the software;
[0116] The software performs information retrieval and validity check on the information in the parsing result and returns the final check result to the software;
[0117] Exemplarily, in this embodiment, the information in the parsing result includes but is not limited to authorization status code, authorization date and other information.
[0118] The software decides whether to continue running according to the authentication result.
[0119] In the technical solution of the embodiment of the present invention, multiple encryption algorithms such as RSA, SHA, and confusion encryption are used in the process of generating the authorization file; multiple signature verifications are used in the process of verifying the legality of the authorization file and the authentication module, which is not easy to crack and has high security. In the technical solution of the embodiment of the present invention, the authorization file can be pre-set, and after pre-setting, there is no need for the user to manually input the activation code. This method is more suitable for devices without button input or interface on the one hand, and simplifies the process of inputting the activation code on the other hand, improving the user experience and reducing the user's usage cost; the technical solution of the embodiment of the present invention adopts an offline authorization method, which simplifies the authorization server link compared with online authorization, reduces the development and maintenance costs of the server, and has low cost; the technical solution of the embodiment of the present invention has flexible authorization methods and usage scenarios; it can perform batch authorization on device models, manufacturers, software versions, etc., and can also perform individual authorization on the chip ID, network card address, etc. of a single device. The technical solution of the embodiment of the present invention realizes the innovation of the authorization method for software, especially for embedded terminal software. While increasing the cost of software cracking and ensuring software security, it reduces the dependence on the server and hardware, saves R & D costs, and is suitable for popularization and application.
[0120] Embodiment Four
[0121] like Figure 4 As shown, Figure 4 This is a structural block diagram of the software licensing system 400 provided in Embodiment 4 of the present invention.
[0122] In this embodiment, the software licensing system 400 includes:
[0123] The equipment information acquisition unit 401 is used by the software licensor to receive equipment information collected by the equipment manufacturer.
[0124] The authorization file generation unit 402 is used by the software licensor to generate an authorization file based on the received device information and corresponding authorization information;
[0125] The authorization file sending unit 403 is used by the software licensor to return the authorization file and software version to the device manufacturer.
[0126] The authorization file integration unit 404 is used by equipment manufacturers to integrate the software version and place the authorization file as required.
[0127] The authorization verification unit 405 is used to perform authorization verification after the device starts running, by loading the authentication module into the software. If the verification is successful, the device runs normally; otherwise, it stops running. It should be noted that in this embodiment, the preferred setting after the device starts running is to select automatic loading of the authentication module by the software, but it is not limited to this mode. The user can also manually load the authentication module for authorization verification.
[0128] For example, the device information mentioned in this embodiment includes, but is not limited to, device model, manufacturer information, network card physical address, etc. It is required that such information can be read through a standard API (Application Programming Interface), and the read value needs to be consistent with the value displayed on the device interface.
[0129] For example, in this embodiment, the device manufacturer fills in the device information into the application document template and submits it to the software licensor. For example, the authorization information in this embodiment includes, but is not limited to, the authorization method and authorization validity period selected by the software licensor according to the authorization agreement; wherein, the authorization method selected according to the authorization agreement includes, but is not limited to, batch authorization based on device model, or single authorization based on network interface card (NIC) physical address, etc. Finally, the software licensor selects different authorization methods according to the authorization agreement, such as batch authorization based on device model, or single authorization based on NIC physical address, and generates one or more authorization files in conjunction with the authorization validity period limit.
[0130] For example, in this embodiment, the process of generating an authorization file based on the received device information and corresponding authorization information is as follows: Figure 2As shown: S2021. Import / input authorization application information and initialize the authorization file; S2022. Analyze the information including but not limited to device information and authorization information in the application information, fill the device information into DEVICE INFO, and fill the authorization information into LICENCE INFO; S2023. Generate an RSA (1024-bit, PKCS#8) key pair; S2024. Perform SHA256 calculation on DEVICE INFO and LICENCE INFO, and then sign the SHA256 value using the RSA private key and fill it into LICENCE HASH; S2025. Modify the RSA public key, perform obfuscation encryption, and then fill it into LICENCEKEY; wherein, in this embodiment, modifying the RSA public key specifically includes: modifying the RSA public key according to the agreed rules, that is, replacing, modifying or obfuscating some characters in the public key, and protecting the modification process by the characteristic that it is difficult to decompile using programming languages; S2026. Fill the description content into README; S2027. Output the authorization file.
[0131] In the present invention, the authorization file generation unit 402 adopts multiple encryption algorithms such as RSA, SHA, and obfuscation encryption during the authorization file generation process, which is not easy to crack and has high security. In the technical solution of the embodiment of the present invention, the authorization file can be pre-set, and after pre-setting, the user does not need to manually input the activation code. On the one hand, this method is more suitable for devices without button input or interface. On the other hand, it simplifies the process of inputting the activation code, improves the user experience, and reduces the user's usage cost; the technical solution of the embodiment of the present invention adopts an offline authorization method. Compared with online authorization, it simplifies the authorization server link, reduces the development and maintenance costs of the server, and has low cost; the technical solution of the embodiment of the present invention has flexible authorization methods and usage scenarios; it can perform batch authorization on device models, manufacturers, software versions, etc., and can also perform individual authorization on the chip ID, network card address, etc. of a single device. The technical solution of the embodiment of the present invention realizes the innovation of the authorization method for software, especially for embedded terminal software. While increasing the cost of software cracking and ensuring software security, it reduces the dependence on servers and hardware, saves R & D costs, and is suitable for popularization and application.
[0132] Embodiment Five
[0133] As Figure 5 shown, Figure 5 is the structural block diagram of the software authorization system 500 provided by the fourth embodiment of the present invention.
[0134] In this embodiment, the software authorization system 500 includes:
[0135] A device information collection unit 501, for the software authorizer, to receive the device information collected by the device manufacturer;
[0136] The authorization file generation unit 502 is used by the software licensor to generate an authorization file based on the received device information and corresponding authorization information;
[0137] The authorization file sending unit 503 is used by the software licensor to return the authorization file and software version to the device manufacturer.
[0138] The license file integration unit 504 is used by equipment manufacturers to integrate the software version and place the license file as required.
[0139] The authorization verification unit 505 is used to perform authorization verification after the device starts running, by loading the authentication module into the software. If the verification is successful, the device runs normally; otherwise, it stops running. It should be noted that in this embodiment, the preferred setting after the device starts running is to select automatic loading of the authentication module by the software, but it is not limited to this mode. The user can also manually load the authentication module for authorization verification.
[0140] For example, the device information mentioned in this embodiment includes, but is not limited to, device model, manufacturer information, network card physical address, etc. It is required that such information can be read through a standard API (Application Programming Interface), and the read value needs to be consistent with the value displayed on the device interface.
[0141] For example, in this embodiment, the device manufacturer fills in the device information into the application document template and submits it to the software licensor. For example, the authorization information in this embodiment includes, but is not limited to, the authorization method and authorization validity period selected by the software licensor according to the authorization agreement; wherein, the authorization method selected according to the authorization agreement includes, but is not limited to, batch authorization based on device model, or single authorization based on network interface card (NIC) physical address, etc. Finally, the software licensor selects different authorization methods according to the authorization agreement, such as batch authorization based on device model, or single authorization based on NIC physical address, and generates one or more authorization files in conjunction with the authorization validity period limit.
[0142] For example, in this embodiment, the process of generating an authorization file based on the received device information and corresponding authorization information is as follows: Figure 2As shown: S2021. Import / input authorization application information and initialize the authorization file simultaneously; S2022. Parse the application information, including but not limited to device information and authorization information, and fill the device information into DEVICE INFO and the authorization information into LICENCE INFO; S2023. Generate an RSA (1024-bit, PKCS#8) key pair; S2024. Perform SHA256 calculation on DEVICE INFO and LICENCE INFO, then sign the SHA256 value using the RSA private key and fill it into LICENCE HASH; S2025. Modify the RSA public key, perform obfuscation encryption, and then fill it into LICENCEKEY; wherein, in this embodiment, modifying the RSA public key specifically includes: modifying the RSA public key according to agreed rules, that is, replacing, modifying, or obfuscating certain characters in the public key, and protecting the modification process by utilizing the characteristic that programming languages are difficult to decompile; S2026. Fill the explanatory content into README; S2027. Output the authorization file.
[0143] For example, in this embodiment, the authorization verification unit 505 includes: an authentication module verification unit 5051, used to verify whether the authentication module is legitimate; and an authorization file verification unit 5052, used to verify whether the authorization file is legitimate. For example, in this embodiment... Figure 3As shown, the specific working process of the authentication module verification unit 5051 is as follows: 1. Start the software; 2. Enter the authorization check process; 3. Generate a random code; 4. Call the authentication module initialization interface, that is: transmit the version number of the authentication module corresponding to the current software and the generated random code to the authentication module; 5. The authentication module checks the version number transmitted by the software, extracts and restores the corresponding version's RSA private key; 6. The authentication module uses the RSA private key to sign the random code; 7. The authentication module returns the signature result to the software; 8. The software uses a preset RSA public key to verify the signature result returned by the authentication module. If the verification passes, the legality of the authorization file is verified; otherwise, the authentication module is considered invalid and an error is returned. The specific working process of the authorization file verification unit 5052 is as follows: 1. The authentication module performs a legality check on the authorization file and parses the authorization file. The "legality check" includes checking whether the file content is complete and whether the internal... 1. The authentication module performs a hash calculation on the authorization-related content to verify whether the content conforms to the format, and then uses an RSA key to check the hash result to determine whether the authorization-related content has been tampered with. After the legality check passes, the authorization file is parsed. 2. The authentication module returns the result of parsing the authorization file to the software. For example, in this embodiment, the authentication module returns the result of parsing the authorization file to the software in a pre-agreed format, which includes assembling the device information, module name, validity period, etc., using JSON or XML format and returning them to the software. 3. The software performs information retrieval and validity checks on the information in the parsed result and returns the final check result to the software. For example, in this embodiment, the information in the parsed result includes, but is not limited to, authorization status code, authorization date, etc. 4. The software decides whether to continue running based on the authentication result.
[0144] In the present invention, the authorized file generation unit 502 employs multiple encryption algorithms such as RSA, SHA, and obfuscation encryption during the process of generating the authorized file; the authentication module verification unit 5051 and the authorized file verification unit 5052 use multiple signature verifications during the process of verifying the legality of the authorized file and the authentication module, making the software authorization method of the present invention difficult to crack and highly secure. In the technical solution of the embodiment of the present invention, the authorized file can be pre-set, and there is no need for the user to manually input the activation code after pre-setting. This method is more suitable for devices without button input or interface on the one hand, and simplifies the process of inputting the activation code on the other hand, improving the user experience and reducing the user's usage cost; the technical solution of the embodiment of the present invention adopts an offline authorization method, which simplifies the authorization server link compared with online authorization, reducing the development and maintenance costs of the server and having low costs; the authorization method and usage scenarios of the technical solution of the embodiment of the present invention are flexible; batch authorization can be performed on device models, manufacturers, software versions, etc., and individual authorization can also be performed on the chip ID, network card address, etc. of a single device. The technical solution of the embodiment of the present invention has achieved an innovation in the software authorization method, especially for embedded terminal software. While increasing the cost of software cracking and ensuring software security, it reduces the dependence on servers and hardware, saves R & D costs, and is suitable for popularization and application.
[0145] Embodiment Six
[0146] The embodiment of the present invention further provides a storage medium, on which a computer program is stored, wherein when the program is executed by a processor, it implements any one of the software authorization methods in Embodiments 1 to 3 above.
[0147] Note that the above is only the preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described here, and various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, it can also include more other equivalent embodiments, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A software licensing method, characterized in that, Includes the following steps: S101. The software licensor receives device information collected by the device manufacturer; S102. The software licensor generates an authorization file based on the received device information and corresponding authorization information; S103. The software licensor returns the license file and software version to the equipment manufacturer; S104. The equipment manufacturer integrates the software version and places the license file as required; S105. After the device starts running, the software loads the authentication module and performs authorization verification. If the verification passes, the device runs normally; otherwise, it stops running. Step S105, loading the authentication module and performing authorization verification, includes: S1051. Authentication module validity verification; S1052. Authorization file validity verification. Specifically, the authentication module validity verification includes: S10511. Starting the software; S10512. Entering the authorization check process; S10513. Generating a random code; S10514. Calling the authentication module initialization interface, i.e., setting the version of the authentication module corresponding to the current software. The authentication module transmits the serial number and the generated random code to the authentication module; S10515. The authentication module checks the version number transmitted by the software, extracts and restores the corresponding version's RSA private key; S10516. The authentication module uses the RSA private key to sign the random code; S10517. The authentication module returns the signature result to the software; S10518. The software uses a preset RSA public key to verify the signature result returned by the authentication module. If the verification passes, the software performs an authorization file validity verification; otherwise, the authentication module is considered invalid, and an error is returned.
2. The software licensing method according to claim 1, characterized in that, Step S102 specifically includes: S1021. Import / enter license application information and initialize the license file simultaneously; S1022. Parse the application information, including but not limited to device information and authorization information, and fill the device information into DEVICE INFO and the authorization information into LICENCE INFO; S1023. Generate an RSA key pair; S1024. Perform SHA256 calculation on DEVICE INFO and LICENCE INFO, then sign the SHA256 value using the RSA private key and fill it into LICENCE HASH; S1025. Modify the RSA public key, perform obfuscation encryption, and then enter the LICENCE KEY; S1026. Fill in the instructions in README; S1027. Output the license file.
3. The software licensing method according to claim 1, characterized in that, The authorization file validity verification in step S1052 specifically includes: S10521. The authentication module performs a validity check on the authorization file and parses the authorization file; S10522. The authentication module returns the result of parsing the authorization file to the software; S10523. The software performs information retrieval and validity checks on the information in the parsing results, and returns the final check results to the software; S10524. The software decides whether to continue running based on the authentication result.
4. The software licensing method according to any one of claims 1 to 3, characterized in that, The equipment information collected by the equipment manufacturer in step S101 includes, but is not limited to, equipment model, manufacturer information, and network card physical address.
5. The software licensing method according to claim 4, characterized in that, The authorization information in step S102 includes, but is not limited to, the authorization method selected according to the authorization agreement and the authorization validity period; wherein, the authorization method selected according to the authorization agreement includes, but is not limited to, batch authorization based on device model or single authorization based on network card physical address.
6. A software licensing system, characterized in that, The system employs the software licensing method described in claim 1, comprising: The equipment information collection unit is used by the software licensor to receive equipment information collected by the equipment manufacturer. The authorization file generation unit is used by the software licensor to generate an authorization file based on the received device information and corresponding authorization information; The authorization file sending unit is used by the software licensor to return the authorization file and software version to the device manufacturer. The license file integration unit is used by equipment manufacturers to integrate the software version and place the license file as required. The authorization verification unit is used to perform authorization verification after the device is running. If the verification is successful, the device will run normally; otherwise, it will stop running.
7. A storage medium, characterized in that, It stores a computer program thereon, wherein the program, when executed by a processor, implements the software licensing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Authorization control method and device, authorization method and device and computing equipment
CN112699342A