Software authorization authentication method and system and electronic equipment

By analyzing and verifying the software's license configuration file, ensuring the legality of software authorization, solving the problems of low security and poor compatibility of software authorization and authentication solutions in the prior art, achieving higher security and flexibility.

CN119475309APending Publication Date: 2025-02-18CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411560539.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the prior art, the software authorization and authentication scheme has low security and poor compatibility, making it difficult to effectively prevent software piracy and authorization failure.

Method used

By obtaining the software's License configuration file, parse and verify the hardware information, activation time and authorization validity period in the License file. If the verification is passed, the software will be opened and the timed refresh thread will be started. If the verification is not passed, an activation code will be generated for decryption and verification. Verify to ensure the legal status of the software.

Benefits of technology

Improve the security of software authorization and certification, prevent software piracy and authorization failure, ensure that the software remains legal at all times, and increase the flexibility and fault tolerance of software activation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119475309A_ABST
    Figure CN119475309A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information, and discloses a software authorization authentication method and system and electronic equipment. The method comprises the following steps: acquiring a License configuration file of software; the License file is analyzed, hardware information, activation time and an authorization validity period are determined, and the License file comprises a License path changing based on change of the generation time, a secret key for License encryption and decryption and an initialization vector; the License file is subjected to verification; if the verification is passed, software is started, and a License timing refreshing thread is started to verify the validity of the current system time, the activation time and the authorization validity period; and if the verification is not passed, performing encryption processing on a machine code corresponding to the software, generating an activation code, decrypting the activation code, and verifying the activation validity period and legality of the License through an encryption option obtained by decryption so as to open the software. License management and control failure after the secret key and the initialization vector are leaked is avoided, and the security of software authorization authentication is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information technology, and in particular to a software authorization authentication method, system and electronic equipment. Background Art

[0002] As people pay more attention to information security, more and more devices or software applications need to be used with authorization. For example, in order to prevent the software from being used illegally, it is often necessary to add a license function to the software to control the use of the software.

[0003] In the related art, adding a license function to the software to solve the offline authentication method mainly includes: the first one is to use a fixed key for verification. Once the key is leaked, it will lead to a large number of piracy; at the same time, the number of activated users cannot be controlled, and the same key can be used multiple times; the second one is based on the hardware information of the user terminal, combined with symmetric or asymmetric encryption, plus a timestamp mechanism to generate a user-exclusive activation code. However, the user is required to bypass the timestamp mechanism in advance through the backup software + system image method, which not only reduces the security of authorization verification, but also requires system administrator authority authentication. In this way, the operation is cumbersome and not suitable for promotion and use. In addition, if the key and IV are leaked, the software authorization control may also become invalid.

[0004] In view of this, there is an urgent need for a software authorization authentication solution with high security and strong compatibility. Summary of the invention

[0005] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0006] In view of the above-mentioned shortcomings of the prior art, the present application provides a software authorization authentication method, system and electronic device to solve the problems of low security and poor compatibility of software authorization authentication solutions.

[0007] The first aspect of the present application provides a software authorization authentication method, comprising: obtaining a license configuration file of the software, the license configuration file comprising a software name, a generation time and a license file; parsing the license file to determine the hardware information, activation time and authorization validity period of the license, wherein the license file comprises a license path that is updated regularly based on the change of the generation time, a key for license encryption and decryption, and an initialization vector; verifying the license file according to the activation time and the authorization validity period; if the verification passes, starting the software, and starting a license timed refresh thread to regularly verify the validity of the current system time, the activation time and the authorization validity period; if the verification fails, encrypting a machine code corresponding to the software to generate an activation code, decrypting the activation code, and verifying the activation validity period and the legitimacy of the license through the encryption option obtained by decryption to start the software, wherein the machine code is generated by the hardware information and the license configuration file.

[0008] In some possible embodiments of the present application, before obtaining the License configuration file of the software, it also includes: determining the configuration status of the License configuration file; if the configuration status of the License configuration file is existence, performing a License check; if the configuration status of the License configuration file is non-existent, determining the generation time of the License configuration file according to the current system time, and generating a License path with a random string folder in combination with the generation time and a random system directory; randomly generating a built-in Key and IV that conform to the AES algorithm, inserting random strings of different lengths at different positions of the strings corresponding to the built-in Key and IV, and forming the key and initialization vector for License encryption and decryption through obfuscation; saving the key and the initialization vector to the random string folder where the License path is located to form the License configuration file.

[0009] In some possible embodiments of the present application, the License file is verified, including: if the current system time is greater than the activation time and less than the authorization validity period, the verification passes; if the current system time is less than the activation time, or the current system time is greater than the authorization validity period, the verification fails, the License file is deleted, the user is prompted that the License verification failed, and the use of the software is stopped.

[0010] In some possible embodiments of the present application, the machine code corresponding to the software is encrypted to generate an activation code, and the activation code is decrypted, and the activation validity period and legitimacy of the License are verified by the encryption option obtained by decryption, including: generating a machine code according to the License configuration file and the hardware information where the software is located, and the machine code is encrypted by the built-in Key and IV of the AES algorithm; decrypting the received machine code to obtain the License configuration file and the hardware information; using an authorization tool to configure the hardware encryption option, software authorization authority, and the License authorization validity period associated with the hardware information, respectively, to generate an activation code to activate the software, and the activation code includes hardware encryption items, software authorization authority, activation time, validity period, hardware information, and License configuration file information.

