Method and device for obtaining software usage rights
Dual encryption and decryption processes using key pairs in terminal and server interactions ensure secure and cost-effective software authorization in private container deployments.
Patent Information
- Application Number
- CN202210533835.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-16
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2042-05-16
AI Technical Summary
Existing software authorization methods such as serial number verification, network verification, and dongle verification are inadequate for secure and cost-effective software authorization in private container deployment scenarios.
A method involving a terminal and a server that utilize dual encryption and decryption processes using key pairs to generate and decode license files, ensuring secure and accurate software usage rights without additional hardware.
Enhances the accuracy and security of software usage rights by decrypting license files with dual encryption processes, expanding applicability and reducing costs.
Smart Images

Figure CN114880630B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence, specifically cloud computing and cloud native technology, and can be applied to software security and privatized big data scenarios. A method, device, electronic device, and readable storage medium for obtaining software usage rights are provided. Background Art
[0002] In the existing technology, serial number verification, network verification and dongle verification are usually used for software authorization. However, in some special scenarios, such as the scenario of private deployment of containers, if the software used by the container is to be authorized, the above three methods have technical problems of low security and high cost. Summary of the invention
[0003] According to a first aspect of the present disclosure, a method for obtaining software usage rights is provided, including: a terminal obtains a license file corresponding to a target software, the license file comprising a first encryption result and a second encryption result; decrypting the second encryption result based on a second private key to obtain a target key, the second encryption result being obtained by a target server encrypting the target key based on a second public key corresponding to the second private key; decrypting the first encryption result based on a first public key and the target key to obtain target license information, the first encryption result being obtained by the target server encrypting the license information based on a first private key corresponding to the first public key and the target key; and obtaining usage rights for the target software from the target license information.
[0004] According to a second aspect of the present disclosure, a method for obtaining software usage rights is provided, including: a target server receives a license file acquisition request sent by a terminal, and obtains license information according to the license file acquisition request; encrypts the license information using a first private key and a target key to obtain a first encryption result; encrypts the target key using a second public key to obtain a second encryption result; and sends the first encryption result and the second encryption result as a license file to the terminal, so that the terminal obtains the usage rights of the target software according to the license file.
[0005] According to a third aspect of the present disclosure, a device for obtaining software usage rights is provided, which is located in a terminal and includes: an acquisition unit, used to obtain a license file corresponding to a target software, wherein the license file includes a first encryption result and a second encryption result; a first decryption unit, used to decrypt the second encryption result based on a second private key to obtain a target key, wherein the second encryption result is obtained by a target server encrypting the target key based on a second public key corresponding to the second private key; a second decryption unit, used to decrypt the first encryption result based on a first public key and the target key to obtain target license information, wherein the first encryption result is obtained by the target server encrypting the license information based on a first private key corresponding to the first public key and the target key; and a processing unit, used to obtain the usage rights of the target software from the target license information.
[0006] According to a fourth aspect of the present disclosure, a device for obtaining software usage rights is provided, which is located on a target server and includes: a receiving unit, used to receive a license file acquisition request sent by a terminal, and obtain license information according to the license file acquisition request; a first encryption unit, used to encrypt the license information using a first private key and a target key to obtain a first encryption result; a second encryption unit, used to encrypt the target key using a second public key to obtain a second encryption result; and a sending unit, used to send the first encryption result and the second encryption result as a license file to the terminal, so that the terminal can obtain the usage rights of the target software according to the license file.
[0007] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.
[0008] According to a sixth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method as described above.
[0009] According to a seventh aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method as described above when executed by a processor.
[0010] It can be seen from the above technical solution that the present invention obtains usage rights by decrypting the license file containing the first encryption result and the second encryption result through two decryption processes, thereby improving the accuracy of the obtained usage rights and can be applied to various scenarios without the need for other hardware, thereby expanding the scope of use and reducing the cost of obtaining software usage rights.
[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0013] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;
[0014] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;
[0015] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure;
[0016] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure;
[0017] Figure 5 is a schematic diagram according to a fifth embodiment of the present disclosure;
[0018] Figure 6 is a schematic diagram according to a sixth embodiment of the present disclosure;
[0019] Figure 7 The block diagram is a block diagram of an electronic device used to implement the method for obtaining software usage rights according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and mechanisms is omitted in the following description.
[0021] Figure 1 Schematic diagram of the first embodiment of the present disclosure. Figure 1 As shown, the method for obtaining software usage rights in this embodiment specifically includes the following steps:
[0022] S101, obtaining a license file corresponding to the target software, wherein the license file includes a first encryption result and a second encryption result;
[0023] S102: decrypt the second encryption result based on the second private key to obtain a target key, where the second encryption result is obtained by encrypting the target key based on the second public key corresponding to the second private key by the target server;
[0024] S103: decrypt the first encryption result based on the first public key and the target secret key to obtain target license information, where the first encryption result is obtained by the target server encrypting the license information based on the first private key corresponding to the first public key and the target secret key;
[0025] S104: Acquire the use authority of the target software from the target license information.
[0026] The executor of the method for obtaining software usage rights in this embodiment is a terminal. The terminal decrypts the license file based on the second private key, the first public key and the target secret key to obtain the target license information, and then obtains the usage rights of the target software from the target license information, so that the terminal uses the target software according to the obtained usage rights. This embodiment obtains the usage rights by decrypting the license file containing the first encryption result and the second encryption result through two decryption processes, thereby improving the accuracy of the obtained usage rights and can be applied to various scenarios without the need for other hardware, thereby expanding the scope of use and reducing the cost of obtaining software usage rights.
[0027] The terminal of this embodiment is any terminal that can run software, such as a laptop, a desktop, a smart phone, etc.; the terminal of this embodiment can also be a container running on a physical machine, such as a container deployed in a Kubernetes (K8S) environment.
[0028] It can be understood that if the terminal in this embodiment is a container deployed in a K8S environment, in order for the container to successfully achieve the purpose of obtaining software usage rights, after placing the license file in the configuration directory of the target software, it is also necessary to map the license file to the container directory through storage mounting, and configure the container's network mode to host mode.
[0029] That is to say, the executor of the method for obtaining software usage rights in this embodiment can be a container deployed in a K8S environment. The container does not need to rely on other hardware and can achieve the purpose of obtaining the usage rights of the target software by executing the above steps S101 to S104.
[0030] When executing S101 to obtain the license file corresponding to the target software, the terminal of this embodiment may use the software to be currently started as the target software, and then obtain the license file corresponding to the target software.
[0031] The license file obtained by the terminal executing S101 in this embodiment includes a first encryption result and a second encryption result; wherein the first encryption result is the result of the target server encrypting the license information, and the second encryption result is the result of the target server encrypting the target key.
[0032] When the terminal of this embodiment executes S101 to obtain the license file corresponding to the target software, an optional implementation method that can be adopted is: sending a license file acquisition request to the target server corresponding to the target software, and the license file acquisition request is used by the target server to obtain the corresponding license information to generate a license file; receiving the license file sent by the target server as the license file corresponding to the target software.
[0033] Among them, the license file acquisition request sent by the terminal of this embodiment to the target server during execution S101 may also include identification information corresponding to the terminal, such as the ID and UID of the user using the terminal. The identification information is used by the target server to obtain the corresponding license information and then generate a license file based on the obtained license information.
[0034] That is to say, when starting the target software, the terminal of this embodiment can obtain the license file in real time by sending a license file acquisition request to the target server corresponding to the target software, thereby ensuring that the obtained license file has a high timeliness and further improving the accuracy of the obtained usage rights.
[0035] When the terminal of this embodiment executes S101 to obtain the license file corresponding to the target software, it can also obtain it according to the configuration directory corresponding to the target software, that is, the license file corresponding to the target software can be pre-stored locally in the terminal, and after determining the path for storing the license file through the configuration directory, the license file can be found according to the path.
[0036] That is to say, the terminal of this embodiment will locally store the license file corresponding to the target software, that is, when the terminal obtains the target software through the target server, it will also obtain the license file together, so there is no need for the terminal to send a license file acquisition request to the target server, which can simplify the license file acquisition steps.
[0037] After executing S101 to obtain the license file corresponding to the target software, the terminal of this embodiment executes S102 to decrypt the second encryption result based on the second private key to obtain the target key; wherein the target key obtained in this embodiment is used to obtain the digital signature of the license file and the license information contained in the license file from the first encryption result.
[0038] This embodiment involves three types of keys, namely the first key pair, the second key pair and the target key; the target key is a key randomly generated by the target server when generating a license file; the first key pair includes a first public key and a first private key, the first public key is located in the terminal, and the first private key is located in the target server; the second key pair includes a second public key and a second private key, the second public key is located in the target server, and the second private key is located in the terminal.
[0039] Among them, the first public key and the second private key located in the terminal can be pre-encoded into the program of the target software. Therefore, the terminal of this embodiment can obtain the first public key for decrypting the first encryption result and the second private key for decrypting the second encryption result through the program of the target software.
[0040] It can be understood that if the license file obtained by the terminal executing S101 of this embodiment is encoded by the target server through a preset encoding method (such as Base64), when the terminal of this embodiment executes S102, it first decodes the second encryption result through a decoding method corresponding to the preset encoding method, and then decrypts the second encryption result based on the second private key to obtain the target key.
[0041] After executing S102 to obtain the target key, the terminal of this embodiment executes S103 to decrypt the first encryption result based on the first public key and the target key to obtain the target license information; the target license information obtained in this embodiment includes permission information such as software usage time and software usage scope, and may also include terminal attribute information, target verification method, user information and other content.
[0042] Specifically, when the terminal of this embodiment executes S103 to decrypt the first encryption result based on the first public key and the target key to obtain the target license information, the optional methods that can be adopted are: decrypting the first encryption result based on the target key to obtain the digital signature and license information; decrypting the digital signature based on the first public key to obtain the first information summary; obtaining the second information summary based on the license information, for example, using a hash algorithm to process the license information, and using the processing result as the second information summary; when it is determined that the first information summary is consistent with the second information summary, using the obtained license information as the target license information.
[0043] That is to say, this embodiment combines two types of keys to decrypt the license file, and verifies the license file after decryption. If the verification passes, the license information contained in the license file is used as the target license information to ensure that the obtained target license information has not been tampered with, thereby improving the accuracy of the obtained usage rights.
[0044] It can be understood that if the license file obtained by the terminal executing S101 of this embodiment is encoded by the target server through a preset encoding method (such as Base64), when the terminal of this embodiment executes S103, it first decodes the first encryption result through a decoding method corresponding to the preset encoding method, and then decrypts the first encryption result based on the first public key and the target secret key, thereby obtaining the target license information.
[0045] In addition, when the terminal of this embodiment executes S103, if it is determined that the first information digest is different from the second information digest, indicating that the license information has been tampered with, it can resend the license file acquisition request to the target server and then perform decryption of the newly acquired license file.
[0046] After executing S103 to obtain the target license information, the terminal of this embodiment executes S104 to obtain the use authority of the target software from the target license information.
[0047] When the terminal of this embodiment executes S104 to obtain the use right of the target software from the target license information, it can directly obtain the software use time, software use scope and other information contained in the target license information as the use right of the target software.
[0048] When the terminal of this embodiment executes S104 to obtain the right to use the target software from the target license information, it can also adopt the following method: obtain the terminal attribute information in the target license information, such as the terminal's MAC address, CPU serial number, motherboard number and other information; according to the target verification mode, compare the obtained terminal attribute information with the local terminal attribute information of the terminal; when it is determined that the comparison result meets the verification requirements corresponding to the target verification mode, obtain the right to use the target software from the target license information.
[0049] The target verification mode used by the terminal in this embodiment when executing S104 may be preset by the terminal or obtained from the target license information; different verification modes correspond to different verification contents and different verification modes correspond to different verification requirements.
[0050] For example, if the target verification mode is 001, the present embodiment can verify the mac address, CPU serial number and motherboard number, and determine that the verification requirements are met when any one of the verifications passes; if the target verification mode is 111, the present embodiment can verify the mac address, CPU serial number and motherboard number, and determine that the verification requirements are met when all the verifications pass; if the target verification mode is 102, the present embodiment can only verify the mac address, and determine that the verification requirements are met when the mac address verification passes; if the target verification mode is 103, the present embodiment can verify the CPU serial number and motherboard number, and determine that the verification requirements are met when both of them pass; if the target verification mode is 104, the present embodiment can only verify the motherboard number, and determine that the verification requirements are met when the motherboard number verification passes.
[0051] That is to say, after decrypting the license file to obtain the target license information, the terminal of this embodiment can also perform a secondary verification based on the specific content in the target license information, and if it is determined that the secondary verification passes, it can obtain permission information such as software usage time and software usage scope from the target license information, further improving the security of software verification.
[0052] After executing S104 to obtain the use authority of the target software, the terminal of this embodiment can use the target software according to the use authority, for example, log in to the software within the software use time, use the services provided within the software use scope, etc.
[0053] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure. Figure 2 As shown, the method for obtaining software usage rights in this embodiment specifically includes the following steps:
[0054] S201, receiving a license file acquisition request sent by a terminal, and acquiring license information according to the license file acquisition request;
[0055] S202, encrypting the license information based on the first private key and the target secret key to obtain a first encryption result;
[0056] S203, encrypting the target secret key based on the second public key to obtain a second encryption result;
[0057] S204: Send the first encryption result and the second encryption result as a license file to the terminal, so that the terminal can obtain the right to use the target software according to the license file.
[0058] The executor of the method for obtaining software usage rights in this embodiment is the target server. After receiving the license file sent by the terminal, the target server first obtains the license information, then encrypts the license information based on the first private key and the target key to obtain a first encryption result, and then encrypts the target key based on the second public key to obtain a second encryption result. Finally, the first encryption result and the second encryption result are sent to the terminal as a license file. The server in this embodiment obtains the license file by using two encryption processes, which effectively avoids the problem of the license file being tampered with, thereby enhancing the security of the license file.
[0059] The license file acquisition request sent by the terminal and received by the target server in S201 in this embodiment may also include the attribute information of the terminal, the user information of the terminal and the target verification mode.
[0060] After the target server of this embodiment executes S201 to receive the license file acquisition request sent by the terminal, it can obtain corresponding license information, such as software usage time, software usage scope and other permission information according to the license file acquisition request; because different terminals have different purchase situations, such as different usage time and different usage scope, different terminals in this embodiment correspond to different license information.
[0061] After executing S201 to obtain the license information, the target server of this embodiment executes S202 to encrypt the license information based on the first private key and the target secret key to obtain a first encryption result.
[0062] It can be understood that when the target server of this embodiment obtains the target software at the terminal, it can also simultaneously generate the first key pair and the second key pair, and encode the first public key of the first key pair and the second private key of the second key pair into the program of the target software, and save the first private key of the first key pair and the second public key of the second key pair in the target server.
[0063] Specifically, when the target server of this embodiment executes S202 to encrypt the license information based on the first private key and the target key to obtain the first encryption result, the optional implementation method that can be adopted is: using the randomly generated key as the target key; obtaining the second information summary based on the license information; encrypting the second information summary based on the first private key to obtain a digital signature; encrypting the digital signature and the license information based on the target key to obtain the first encryption result.
[0064] Among them, when the target server of this embodiment executes S202 to encrypt the digital signature and license information based on the target key to obtain the first encryption result, the optional implementation method that can be adopted is: obtain the information plaintext according to the digital signature and license information; encrypt the information plaintext based on the target key, and use the encrypted information ciphertext as the first encryption result.
[0065] That is, when the target server of this embodiment obtains the first encryption result, it will also use the randomly generated target key to encrypt the license file, thereby increasing the complexity of the encryption process and improving the security of the obtained encryption result.
[0066] It is understandable that, after executing S202 to obtain the first encryption result, the target server of this embodiment may further encode the first encryption result using a preset encoding method (eg, Base64) to obtain an encoding result of the first encryption result.
[0067] After executing S202 to obtain the first encryption result, the target server of this embodiment executes S203 to encrypt the target secret key based on the second public key to obtain a second encryption result.
[0068] That is to say, the target server of this embodiment encrypts the target secret key by using the second public key, thereby ensuring that the target secret key will not be leaked during the transmission of the license file, thereby further improving the security of the license file.
[0069] It is understandable that, after executing S203 to obtain the second encryption result, the target server of this embodiment may further encode the second encryption result using a preset encoding method (eg, Base64) to obtain an encoding result of the second encryption result.
[0070] After executing S203 to obtain the second encryption result, the target server of this embodiment executes S204 to send the first encryption result and the second encryption result as a license file to the terminal, so that the terminal can obtain the use right of the target software according to the license file.
[0071] That is to say, the license file sent by the target server of this embodiment to the terminal includes two types of encryption results. Different encryption results are decrypted in different ways to obtain corresponding decryption results, which can enhance the reliability of the generated license file and make it less likely to be tampered with.
[0072] In addition, when the terminal obtains the target software, the target server of this embodiment can generate a license file in the order of obtaining license information, obtaining a first encryption result, and obtaining a second encryption result, so that when the target software is sent to the terminal, the generated license file is sent to the terminal at the same time, so that the terminal no longer needs to send an additional acquisition request to the target server to obtain the license file corresponding to the target software.
[0073] Figure 3 is a schematic diagram according to a second embodiment of the present disclosure. Figure 3 The flowchart of the target server when generating a license file is shown: after obtaining the license information, a hash algorithm is used to obtain a second information summary corresponding to the license file; the second information summary is encrypted based on the first private key to obtain a digital signature; plain text information is obtained based on the digital signature and the license information; a randomly generated key is used as the target key; the plain text information is encrypted based on the target key to obtain cipher text information (i.e., a first encryption result); the target key is encrypted based on the second public key to obtain a second encryption result; the first encryption result and the second encryption result are encoded by a preset encoding method to obtain the license file.
[0074] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure. Figure 4 The flowchart of a terminal obtaining usage rights according to a license file is shown: obtaining a license file; decoding the license file using a decoding method corresponding to a preset encoding method to obtain a first encryption result and a second encryption result; decrypting the second encryption result based on a second private key to obtain a target key; decrypting the first encryption result based on the target key to obtain a digital signature and license information; decrypting the digital signature based on a first public key to obtain a first information summary; processing the license information using a hash algorithm to obtain a second information summary; comparing the first information summary with the second information summary, and when determining that the two are consistent, indicating that the license file has not been tampered with, the license information is used as the target license information.
[0075] Figure 5 is a schematic diagram according to the fifth embodiment of the present disclosure. Figure 5 As shown, the software usage permission acquisition device 500 of this embodiment is located in the terminal and includes:
[0076] An acquisition unit 501 is used to acquire a license file corresponding to the target software, wherein the license file includes a first encryption result and a second encryption result;
[0077] A first decryption unit 502 is used to decrypt the second encryption result based on a second private key to obtain a target key, where the second encryption result is obtained by encrypting the target key based on a second public key corresponding to the second private key by the target server;
[0078] A second decryption unit 503 is used to decrypt the first encryption result based on a first public key and the target secret key to obtain target license information, wherein the first encryption result is obtained by the target server encrypting the license information based on a first private key corresponding to the first public key and the target secret key;
[0079] The processing unit 504 is configured to obtain the use permission of the target software from the target license information.
[0080] When acquiring the license file corresponding to the target software, the acquisition unit 501 may take the software to be currently started as the target software, and then acquire the license file corresponding to the target software.
[0081] The license file obtained by the obtaining unit 501 includes a first encryption result and a second encryption result; wherein the first encryption result is a result of the target server encrypting the license information, and the second encryption result is a result of the target server encrypting the target key.
[0082] When acquiring the license file corresponding to the target software, the acquisition unit 501 may adopt the optional implementation mode of: sending a license file acquisition request to a target server corresponding to the target software; and receiving the license file sent by the target server as the license file corresponding to the target software.
[0083] The license file acquisition request sent by the acquisition unit 501 to the target server may also include identification information corresponding to the terminal, and the identification information is used by the target server to acquire corresponding license information and then generate a license file according to the acquired license information.
[0084] That is, when starting the target software, the acquisition unit 501 can acquire the license file in real time by sending a license file acquisition request to the target server corresponding to the target software, thereby ensuring that the acquired license file has high timeliness and further improving the accuracy of the acquired usage rights.
[0085] When acquiring the license file corresponding to the target software, the acquisition unit 501 can also acquire it according to the configuration directory corresponding to the target software, that is, the license file corresponding to the target software can be pre-stored locally in the terminal. After determining the path for storing the license file through the configuration directory, the license file can be found according to the path.
[0086] That is to say, the terminal of this embodiment will locally store the license file corresponding to the target software, that is, when the terminal obtains the target software through the target server, it will also obtain the license file together, so there is no need for the terminal to send a license file acquisition request to the target server, which can simplify the license file acquisition steps.
[0087] After the terminal of this embodiment obtains the license file corresponding to the target software by the acquisition unit 501, the first decryption unit 502 decrypts the second encryption result based on the second private key to obtain the target key; wherein the target key obtained by the first decryption unit 502 is used to obtain the digital signature of the license file and the license information contained in the license file from the first encryption result.
[0088] It can be understood that if the license file obtained by the acquisition unit 501 is encoded by the target server through a preset encoding method (such as Base64), the first decryption unit 502 first decodes the second encryption result through a decoding method corresponding to the preset encoding method, and then decrypts the second encryption result based on the second private key to obtain the target secret key.
[0089] After the terminal of this embodiment obtains the target key by the first decryption unit 502, the second decryption unit 503 decrypts the first encryption result based on the first public key and the target key to obtain the target license information; the target license information obtained by the second decryption unit 503 includes permission information such as software usage time and software usage scope, and may also include terminal attribute information, target verification method, user information and other content.
[0090] Specifically, when the second decryption unit 503 decrypts the first encryption result based on the first public key and the target secret key to obtain the target license information, the optional methods that can be adopted are: decrypting the first encryption result based on the target secret key to obtain the digital signature and license information; decrypting the digital signature based on the first public key to obtain the first information summary; obtaining the second information summary based on the license information; when it is determined that the first information summary is consistent with the second information summary, using the obtained license information as the target license information.
[0091] That is to say, the second decryption unit 503 decrypts the license file by combining two types of keys, and verifies the license file after decryption. If the verification passes, the license information contained in the license file is used as the target license information to ensure that the obtained target license information has not been tampered with, thereby improving the accuracy of the obtained usage rights.
[0092] It can be understood that if the license file obtained by the acquisition unit 501 is encoded by the target server through a preset encoding method (such as Base64), the second decryption unit 503 first decodes the first encryption result through a decoding method corresponding to the preset encoding method, and then decrypts the first encryption result based on the first public key and the target secret key to obtain the target license information.
[0093] In addition, if the second decryption unit 503 determines that the first information digest is different from the second information digest, indicating that the license information has been tampered with, it can resend the license file acquisition request to the target server and then perform decryption on the newly acquired license file.
[0094] After the second decryption unit 503 obtains the target license information, the processing unit 504 of the terminal in this embodiment obtains the use authority of the target software from the target license information.
[0095] When the processing unit 504 obtains the use rights of the target software from the target license information, it may directly obtain information such as the software use time and the software use scope contained in the target license information as the use rights of the target software.
[0096] When the processing unit 504 obtains the right to use the target software from the target license information, it can also adopt the following method: obtain the terminal attribute information in the target license information; compare the obtained terminal attribute information with the local terminal attribute information of the terminal according to the target verification mode; when it is determined that the comparison result meets the verification requirements corresponding to the target verification mode, obtain the right to use the target software from the target license information.
[0097] The target verification mode used by the processing unit 504 may be pre-set by the terminal or obtained from the target license information; different verification modes correspond to different verification contents and different verification modes correspond to different verification requirements.
[0098] That is to say, after decrypting the license file to obtain the target license information, the processing unit 504 can also perform a secondary verification based on the specific content in the target license information, and when it is determined that the secondary verification passes, obtain the software usage time, software usage scope and other permission information from the target license information, thereby further improving the security of software verification.
[0099] After the processing unit 504 obtains the use authority of the target software, the terminal can use the target software according to the use authority, for example, log in to the software within the software use time, use the services provided within the software use scope, etc.
[0100] Figure 6 is a schematic diagram according to the sixth embodiment of the present disclosure. Figure 6 As shown, the software usage permission acquisition device 600 of this embodiment is located on the target server and includes:
[0101] The receiving unit 601 is used to receive a license file acquisition request sent by a terminal, and acquire license information according to the license file acquisition request;
[0102] A first encryption unit 602 is used to encrypt the license information based on a first private key and a target secret key to obtain a first encryption result;
[0103] The second encryption unit 603 is used to encrypt the target secret key based on the second public key to obtain a second encryption result;
[0104] The sending unit 604 is configured to send the first encryption result and the second encryption result as a license file to the terminal, so that the terminal can obtain the right to use the target software according to the license file.
[0105] The license file acquisition request sent by the terminal and received by the receiving unit 601 may also include the attribute information of the terminal, the user information of the terminal and the target verification mode.
[0106] After receiving the license file acquisition request sent by the terminal, the receiving unit 601 can obtain the corresponding license information, such as the software usage time, software usage scope and other permission information according to the license file acquisition request; because different terminals have different purchase situations, such as purchasing different usage time and different usage scope, different terminals in this embodiment correspond to different license information.
[0107] After the receiving unit 601 obtains the license information, the first encryption unit 602 of the target server of this embodiment encrypts the license information based on the first private key and the target secret key to obtain a first encryption result.
[0108] Specifically, when the first encryption unit 602 encrypts the license information based on the first private key and the target key to obtain the first encryption result, an optional implementation method that can be adopted is: using the randomly generated key as the target key; obtaining the second information summary based on the license information; encrypting the second information summary based on the first private key to obtain a digital signature; encrypting the digital signature and the license information based on the target key to obtain the first encryption result.
[0109] Among them, when the first encryption unit 602 encrypts the digital signature and license information based on the target key to obtain the first encryption result, the optional implementation method that can be adopted is: obtain the information plaintext according to the digital signature and license information; use the target key to encrypt the information plaintext, and use the encrypted information ciphertext as the first encryption result.
[0110] That is, when obtaining the first encryption result, the first encryption unit 602 will also use the randomly generated target key to encrypt the license file, thereby increasing the complexity of the encryption process and improving the security of the obtained encryption result.
[0111] It is understandable that after the first encryption unit 602 obtains the first encryption result, it can also encode the first encryption result using a preset encoding method (such as Base64) to obtain an encoding result of the first encryption result.
[0112] After the target server of this embodiment obtains the first encryption result by the first encryption unit 602, the second encryption unit 603 encrypts the target secret key based on the second public key to obtain the second encryption result.
[0113] That is, the second encryption unit 603 encrypts the target key by using the second public key, thereby ensuring that the target key will not be leaked during the transmission of the license file, thereby further improving the security of the license file.
[0114] It is understandable that after obtaining the second encryption result, the second encryption unit 603 may further encode the second encryption result using a preset encoding method (such as Base64) to obtain an encoding result of the second encryption result.
[0115] After the target server of this embodiment obtains the second encryption result by the second encryption unit 603, the sending unit 604 sends the first encryption result and the second encryption result as a license file to the terminal, so that the terminal obtains the right to use the target software according to the license file.
[0116] That is, the license file sent by the sending unit 604 to the terminal includes two types of encryption results. Different encryption results are decrypted in different ways to obtain corresponding decryption results, which can enhance the reliability of the generated license file and make it less likely to be tampered with.
[0117] In addition, when the terminal obtains the target software, the target server of this embodiment can generate a license file in the order of obtaining license information, obtaining a first encryption result, and obtaining a second encryption result, so that when the target software is sent to the terminal, the generated license file is sent to the terminal at the same time, so that the terminal no longer needs to send an additional acquisition request to the target server to obtain the license file corresponding to the target software.
[0118] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0119] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0120] like Figure 7 , is a block diagram of an electronic device according to a method for obtaining software usage rights according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0121] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0122] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0123] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as a method for obtaining software usage rights. For example, in some embodiments, the method for obtaining software usage rights may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708.
[0124] In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the method for obtaining software usage rights described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the method for obtaining software usage rights in any other appropriate manner (e.g., by means of firmware).
[0125] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0126] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable software use permission acquisition device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0127] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0128] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0129] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0130] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server for a distributed system, or a server combined with a blockchain.
[0131] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0132] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for obtaining software use rights, comprising: The terminal obtains a license file corresponding to the target software, wherein the license file includes a first encryption result and a second encryption result; Decrypting the second encryption result based on the second private key to obtain a target secret key, where the second encryption result is obtained by encrypting the target secret key by the target server based on the second public key corresponding to the second private key; Decrypting the first encryption result based on the first public key and the target secret key to obtain target license information, wherein the first encryption result is obtained by the target server encrypting the license information based on the first private key corresponding to the first public key and the target secret key; Acquire the use permission of the target software from the target license information; The decrypting the first encryption result based on the first public key and the target secret key to obtain the target license information includes: Decrypting the first encryption result based on the target key to obtain a digital signature and license information; Decrypting the digital signature based on the first public key to obtain a first information summary; Obtaining a second information summary according to the license information; When it is determined that the first information digest is consistent with the second information digest, the license information is used as the target license information.
2. The method according to claim 1, wherein: The obtaining of the license file corresponding to the target software comprises: Sending a license file acquisition request to a target server corresponding to the target software; The license file sent by the target server is received as the license file corresponding to the target software.
3. The method according to claim 1, wherein: The step of obtaining the use permission of the target software from the target license information includes: Acquire terminal attribute information in the target license information; According to the target verification mode, comparing the acquired terminal attribute information with the local terminal attribute information of the terminal; In the case where it is determined that the comparison result satisfies the verification requirement corresponding to the target verification mode, the use permission of the target software is obtained from the target license information.
4. A method for obtaining software use rights, comprising: The target server receives the license file acquisition request sent by the terminal, and acquires the license information according to the license file acquisition request; Encrypting the license information based on the first private key and the target secret key to obtain a first encryption result; Encrypting the target secret key based on the second public key to obtain a second encryption result; Sending the first encryption result and the second encryption result as a license file to the terminal, so that the terminal can obtain the right to use the target software according to the license file; The step of encrypting the license information based on the first private key and the target secret key to obtain a first encryption result includes: Using the randomly generated key as the target key; Obtaining a second information summary according to the license information; Encrypting the second information digest based on the first private key to obtain a digital signature; Obtaining information plaintext according to the digital signature and the license information; The information plaintext is encrypted based on the target secret key, and the encrypted information ciphertext is used as the first encryption result.
5. A device for obtaining software use rights, located in a terminal, comprising: An acquisition unit, used to acquire a license file corresponding to the target software, wherein the license file includes a first encryption result and a second encryption result; A first decryption unit is used to decrypt the second encryption result based on a second private key to obtain a target key, where the second encryption result is obtained by encrypting the target key by the target server based on a second public key corresponding to the second private key; A second decryption unit is used to decrypt the first encryption result based on a first public key and the target secret key to obtain target license information, wherein the first encryption result is obtained by the target server encrypting the license information based on a first private key corresponding to the first public key and the target secret key; A processing unit, configured to obtain the use permission of the target software from the target license information; Wherein, when the second decryption unit decrypts the first encryption result based on the first public key and the target secret key to obtain the target license information, specifically executes: Decrypting the first encryption result based on the target key to obtain a digital signature and license information; Decrypting the digital signature based on the first public key to obtain a first information summary; Obtaining a second information summary according to the license information; When it is determined that the first information digest is consistent with the second information digest, the license information is used as the target license information.
6. The device according to claim 5, wherein: When acquiring the license file corresponding to the target software, the acquisition unit specifically performs: Sending a license file acquisition request to a target server corresponding to the target software; The license file sent by the target server is received as the license file corresponding to the target software.
7. The device according to claim 5, wherein: When the processing unit obtains the use right of the target software from the target license information, the processing unit specifically performs: Acquire terminal attribute information in the target license information; According to the target verification mode, comparing the acquired terminal attribute information with the local terminal attribute information of the terminal; In the case where it is determined that the comparison result satisfies the verification requirement corresponding to the target verification mode, the use permission of the target software is obtained from the target license information.
8. A device for obtaining software use rights, located on a target server, comprising: A receiving unit, configured to receive a license file acquisition request sent by a terminal, and acquire license information according to the license file acquisition request; A first encryption unit, configured to encrypt the license information based on a first private key and a target secret key to obtain a first encryption result; A second encryption unit, used to encrypt the target secret key based on a second public key to obtain a second encryption result; a sending unit, configured to send the first encryption result and the second encryption result as a license file to the terminal, so that the terminal can obtain the right to use the target software according to the license file; Wherein, when the first encryption unit encrypts the license information based on the first private key and the target secret key to obtain a first encryption result, specifically executes: Using the randomly generated key as the target key; Obtaining a second information summary according to the license information; Encrypting the second information digest based on the first private key to obtain a digital signature; Obtaining information plaintext according to the digital signature and the license information; The information plaintext is encrypted based on the target secret key, and the encrypted information ciphertext is used as the first encryption result.
9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 4.
11. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Data encryption and decryption method, device and system
CN109462472A
Electronic equipment and digital file management method
CN111506882A