[0011] In some possible embodiments of the present application, after activating the software, it also includes: parsing the activation code to determine the hardware information in the activation code; comparing the hardware information in the activation code with the hardware information of the current software based on the hardware encryption item to verify the hardware information; if the activation time of the current software is less than or equal to the current system time, determining that the activation time verification has passed; if the authorization validity period of the current software is greater than or equal to the current system time, determining that the authorization validity period verification has passed; if the hardware information verification, the activation time verification and the authorization validity period verification have all passed, parsing the License configuration file to generate the License file, determining the License path in the License configuration file based on the generation path of the License file, and saving the activation code in the License path.

[0012] In some possible embodiments of the present application, generating an activation code includes: configuring the current hardware information using an authorization tool to determine a hardware encryption option, wherein the hardware information includes at least a motherboard, a processor, a network card, and a hard disk; authorizing at least one of the software to determine the software authorization authority and the license authorization validity period, wherein the license authorization validity period includes at least an activation time and an authorization validity period; encrypting the hardware encryption option, the software authorization authority, the activation time, the authorization validity period, the hardware information, and the license configuration file information using the key and the initialization vector using an AES algorithm to obtain the activation code.

[0013] In some possible embodiments of the present application, determining the key and initialization vector for License encryption and decryption also includes: using an authorization tool to decrypt the machine code through the built-in Key and IV of the AES algorithm to obtain the License configuration file and the hardware information; determining the software name and encryption time in the License configuration file, the encryption time is the first binary data after the License file is obfuscated based on the generation time, and the License configuration file is AES encrypted and obfuscated through the hardware information to be binary second data; according to the first data, in the second data corresponding to the License configuration file, remove random strings of indefinite length to determine the key and initialization vector for License encryption and decryption.

[0014] In some possible embodiments of the present application, after the software is run, it also includes: triggering a verification task at a preset time interval to verify the License file; if the verification passes, updating the activation time in the License file, and updating the License path in the License configuration file based on the generation time, transferring the License file to the updated License path, and at the same time, updating the activation time of the License file, the activation time is the most recent use time of the software; if the verification fails, deleting the License file, prompting the user that the License verification has failed, and closing the use rights of the software.

[0015] The second aspect of the present application further provides a software authorization authentication system, comprising: an acquisition module, used to acquire a license configuration file of the software, wherein the license configuration file includes a software name, a generation time, and a license file; a parsing module, used to parse the license file to determine the hardware information, activation time, and authorization validity period of the license, wherein the license file includes a license path that is regularly updated based on the change of the generation time, a key for license encryption and decryption, and an initialization vector; a verification module, used to verify the license file according to the activation time and the authorization validity period; a first authorization module, used to enable the software if the verification passes, and start a license timed refresh thread to regularly verify the validity of the current system time, the activation time, and the authorization validity period; a second authorization module, used to encrypt the machine code corresponding to the software if the verification fails, generate an activation code, and decrypt the activation code, and verify the activation validity period and legality of the license through the encryption option obtained by decryption to enable the software, wherein the machine code is generated by the hardware information and the license configuration file.

[0016] The third aspect of the present application also provides an electronic device, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device performs the above method.

[0017] The beneficial effects of the present application are as follows: by obtaining the License configuration file of the software, parsing the License configuration file, and determining the License file, wherein the License file includes a License path that changes dynamically based on the generation time, a key for License encryption and decryption, and an initialization vector; on the one hand, the storage rule of the License file is updated and changed regularly, thereby improving the security protection capability of the License file; the License file is verified; if the verification passes, the software is enabled, and the License timing refresh thread is started to verify the validity of the current system time, activation time, and authorization validity period, and on the other hand, it is ensured that the software always remains legal during use; if the verification fails, the machine code corresponding to the software is encrypted to generate an activation code, and the activation code is decrypted, and the activation validity period and legality of the License are verified through the encrypted option obtained by decryption to enable the software, and on the other hand, the flexibility and fault tolerance of software activation are increased through the backup activation path.

[0018] In addition, by regularly updating the storage location of the license file, the problem of offline users attempting to crack license management through software backup and system backup is solved. At the same time, the license file strategy based on secondary obfuscation and scheduled movement of generation time is configured to avoid the failure of license management after the accidental leakage of keys and initialization vectors, thereby improving the security of software authorization authentication. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a flowchart of a software authorization authentication method in an embodiment of the present application;

[0020] Figure 2 It is a schematic diagram of the overall framework of a software authorization authentication method in an embodiment of the present application;

[0021] Figure 3 This is a flowchart of the License configuration file verification in a software authorization authentication method in an embodiment of the present application;

[0022] Figure 4 This is a license activation flow chart in a software authorization authentication method in an embodiment of the present application;

[0023] Figure 5 This is a license verification flow chart in a software authorization authentication method in an embodiment of the present application;

[0024] Figure 6 This is a runtime verification and update flow chart of a software authorization authentication method in an embodiment of the present application;

[0025] Figure 7 It is a structural diagram of a software authorization authentication system in an embodiment of the present application;

[0026] Figure 8 It is a structural schematic diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0027] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and sub-samples in the embodiments can be combined with each other without conflict.

[0028] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0029] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0030] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so as to describe the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.

[0031] Unless otherwise stated, the term "plurality" means two or more.

[0032] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.

[0033] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.

[0034] Combination Figure 1 FIG. 1 is a flowchart of a software authorization authentication method in an embodiment of the present application, including:

[0035] Step S101, obtaining a license configuration file of the software, wherein the license configuration file includes the software name, generation time, and license file;

[0036] License can refer to any form of authorization or permission, and in the field of computers or software, License usually refers to the use permission of software, which stipulates how users or organizations can use, copy, distribute and modify software. For example, the license of open source software (such as GPL, MIT, etc.) allows users to freely use, modify and distribute software, while the license of commercial software may restrict these activities.

[0037] Exemplarily, the license configuration file includes the software name, generation time and license file. The license file includes the license path, the key and initialization vector for license encryption and decryption that change based on the generation time. In other words, the storage path of the license path is updated regularly with the generation time. Similarly, the key and initialization vector for license encryption and decryption are updated regularly with the generation time. For example, a secondary obfuscation rule for encrypted data based on time, that is, a variable-length string is randomly inserted into the encrypted data based on time. In this way, it is ensured that the key and initialization vector for license encryption and decryption change dynamically with the generation time.

[0038] In one example, the license configuration file includes the software name, the license generation time, and the license file.

[0039] Step S102, parsing the license file to determine the hardware information, activation time and authorization validity period of the license, wherein the license file includes a license path that is regularly updated based on the change of the generation time, a key for license encryption and decryption, and an initialization vector;

[0040] The format of the license file is determined by a text file containing a series of key-value pairs, each of which represents a property of the license, such as JSON, XML, or a custom binary format. Use appropriate programming languages ​​and techniques to read the license file. For example, in Python, use the built-in open() function to read text files; if the license is in binary format, use the struct module or other binary parsing libraries.

[0041] Exemplarily, according to the format of the license file, parse its content to extract the required information. For text files, read line by line and split the string to obtain key-value pairs; for JSON or XML files, use the corresponding parsing library (such as Python's json module or xml.etree.ElementTree) to parse the file.

[0042] If parsed correctly, the key-value pairs representing hardware information (such as MAC address, CPU serial number, etc.), activation time (expressed as a date and time string) and authorization validity period (expressed as a date and time string or the length of the validity period relative to the activation time) are determined.

[0043] Step S103, verifying the license file according to the activation time and the authorization validity period;

[0044] The current system time of the license file is compared with the activation time and the authorization validity period to verify the license file. For example, if the conditions are met, the verification passes, otherwise, the verification fails.

[0045] In some embodiments, verifying the license file includes:

[0046] If the current system time is greater than the activation time and less than the authorization validity period, the verification passes;

[0047] If the current system time is less than the activation time, or the current system time is greater than the authorization validity period, the verification fails.

[0048] Exemplarily, whether it is the first verification of the license file after the software is started, or the second to Nth verification of the license file during the software operation, the corresponding judgment verification rules are the same, as shown above, where N is a positive integer greater than 2.

[0049] Through the above method, not only the License file is verified, but also the License path in the License configuration file can be updated regularly according to the current system time when the verification passes, so that the storage path of the License file is updated regularly; when the verification fails, the License file is deleted, the user is prompted that the License verification fails, and the software is stopped from being used, so as to avoid the user trying to crack the License management and control problem by means of software backup and system backup. At the same time, by configuring the License file strategy through regular mobile configuration, the License management and control failure after the accidental leakage of the key and initialization vector is avoided, thereby improving the security of software authorization authentication.

[0050] Step S104: if the verification is passed, the software is started, and the license timer refresh thread is started to regularly verify the validity of the current system time, activation time, and authorization validity period;

[0051] Specifically, even if the verification is passed, during the subsequent normal use of the software, the license periodic refresh thread is used to periodically verify the validity of the current system time, activation time, and authorization validity period, to continuously ensure that the software cannot be used normally in subsequent work after the verification expires, thereby protecting the rights and interests of the software holder.

[0052] Step S105: If the verification fails, the machine code corresponding to the software is encrypted to generate an activation code, and the activation code is decrypted. The activation validity period and legitimacy of the license are verified through the encrypted option obtained by decryption to enable the software, wherein the machine code is generated by the hardware information and the license configuration file.

[0053] It should be noted that step S104 and step S105 belong to the initial verification after the software is started, and step S105 is how to verify the activation validity period and legitimacy of the license by decrypting the encrypted option in the activation code when the verification fails.

[0054] In some embodiments, the machine code corresponding to the software is encrypted to generate an activation code, and the activation code is decrypted, and the activation validity period and legitimacy of the license are verified through the encrypted options obtained by decryption, including:

[0055] Generate a machine code according to the license configuration file and the hardware information where the software is located, and encrypt the machine code by using the built-in Key and IV of the AES algorithm;

[0056] Decrypting the received machine code to obtain the license configuration file and the hardware information;

[0057] The hardware encryption option, software authorization permission, and the license authorization validity period associated with the hardware information are configured using an authorization tool to generate an activation code to activate the software. The activation code includes the hardware encryption item, software authorization permission, activation time, validity period, hardware information, and license configuration file information.

[0058] Among them, the necessary hardware information is obtained from the current system, such as MAC address, CPU serial number, hard disk serial number, etc.; the software license configuration file is loaded and read, which contains some software-specific configuration information. The hardware information and license configuration file information are combined into a unique string, which is used as the machine code; the machine code is encrypted using the built-in Key (key) and IV (initialization vector) of the AES algorithm, and the encrypted machine code is securely transmitted to the authorization server or stored in other secure locations.

[0059] First, the encrypted machine code is sent to the authorization server or related authorization tool, which receives and stores the encrypted machine code.

[0060] Secondly, the authorization server or authorization tool uses the same AES key and initialization vector to decrypt the received encrypted machine code to obtain the original hardware information and license configuration file information. According to the decrypted hardware information, use the authorization tool to configure the corresponding hardware encryption options; according to software requirements, set software authorization permissions, such as enabling / disabling functional modules; determine and set the validity period of the license.

[0061] Finally, a unique activation code is generated by combining the hardware encryption items, software authorization permissions, activation time, validity period, hardware information, and license configuration file information.

[0062] After receiving the activation code, the client software performs necessary verification to ensure that the activation code matches the current hardware information and license configuration file. If the verification passes, the relevant functions of the software are enabled according to the information in the activation code, and the software is allowed to run within the specified validity period. The generation time and license path in the license configuration file are updated; the license file is moved to the updated license path.

[0063] Through the above method, on the one hand, the secure storage and management of AES keys and IVs are ensured to prevent leakage; on the other hand, even if the initial verification fails, the software can be started by verifying the activation code.

[0064] In some embodiments, after activating the software, the method further includes:

[0065] Parsing the activation code to determine the hardware information in the activation code;

[0066] Comparing the hardware information in the activation code with the hardware information of the current software based on the hardware encryption item, and verifying the hardware information;

[0067] If the activation time of the current software is less than or equal to the current system time, determining that the activation time check passes;

[0068] If the authorization validity period of the current software is greater than or equal to the current system time, determining that the authorization validity period check passes;

[0069] If the hardware information check, the activation time check, and the authorization validity period check are all passed, the license configuration file is parsed to generate the license file, a license path in the license configuration file is determined based on a generation path of the license file, and the activation code is saved in the license path.

[0070] Specifically, the hardware information corresponding to the activation code is obtained from the current system, such as the MAC address, CPU serial number, etc.; the hardware encryption item (encryption algorithm or hash function) is used as a reference to compare the hardware information in the activation code with the hardware information of the current software. If the hardware information of the current software matches the hardware information in the activation code, the hardware information verification passes; otherwise, the verification fails.

[0071] Compare the current system time (i.e., the current system timestamp) with the activation time in the activation code; if the current system time is greater than or equal to the activation time, the activation time check passes; otherwise, the check fails. Compare the current system time with the authorization validity period in the activation code; if the current system time is less than or equal to the authorization validity period (indicating that the validity period has not yet ended), the authorization validity period check passes; otherwise, the check fails.

[0072] Parse or generate a license configuration file based on the information in the activation code or a predefined template; write the contents of the license configuration file (including the activation code, software information, authorization information, etc.) into a new file to form a license file.

[0073] Through the above manner, the verification security is improved through the hardware information verification, the activation time verification and the authorization validity period verification, and at the same time, the License path is updated.

[0074] In some embodiments, generating an activation code includes:

[0075] Using an authorization tool to configure the current hardware information and determine hardware encryption options, the hardware information at least including a motherboard, a processor, a network card, and a hard disk;

[0076] Authorize at least one of the software, determine the software authorization rights and the validity period of the license authorization, and the validity period of the license authorization at least includes the activation time and the authorization validity period;

[0077] The hardware encryption option, the software authorization authority, the activation time, the authorization validity period, the hardware information and the license configuration file information are encrypted using the key and the initialization vector using the AES algorithm to obtain the activation code.

[0078] Specifically, an authorization tool is started, which usually has a graphical user interface (GUI) or a command line interface (CLI) for interacting with the user. The authorization tool is used to collect hardware information from the current system, including but not limited to detailed information of the motherboard, processor, network card, and hard disk. Based on the collected hardware information, the authorization tool determines appropriate hardware encryption options, including but not limited to using specific hardware functions (such as a TPM module) for encryption, or specifying an encryption algorithm and key length.

[0079] In the authorization tool, select the software to be authorized, which may be one or more software packages, each of which has different authorization requirements. Determine the authorization permissions of the software based on the software's functions and user needs, including but not limited to accessing specific functions, using specific resources, or connecting to specific devices. Set a valid authorization period for the software, including but not limited to the activation time (i.e. the date and time when the license takes effect) and the authorization validity period (i.e. the period during which the license remains valid)

[0080] Arrange the hardware encryption options, software authorization rights, activation time, authorization validity period, hardware information, and license configuration file information into a data structure or text format. Use the AES algorithm and the preset key (Key) and initialization vector (IV) to encrypt the above information; the AES algorithm is a widely used symmetric encryption algorithm that can provide strong security. Encode the encrypted information into a format that is easy to transmit and store, such as Base64 encoding, to generate the final activation code.

[0081] In the above manner, when collecting hardware information and determining software authorization permissions, ensure the accuracy of all information; any error may cause the activation code to be invalid or the software to fail to operate normally. The activation code should be securely transmitted to the user or software to prevent it from being intercepted or tampered with by malicious users.

[0082] See also Figure 2 , is a schematic diagram of the overall framework of a software authorization authentication method in an embodiment of the present application, including:

[0083] Step 1: When the software is started for the first time, a license configuration file is generated based on the system time and saved through AES encryption using built-in Key1 and IV1. The configuration file contains the following information: software name, generation time, license path, license encryption Key2 and IV2. The license path is a randomly generated available path based on the generation time, and Key2 and IV2 are obfuscated based on the generation time.

[0084] Step 2: Perform license verification when the software is started: Parse the license file based on the information in the license configuration file. If the parsing is correct and the hardware information, authorization validity period, and activation time are verified, the software will start normally (steps 7 and 8). If the license file does not exist or the verification fails, the activation process (steps 3, 4, 5, 6, 7, and 8) is required.

[0085] Step 3: Part of the configuration file information is obfuscated based on the encryption time (random strings of different lengths are inserted at different positions) and converted into binary data 1. The user hardware information (BIOS, CPU, hard disk, network card, etc.) is AES encrypted using Key2 and IV2 in the configuration file information to obtain binary data 2. Finally, binary data 1, data 2 and encryption time are AES encrypted twice using built-in Key1 and IV1.

[0086] Step 4: After the authorization management tool obtains the machine code, it first parses the software name, obfuscated configuration file information binary data, and encryption time in the configuration file information through the built-in Key1 and IV1. After removing the indefinite-length random string added to the obfuscated configuration file information binary data through the encryption time, it parses out the correct Key2 and IV2.

[0087] Step 5: The authorization management tool provides hardware encryption options such as BIOS, CPU, hard disk, and network card, as well as software authorization module options. Based on the encryption options, software authorization module status, activation validity period, activation time, and analysis, the hardware information is obtained. The activation code is obtained by performing AES encryption with Key2 and IV2 obtained in step 4.

[0088] Step 6. After receiving the activation code, the user software uses Key2 and IV2 AES in the license configuration file to decrypt the activation code to obtain the encryption options (which hardware information needs to be verified), full hardware information (used to verify user hardware information and implement license binding hardware), activation validity period and activation time (to implement non-permanent license authorization), and then compares and parses the hardware information and local hardware information based on the encryption options, and verifies the legitimacy of the activation validity period and activation time. If both pass, a license file is generated based on the license path in the configuration file, and the file content is the received activation code.

[0089] Among them, the encryption option is used to inform which hardware information needs to be verified; the full hardware information is used for hardware information verification; the activation validity period is used to implement non-permanent license authorization; the activation time is used in the non-permanent authorization mode to prevent users from bypassing license control by modifying the system time, and is also used for secondary obfuscation of encrypted data.

[0090] Step 7: The software starts normally, and the software module is opened based on the authorization status of the software module obtained by parsing the license file.

[0091] Step 8: After the software is started, a scheduled task thread is automatically started to verify the validity of the current system time, activation time, and authorization validity period. If the current system time is greater than the activation time and less than the authorization validity period, the verification passes. The generation time and license path in the license configuration file are updated based on the current system time, and the license file is moved to the corresponding path. If the verification fails, the license file is deleted, the user is prompted that the license verification failed, and the software is stopped.

[0092] Note: The software and the authorization management tool have the same built-in Key and IV, and can use asymmetric encryption.

[0093] Through the above methods, by hiding the license file, the problem of offline users trying to crack the license control through software backup and system backup is solved; through the encrypted Key and IV based on time secondary obfuscation and scheduled movement configuration license file strategy, the license control failure after the Key and IV are accidentally leaked is prevented. Through the above methods, the license authorization control of offline software is strengthened to protect the core interests of software manufacturers.

[0094] In some embodiments, before obtaining the license configuration file of the software, the method further includes:

[0095] Determine the configuration status of the license configuration file;

[0096] If the configuration status of the license configuration file is "existing", a license verification is performed;

[0097] If the configuration status of the license configuration file is non-existent, determining the generation time of the license configuration file according to the current system time, and generating a license path with a random string folder in combination with the generation time and a random system directory;

[0098] Randomly generate a built-in Key and IV that conform to the AES algorithm, insert random strings of different lengths at different positions of the strings corresponding to the built-in Key and IV, and form the key and initialization vector for encryption and decryption of the license through obfuscation;

[0099] The key and the initialization vector are saved to the random string folder where the license path is located to form the license configuration file.

[0100] See also Figure 3 , is a flowchart of a license configuration file verification in a software authorization authentication method in an embodiment of the present application,

[0101] Step A1: After the software is started, first verify the license configuration file.

[0102] If the license configuration file exists, the license verification process is performed.

[0103] If the license configuration file does not exist, proceed to steps A2, A3, A4, and A5.

[0104] Step A2, obtain the current system time as the license file generation time. This time has the following functions:

[0105] Randomly generate license path: Based on the system timestamp, generate a random string folder in a random system directory (if there is no administrator privilege, then in the AppData\Roaming\Microsoft directory under the user directory). For example, if the timestamp%10+5=6, then generate a random string folder with a name length of 6

[0106] Confuse the randomly generated Key and IV. Based on the system timestamp, insert random strings of different lengths at different positions. For example, if timestamp%10+5=6, divide the string to be obfuscated into 6 equal parts, and add 1, 2, 3, 4, 5, and 6 random strings to each part in turn.

[0107] Step A3: randomly generate a Key and IV that meet the AES128 requirements.

[0108] Step A4: encrypt various information based on AES using built-in Key and IV and save them to files.

[0109] The encrypted information includes: software name, generation time, license path, license encryption and decryption key and IV;

[0110] The built-in Key and IV are the same as those of the authorization management tool or are the same set of asymmetric encryption public key and private key.

[0111] Step A5: Enter the license activation process.

[0112] In the above manner, by judging the configuration status of the License configuration file in advance, it is determined whether a License configuration file needs to be generated, so as to facilitate the subsequent execution of different verification strategies.

[0113] In some embodiments, determining a key and an initialization vector for license encryption and decryption further includes:

[0114] Decrypt the machine code using the authorization tool through the built-in Key and IV of the AES algorithm to obtain the License configuration file and the hardware information;

[0115] Determine the software name and encryption time in the license configuration file, where the encryption time is the first binary data after the license file is obfuscated based on the generation time, and the license configuration file is obfuscated by AES encryption through the hardware information, which is the second binary data;

[0116] According to the first data, in the second data corresponding to the license configuration file, random character strings of indefinite length are eliminated to determine the key and initialization vector for encryption and decryption of the license.

[0117] For example, the authorization tool is used to decrypt the machine code through the built-in Key (key) and IV (initialization vector) of the AES algorithm, ensuring that only users with the correct machine code can further access this information; read the software name and encryption time in the license configuration file, the encryption time is the first binary data after obfuscation, it is transformed based on the generation time of the license file, increasing the difficulty of cracking. The license configuration file itself is also encrypted and obfuscated by AES through hardware information to form the second binary data; this double encryption strategy enhances data security.

[0118] In the license configuration file, random strings of indefinite length need to be removed according to the encrypted content (second data) corresponding to the encryption time (first data); these random strings are accurately identified and removed to restore the original key and initialization vector. Once the random strings are successfully removed, the key and initialization vector used for license encryption and decryption can be determined.

[0119] In the above method, the machine code, license configuration file and hardware information are encrypted and decrypted through the AES algorithm. At the same time, the key and initialization vector are determined through a complex obfuscation and random string elimination process. This not only enhances the security of software authorization, so that only users who hold the correct machine code and pass the complex decryption process can access and use the software, but also improves the flexibility of license management.

[0120] In some embodiments, see Figure 4 , is a license activation flow chart in a software authorization authentication method in an embodiment of the present application, including:

[0121] Step B1, the software generates a machine code based on the license configuration file and hardware information, and the machine code is encrypted based on AES with built-in Key and IV;

[0122] The machine code includes: hardware information, license configuration file information;

[0123] Hardware information is the full hardware information in the format of BIOS, CPU, hard disk, and network card. BIOS = BIOS serial number, CPU = CPU serial number, hard disk = hard disk serial number, network card = network card Mac address;

[0124] Hard disk includes all hard disks in the current system;

[0125] Network Card includes all network cards in the current system.

[0126] Step B2: After receiving the machine code, the authorization tool uses the built-in Key and IV to obtain the hardware information and license configuration file information through AES decryption.

[0127] Step B3, the authorization tool GUI provides hardware encryption options, including BIOS, CPU, hard disk, and network card. If none of them are selected, the hardware will not be bound.

[0128] Step B4: the authorization tool GUI provides software module authorization options, and can perform authorization management for a single software module.

[0129] Step B5: The authorization tool GUI provides a validity period selection and supports permanent authorization. The permanent authorization mode allows users to modify the system time.

[0130] Step B6, generating an activation code;

[0131] The activation code includes: hardware encryption items, software module permissions, activation time, validity period, hardware information, and license configuration file information;

[0132] The hardware encryption items are converted into binary data;

[0133] Software module authorization items are converted to binary data.

[0134] Step B7, software activation, parsing the activation code and generating a license file after verification;

[0135] Compare the hardware information in the activation code with the hardware information of the current software system based on the hardware encryption item. The comparison of the hard disk and the network card only needs to include any one of them (excluding the influence of the USB flash drive and the USB network card);

[0136] Verify the activation time. If it is greater than the current system time, activation fails.

[0137] Verify the authorization validity period. If it is greater than the current system time, activation fails.

[0138] The license file generation path is the license path in the parsed license configuration file, and the content is the full text of the activation code.

[0139] In the above manner, the software is activated by generating an activation code to verify the software, thereby improving the verification capability of the license.

[0140] In some embodiments, see Figure 5 , is a license verification flow chart in a software authorization authentication method in an embodiment of the present application, including:

[0141] Step C1: Use the Key and IV in the license configuration file to decrypt the content in the license file.

[0142] Step C2: verify the user's current system hardware information based on the hardware encryption item.

[0143] If encryption is not checked for certain hardware information, it will also exist in the hardware information string, but no verification is required;

[0144] When the authorization validity period is permanent, the activation time is no longer verified, allowing users to modify the system time.

[0145] Step C3, verifying the activation time and authorization validity period.

[0146] If the activation time is greater than the current system time, it means that the user may have tried to change the system time to delay the validity period of the authorization, delete the license file, and stop using the software;

[0147] When the authorization validity period is permanent, the activation time is no longer verified, allowing users to modify the system time.

[0148] Step C4, updating the license file, mainly updating the activation time, which is equivalent to the most recent use time.

[0149] Step C5, using the software module authorization information as a startup parameter to formally start the main software.

[0150] Through the above method, by decrypting the license file, verifying hardware information, managing activation time and authorization validity period, updating the license file, and using the authorization information as a startup trigger condition, it is ensured that only legitimate users who meet the hardware requirements can use the software, thereby effectively protecting the software usage rights.

[0151] In some embodiments, after the software is run, it further includes:

[0152] Triggering a verification task at a preset time interval to verify the license file;

[0153] If the verification passes, the activation time in the license file is updated, and the license path in the license configuration file is updated based on the generation time, the license file is transferred to the updated license path, and at the same time, the activation time of the license file is updated, and the activation time is the most recent use time of the software;

[0154] If the verification fails, the license file is deleted, the user is prompted that the license verification has failed, and the use permission of the software is closed.

[0155] The verification task may be verified more than once, depending on a preset time interval.

[0156] Exemplarily, by triggering the verification task at a preset time interval, the regular verification of the license file is ensured, thereby effectively preventing expired or invalid license files from being used for a long time. The license path in the license configuration file is updated based on the generation time, and the license file is transferred to the new path. This dynamic path management helps to enhance the security and flexibility of the license file. If the verification fails, the license file is deleted, the user is prompted that the license verification has failed, and the software usage rights are immediately closed, which can effectively prevent unauthorized access and use and protect the software usage rights. In addition, for users, this reduces the trouble of manual updates and maintenance, and improves the convenience and efficiency of using the software.

[0157] See also Figure 6 , is a runtime verification update flow chart of a software authorization authentication method in an embodiment of the present application, including:

[0158] Step D1, trigger the verification task regularly to perform license verification.

[0159] If the verification is passed, proceed to steps D2, D3, and D4;

[0160] If the verification fails, the software will be stopped, and the user can be warned in advance to prevent the loss of key user data.

[0161] Step D2: Update the activation time in the license file.

[0162] Step D3: Update the license path in the license configuration file based on the generation time in the configuration file.

[0163] Step D4: Update the activation time in the license file, which is equivalent to the most recent usage time.

[0164] Step D5, transferring the license file according to the license path updated in step D3.

[0165] Through the above methods, regular verification, effective management of license files, flexible control of software usage rights, maintenance of software usage compliance, and improved user experience are achieved. These effects together constitute an efficient, secure, and convenient license management system.

[0166] See also Figure 7 , is a schematic diagram of the structure of a software authorization authentication system in an embodiment of the present application, including:

[0167] The acquisition module 701 is used to acquire the license configuration file of the software, wherein the license configuration file includes the software name, generation time and license file;

[0168] The parsing module 702 is used to parse the license file to determine the hardware information, activation time and authorization validity period of the license, wherein the license file includes a license path that is regularly updated based on the change of the generation time, a key for license encryption and decryption, and an initialization vector;

[0169] A verification module 703, configured to verify the license file according to the activation time and the authorization validity period;

[0170] The first authorization module 704 is used to enable the software if the verification is passed, and start the license timer refresh thread to regularly verify the validity of the current system time, activation time, and authorization validity period;

[0171] The second authorization module 705 is used to encrypt the machine code corresponding to the software to generate an activation code, decrypt the activation code, and verify the activation validity period and legitimacy of the license through the encrypted option obtained by decryption to activate the software, if the verification fails, wherein the machine code is generated by the hardware information and the license configuration file.

[0172] Among them, the acquisition module 701 is used to execute the aforementioned step 101, the parsing module 702 is used to execute the aforementioned step 102, the verification module 703 is used to execute the aforementioned step 103, the first authorization module 704 is used to execute the aforementioned step 104, and the second authorization module 705 is used to execute the aforementioned step 105. The above modules correspond to the steps of the software authorization authentication method, and their execution process corresponds to the corresponding steps, which will not be described in detail here.

[0173] The software authorization authentication system provided by the embodiment of the present disclosure is adopted, and the License configuration file of the software is obtained, and the License configuration file is parsed to determine the License file, wherein the License file includes a License path that changes dynamically based on the generation time, a key for License encryption and decryption, and an initialization vector; on the one hand, the storage rule of the License file is updated and changed regularly, thereby improving the security protection capability of the License file; the License file is verified; if the verification passes, the software is started, and the License timing refresh thread is started to verify the validity of the current system time, activation time, and authorization validity period, and on the other hand, it is ensured that the software always maintains a legal state during use; if the verification fails, the machine code corresponding to the software is encrypted to generate an activation code, and the activation code is decrypted, and the activation validity period and legality of the License are verified by the encryption option obtained by decryption to start the software, and on the other hand, the flexibility and fault tolerance of software activation are increased through the backup activation path.

[0174] In addition, by regularly updating the storage location of the license file, the problem of offline users attempting to crack license management through software backup and system backup is solved. At the same time, the license file strategy based on secondary obfuscation and scheduled movement of generation time is configured to avoid the failure of license management after the accidental leakage of keys and initialization vectors, thereby improving the security of software authorization authentication.

[0175] An embodiment of the present disclosure further provides an electronic device, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the above method.

[0176] Figure 8 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0177] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803, such as executing the method in the above embodiment. In the RAM 803, various programs and data required for system operation are also stored. The CPU 801, ROM 802 and RAM 803 are connected to each other through a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.

[0178] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.

[0179] The electronic device disclosed in this embodiment includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used to communicate, and the processor and the transceiver are used to run the computer program so that the electronic device executes each step of the above method.

[0180] The above description and accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. Parts and subsamples of some embodiments may be included in or replace parts and subsamples of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" used in this application refers to any and all possible combinations listed in association with one or more. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of a stated sub-sample, whole, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other sub-samples, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0181] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. Technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. Technicians can clearly understand that for the convenience and simplicity of description, the specific working process of the systems, devices and units described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0182] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units can be only a logical function division, and there can be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some sub-samples can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0183] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A software authorization authentication method, characterized in that: include: Obtain the software's license configuration file, which includes the software name, generation time, and license file; Parsing the license file to determine the hardware information, activation time, and authorization validity period of the license, wherein the license file includes a license path that is updated regularly based on the change of the generation time, a key for license encryption and decryption, and an initialization vector; Verify the license file according to the activation time and the authorization validity period; If the verification is passed, the software is started and the license timer refresh thread is started to regularly verify the validity of the current system time, activation time, and authorization validity period; If the verification fails, the machine code corresponding to the software is encrypted to generate an activation code, and the activation code is decrypted. The activation validity period and legality of the license are verified through the encrypted options obtained by decryption to enable the software, wherein the machine code is generated by the hardware information and the license configuration file.

2. The method according to claim 1, characterized in that Before obtaining the software license configuration file, you also need to: Determine the configuration status of the license configuration file; If the configuration status of the license configuration file is "existing", a license verification is performed; If the configuration status of the license configuration file is non-existent, the generation time of the license configuration file is determined according to the current system time, and a license path with a random string folder is generated in combination with the generation time and a random system directory; a built-in Key and IV that conform to the AES algorithm are randomly generated, and random strings of different lengths are inserted into strings corresponding to the built-in Key and IV at different positions to form a key and initialization vector for encryption and decryption of the license through obfuscation; the key and the initialization vector are saved to the random string folder where the license path is located to form the license configuration file.

3. The method according to claim 1, characterized in that Verifying the license file includes: If the current system time is greater than the activation time and less than the authorization validity period, the verification passes; If the current system time is less than the activation time, or the current system time is greater than the authorization validity period, the verification fails.

4. The method according to claim 1, characterized in that: The machine code corresponding to the software is encrypted to generate an activation code, and the activation code is decrypted. The activation validity period and legitimacy of the license are verified through the encrypted options obtained by decryption, including: Generate a machine code according to the license configuration file and the hardware information where the software is located, and encrypt the machine code by using the built-in Key and IV of the AES algorithm; Decrypting the received machine code to obtain the license configuration file and the hardware information; The hardware encryption option, software authorization permission, and the license authorization validity period associated with the hardware information are configured using an authorization tool to generate an activation code to activate the software. The activation code includes the hardware encryption item, software authorization permission, activation time, validity period, hardware information, and license configuration file information.

5. The method according to claim 4, characterized in that After activating the software, it also includes: Parsing the activation code to determine the hardware information in the activation code; Comparing the hardware information in the activation code with the hardware information of the current software based on the hardware encryption item, and verifying the hardware information; If the activation time of the current software is less than or equal to the current system time, determining that the activation time check passes; If the authorization validity period of the current software is greater than or equal to the current system time, determining that the authorization validity period check passes; If the hardware information check, the activation time check, and the authorization validity period check are all passed, the license configuration file is parsed to generate the license file, a license path in the license configuration file is determined based on a generation path of the license file, and the activation code is saved in the license path.

6. The method according to claim 4, characterized in that Generate an activation code, including: Using an authorization tool to configure the current hardware information and determine hardware encryption options, the hardware information at least including a motherboard, a processor, a network card, and a hard disk; Authorize at least one of the software, determine the software authorization rights and the validity period of the license authorization, and the validity period of the license authorization at least includes the activation time and the authorization validity period; The hardware encryption option, the software authorization authority, the activation time, the authorization validity period, the hardware information and the license configuration file information are encrypted using the key and the initialization vector using the AES algorithm to obtain the activation code.

7. The method according to any one of claims 1 to 3, characterized in that: Determine the key and initialization vector for license encryption and decryption, including: Decrypt the machine code using the built-in Key and IV of the AES algorithm using an authorization tool to obtain the License configuration file and the hardware information; Determine the software name and encryption time in the license configuration file, where the encryption time is the first binary data after the license file is obfuscated based on the generation time, and the license configuration file is obfuscated by AES encryption through the hardware information, which is the second binary data; According to the first data, in the second data corresponding to the license configuration file, random character strings of indefinite length are eliminated to determine the key and initialization vector for encryption and decryption of the license.

8. The method according to claim 3, characterized in that After the software is run, it also includes: Triggering a verification task at a preset time interval to verify the license file; If the verification passes, the activation time in the license file is updated, and the license path in the license configuration file is updated based on the generation time, the license file is transferred to the updated license path, and at the same time, the activation time of the license file is updated, and the activation time is the most recent use time of the software; If the verification fails, the license file is deleted, the user is prompted that the license verification has failed, and the use permission of the software is closed.

9. A software authorization authentication system, characterized in that: include: The acquisition module is used to obtain the license configuration file of the software, wherein the license configuration file includes the software name, generation time and license file; A parsing module, used to parse the license file to determine the hardware information, activation time and authorization validity period of the license, wherein the license file includes a license path that is regularly updated based on the change of the generation time, a key for license encryption and decryption, and an initialization vector; A verification module, used to verify the license file according to the activation time and the authorization validity period; The first authorization module is used to enable the software if the verification is passed, and start the license timer refresh thread to regularly verify the validity of the current system time, activation time, and authorization validity period; The second authorization module is used to encrypt the machine code corresponding to the software to generate an activation code, decrypt the activation code, and verify the activation validity period and legitimacy of the license through the encrypted options obtained by decryption to activate the software, wherein the machine code is generated by the hardware information and the license configuration file.

10. An electronic device, characterized in that: include: Processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the method according to any one of claims 1 to 8.