CN112685699A - Software registration method and device and software registration code generation method and device - Google Patents

Software registration method and device and software registration code generation method and device Download PDF

Info

Publication number
CN112685699A
CN112685699A CN202011622937.4A CN202011622937A CN112685699A CN 112685699 A CN112685699 A CN 112685699A CN 202011622937 A CN202011622937 A CN 202011622937A CN 112685699 A CN112685699 A CN 112685699A
Authority
CN
China
Prior art keywords
registration
software
identifier
registered
algorithm
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011622937.4A
Other languages
Chinese (zh)
Other versions
CN112685699B (en
Inventor
崔超
许卓
赵云
肖勇
林伟斌
徐迪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Southern Power Grid Co Ltd
Research Institute of Southern Power Grid Co Ltd
Original Assignee
China Southern Power Grid Co Ltd
Research Institute of Southern Power Grid Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Southern Power Grid Co Ltd, Research Institute of Southern Power Grid Co Ltd filed Critical China Southern Power Grid Co Ltd
Priority to CN202011622937.4A priority Critical patent/CN112685699B/en
Publication of CN112685699A publication Critical patent/CN112685699A/en
Application granted granted Critical
Publication of CN112685699B publication Critical patent/CN112685699B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a software registration method and a device thereof, and a software registration code generation method and a device thereof, wherein the software registration method is applied to first equipment, and comprises the following steps: if the verification code passes the verification, acquiring registration parameters of the software to be registered, and processing the registration parameters by using an SM3 algorithm to obtain a first registration identifier; sending the first registration identifier to the second device to obtain a registration code and a decryption key; decrypting the registration code by using the decryption key according to the SM2 algorithm to obtain a second registration identifier and obtain the current actual time; if the current actual time is less than the software service life, the first registration identifier and the software service life are used as the input of an SM3 algorithm to obtain a third registration identifier; and if the third registration identifier is matched with the second registration identifier, completing the registration of the software to be registered. By applying the method provided by the invention, whether the software to be registered is overdue or not can be accurately determined in the process of verifying the registration code.

Description

Software registration method and device and software registration code generation method and device
Technical Field
The invention relates to the technical field of computer application, in particular to a software registration method and device and a software registration code generation method and device.
Background
With the development of scientific technology, computer application technology has been developed, software developers have developed a large amount of application software, and the software developers can authorize users to use the developed application software, so that the users can use the authorized application software to perform corresponding production activities or entertainment activities. However, with the development of software inverse analysis technology and its related analysis tools, application software becomes very easy to crack.
In order to protect software copyright of software developers, in the prior art, a software registration code is generally generated by using a machine code of a device, the registration code of the software is verified, and the registration of the software is completed after the registration code is successfully verified.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a software registration method, which can accurately determine whether the software to be registered is overdue or not in the process of verifying the registration code.
The invention also provides a software registration device used for ensuring the realization and the application of the method in practice.
A software registration method applied to a first device, the method comprising:
responding to a software registration instruction, and sending a software registration request of software to be registered corresponding to the registration instruction to preset second equipment so as to obtain a verification code fed back by the second equipment based on the software registration request;
acquiring registration parameters of the software to be registered under the condition that the verification code passes verification, and taking the registration parameters as the input of a preset SM3 algorithm to obtain a first registration identifier output by the SM3 algorithm;
sending the first registration identifier to the second device to trigger the second device to feed back the registration code of the software to be registered and the decryption key of the registration code based on the first registration identifier;
decrypting the registration code by applying a preset SM2 algorithm based on the decryption key to obtain a second registration identifier and the current actual time;
under the condition that the current actual time is less than the software service life of the software to be registered, taking the first registration identifier and the software service life as the input of the SM3 algorithm to obtain a third registration identifier output by the SM3 algorithm;
judging whether the third registration identification is matched with the second registration identification;
and if the third registration identifier is matched with the second registration identifier, binding the software to be registered with the first equipment to complete the registration of the software to be registered.
The method described above, optionally, is a process of verifying the verification code, and includes:
acquiring software version information of the software to be registered;
matching the software version information with the verification code;
if the software version information is successfully matched with the verification code, the verification code is determined to pass verification;
and if the software version information is unsuccessfully matched with the verification code, determining that the verification code is not verified.
Optionally, the obtaining of the registration parameter of the software to be registered includes:
acquiring a user identifier contained in the software registration instruction, and acquiring an MAC address and a disk serial number of the first device;
and forming the registration parameters of the software to be registered by the user identification, the MAC address and the disk serial number.
Optionally, the determining whether the third registration identifier matches the second registration identifier includes:
comparing the third registration identifier with the second registration identifier;
if the third registration identifier is consistent with the second registration identifier, determining that the third registration identifier is matched with the second registration identifier;
and if the third registration identifier is inconsistent with the second registration identifier, determining that the third registration identifier is not matched with the second registration identifier.
The above method, optionally, further includes:
and under the condition that the current actual time is more than or equal to the preset software service life, terminating the software to be registered, and sending a software expiration prompt message to the user.
A software registration apparatus applied to a first device, the apparatus comprising:
the first sending unit is used for responding to a software registration instruction, sending a software registration request of software to be registered corresponding to the registration instruction to preset second equipment so as to obtain an authentication code fed back by the second equipment based on the software registration request;
the acquisition unit is used for acquiring the registration parameters of the software to be registered under the condition that the verification code passes the verification, and taking the registration parameters as the input of a preset SM3 algorithm to obtain a first registration identifier output by the SM3 algorithm;
a second sending unit, configured to send the first registration identifier to the second device, so as to trigger the second device to feed back, based on the first registration identifier, a registration code of the software to be registered and a decryption key of the registration code;
the decryption unit is used for decrypting the registration code based on the decryption key by applying a preset SM2 algorithm to obtain a second registration identifier;
a second obtaining unit, configured to obtain a current actual time, and when the current actual time is less than a software lifetime of the software to be registered, use the first registration flag and the software lifetime as inputs of the SM3 algorithm to obtain a third registration flag output by the SM3 algorithm;
the judging unit is used for judging whether the third registration identification is matched with the second registration identification;
and the registration unit is used for binding the software to be registered with the first equipment if the third registration identifier is matched with the second registration identifier, so as to complete the registration of the software to be registered.
The above apparatus, optionally, further includes a verification unit, where the verification unit is configured to obtain software version information of the software to be registered; matching the software version information with the verification code; if the software version information is successfully matched with the verification code, the verification code is determined to pass verification; and if the software version information is unsuccessfully matched with the verification code, determining that the verification code is not verified.
The above apparatus, optionally, the obtaining unit that obtains the registration parameter of the software to be registered includes:
the acquisition subunit is used for acquiring the user identifier contained in the software registration instruction and acquiring the MAC address and the disk serial number of the first device;
and the execution subunit is configured to combine the user identifier, the MAC address, and the disk serial number into a registration parameter corresponding to the first device.
A software registration code generation method is applied to a second device, and comprises the following steps:
when a first registration identifier sent by first equipment is received, determining the service life of software corresponding to the first registration identifier; the first registration identifier is obtained by the first device performing hash operation on registration parameters of software to be registered according to an SM3 algorithm; the registration parameters comprise user identification, the MAC address of the first equipment and the disk serial number of the first equipment;
taking the first registration identifier and the software service life as the input of a preset SM3 algorithm to obtain a fourth registration identifier output by the SM3 algorithm;
and encrypting the fourth registration identifier by using a preset encryption key of an SM2 algorithm to generate a registration code of the software to be registered.
A software registration code generation apparatus applied to a second device, the apparatus comprising:
the device comprises a receiving unit, a judging unit and a judging unit, wherein the receiving unit is used for determining the service life of software corresponding to a first registration identifier when the first registration identifier sent by first equipment is received; the first registration identifier is obtained by the first device performing hash operation on registration parameters of software to be registered according to an SM3 algorithm; the registration parameters comprise user identification, the MAC address of the first equipment and the disk serial number of the first equipment;
the processing unit is used for taking the first registration identifier and the software service life as the input of a preset SM3 algorithm to obtain a fourth registration identifier output by the SM3 algorithm;
and the second generation unit is used for encrypting the fourth registration identifier by applying a pre-generated encryption key of the SM2 algorithm to generate a registration code of the software to be registered.
The invention provides a software registration method, which comprises the following steps: responding to a software registration instruction, and sending a software registration request of software to be registered corresponding to the registration instruction to preset second equipment so as to obtain a verification code fed back by the second equipment based on the software registration request; acquiring registration parameters of the software to be registered under the condition that the verification code passes verification, and taking the registration parameters as the input of a preset SM3 algorithm to obtain a first registration identifier output by the SM3 algorithm; sending the first registration identifier to the second device to trigger the second device to feed back the registration code of the software to be registered and the decryption key of the registration code based on the first registration identifier; decrypting the registration code by applying a preset SM2 algorithm based on the decryption key to obtain a second registration identifier and the current actual time; under the condition that the current actual time is less than the software service life of the software to be registered, taking the first registration identifier and the software service life as the input of the SM3 algorithm to obtain a third registration identifier output by the SM3 algorithm; judging whether the third registration identification is matched with the second registration identification; and if the third registration identifier is matched with the second registration identifier, binding the software to be registered with the first equipment to complete the registration of the software to be registered. By applying the method provided by the invention, the current actual time is compared with the software service life of the software to be registered in the process of verifying the verification registration code, so that whether the software to be registered is overdue can be accurately determined.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a software registration method according to the present invention;
FIG. 2 is a flowchart of a method for acquiring registration parameters of software to be registered according to the present invention;
FIG. 3 is an exemplary diagram of an implementation scenario provided by the present invention;
FIG. 4 is a flowchart of another software registration method provided by the present invention;
fig. 5 is a schematic structural diagram of a software registration apparatus provided in the present invention;
FIG. 6 is a flowchart of a method for generating a software registration code according to the present invention;
fig. 7 is a schematic structural diagram of a software registration code generating apparatus according to the present invention;
fig. 8 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention is operational with numerous general purpose or special purpose computing device environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multi-processor apparatus, distributed computing environments that include any of the above devices or equipment, and the like.
An embodiment of the present invention provides a software registration method, which may be applied to a first device, where the first device may be an electronic device running an application client, and a flowchart of the method is shown in fig. 1, and specifically includes:
s101: responding to a software registration instruction, and sending a software registration request of software to be registered corresponding to the registration instruction to a preset second device so as to obtain an authentication code fed back by the second device based on the software registration request.
In the method provided by the embodiment of the invention, the user can trigger the software registration instruction on the registration interface of the software to be registered, so that the software registration request of the software to be registered can be sent to the second device.
The software registration request may include identification information of the user, a communication address of the user, and software information of software to be registered, where the software information may be a software identifier, a version number, and the like.
S102: and under the condition that the verification code passes verification, acquiring the registration parameters of the software to be registered, and taking the registration parameters as the input of a preset SM3 algorithm to obtain a first registration identifier output by the SM3 algorithm.
In the method provided by the embodiment of the invention, after the verification code fed back by the second device is obtained, verification can be performed on the verification, and the registration parameters of the software to be registered can be obtained under the condition that the verification code passes verification.
The registration parameter may include hardware information of the first device and identification information of the user, where the hardware information may be a MAC address and a disk serial number, and the identification information of the user may be a user name of the user.
Specifically, the registration parameter is used as an input of the SM3 algorithm, so that the SM3 algorithm performs hash operation on the registration parameter to obtain an operation result, and the operation result is used as the first registration identifier.
S103: and sending the first registration identifier to the second equipment to trigger the second equipment to feed back the registration code of the software to be registered and the decryption key of the registration code based on the first registration identifier.
In the method provided by the embodiment of the invention, after the first registration identifier is sent to the second device, the second device is triggered to determine the software service life corresponding to the first registration identifier, the first registration identifier and the software service life are used as the input of an SM3 algorithm to obtain a fourth registration identifier output by SM3, the fourth registration identifier is encrypted according to a preset encryption key of an SM2 algorithm to obtain a registration code of software to be registered, and the registration code and a decryption key of the registration code are sent to the first device.
The encryption key may be a private key of the SM2 algorithm, the decryption key is a public key of the SM2 algorithm, and the encryption key and the decryption key are a pair of keys generated in advance.
S104: and decrypting the registration code by applying a preset SM2 algorithm based on the decryption key to obtain a second registration identifier and the current actual time.
In the method provided by the embodiment of the present invention, the decrypted registration code may be obtained by decrypting the registration code with the decryption key, and the current actual time may be obtained through the network after the first device decrypts the registration code with the decrypted registration code as the second registration identifier.
S105: and taking the first registration identifier and the software service life as the input of the SM3 algorithm to obtain a third registration identifier output by the SM3 algorithm when the current actual time is less than the software service life of the software to be registered.
In the method provided by the embodiment of the invention, after the current actual time is obtained, the current actual time can be compared with the software service life of the software to be registered.
If the current actual time is less than the software service life of the software to be registered, it indicates that the current actual time is within the software service life, in this case, the SM3 performs hash operation on the first registration identifier and the software service life to obtain an operation result, and the operation result is used as a third registration identifier.
Specifically, if the current actual time is not less than the service life of the software to be registered, it indicates that the current actual time is not within the service life of the software, and in this case, the software to be registered may be stopped or exited.
S106: and judging whether the third registration identifier is matched with the second registration identifier, if so, executing S107, and if not, executing S108.
S107: and binding the software to be registered with the first equipment to complete the registration of the software to be registered.
S108: and stopping running the software to be registered.
By applying the method provided by the invention, the current actual time is compared with the software service life of the software to be registered in the process of verifying the verification registration code, so that whether the software to be registered is overdue can be accurately determined.
In the method provided in the embodiment of the present invention, based on the above implementation process, specifically, the process of verifying the verification code includes:
acquiring software version information of the software to be registered;
matching the software version information with the verification code;
if the software version information is successfully matched with the verification code, the verification code is determined to pass verification;
and if the software version information is unsuccessfully matched with the verification code, determining that the verification code is not verified.
In the embodiment provided by the invention, the software version information of the software to be registered can be acquired from the installation configuration file of the software to be registered.
One feasible way of matching the software version information with the verification code is as follows: and determining the applicable software version information represented by the verification code, and judging whether the applicable software version information contains the software version information, if so, determining that the software version information is successfully matched with the verification code, otherwise, determining that the matching is unsuccessful, and if the matching is unsuccessful, stopping running the software to be registered.
By applying the method provided by the invention, whether the version information of the software to be registered meets the registration requirement can be accurately determined.
In the method provided in the embodiment of the present invention, based on the foregoing implementation process, specifically, the acquiring the registration parameter of the software to be registered, as shown in fig. 2, specifically includes:
s201: and acquiring a user identifier contained in the software registration instruction, and acquiring the MAC address and the disk serial number of the first device.
In the method provided by the embodiment of the invention, the software registration instruction can be analyzed to obtain instruction information, and the user identifier is obtained from the instruction information, wherein the user identifier can be user name information of the user.
S202: and forming the registration parameters of the software to be registered by the user identification, the MAC address and the disk serial number.
In the method provided by the embodiment of the invention, the user identification, the MAC address and the disk serial number can be spliced to obtain the registration parameters of the software to be registered.
By applying the method provided by the embodiment of the invention, the registration parameter of the software to be registered is composed of the user identifier, the MAC address and the disk serial number, and then the registration code can be generated based on the registration parameter.
In the method provided in the embodiment of the present invention, based on the foregoing implementation process, specifically, the determining whether the third registration identifier matches the second registration identifier includes:
comparing the third registration identifier with the second registration identifier;
if the third registration identifier is consistent with the second registration identifier, determining that the third registration identifier is matched with the second registration identifier;
and if the third registration identifier is inconsistent with the second registration identifier, determining that the third registration identifier is not matched with the second registration identifier.
In the method provided by the embodiment of the present invention, if the third registration identifier is consistent with the second registration identifier, it may be said that the verification of the registration code of the software to be registered is successful, that is, under the condition that the third registration identifier is matched with the second registration identifier, the software to be registered may be bound with the first device, so as to complete the registration of the software to be registered.
Optionally, if the third registration identifier is not consistent with the second registration identifier, it may be stated that the verification of the registration code of the software to be registered fails, that is, the software to be registered may stop running under the condition that the third registration identifier is not matched with the second registration identifier.
By applying the method provided by the embodiment of the invention, whether the verification of the registration code is successful can be accurately determined, thereby ensuring the safety of the registration code.
In the method provided in the embodiment of the present invention, based on the implementation process, specifically, the method further includes:
and under the condition that the current actual time is more than or equal to the preset software service life, terminating the software to be registered, and sending a software expiration prompt message to the user.
In the method provided by the embodiment of the invention, when a postponing instruction based on the software expiration prompt information of a user is received, a software service life updating request corresponding to the postponing instruction is sent to second equipment; and when a new software use period fed back by the second device based on the software use period updating request is received, replacing the original software use period with the new software use period.
Referring to fig. 3, an exemplary embodiment of the present invention is shown, and the exemplary embodiment of the present invention includes a first device 301 and a second device 302.
In practice, the first device 301 shown in fig. 3 may be an electronic device such as a mobile phone, a tablet, a personal computer, etc. The second device 302 may be a server, a server cluster composed of a plurality of servers, or a cloud computing service center. The first device 301 and the second device 302 establish a communication connection through a network.
Embodiments of the present invention relate to networks that are media providing communication links and may include various types of connections, such as wire, wireless communication links, or fiber optic cables.
Based on the above example of the implementation scenario, in an embodiment provided by the present invention, optionally, in response to the software registration instruction, the first device 301 sends a software registration request of software to be registered corresponding to the registration instruction to the second device 302, so as to obtain an authentication code fed back by the second device 302 based on the software registration request; acquiring registration parameters of software to be registered under the condition that the verification code passes verification, and taking the registration parameters as the input of a preset SM3 algorithm to obtain a first registration identifier output by an SM3 algorithm; sending the first registration identifier to the second device 302 to trigger the second device 302 to feed back the registration code of the software to be registered and the decryption key of the registration code based on the first registration identifier; the first device 301 decrypts the registration code based on the decryption key by using a preset SM2 algorithm, and obtains a second registration identifier and the current actual time; under the condition that the current actual time is less than the software service life of the software to be registered, taking the first registration identifier and the software service life as the input of the SM3 algorithm to obtain a third registration identifier output by the SM3 algorithm; judging whether a third registration identifier is matched with the second registration identifier; if the third registration identifier is determined to be matched with the second registration identifier, the software to be registered is bound with the first device 301, so as to complete the registration of the software to be registered.
Based on the above example diagram of the implementation scenario, in another embodiment provided by the present invention, optionally as shown in fig. 4, a flowchart of another method of the software registration method provided by the present invention includes:
s401: the first device sends a software registration request to the second device in response to the software registration instruction.
S402: the second device generates a verification code.
S403: the second device sends the verification code to the first device.
S404: and the first device checks the verification code, if the verification code passes, the step S406 is executed, and if the verification code does not pass, the next user triggering software registration instruction is waited.
S405: the second device generates a key pair (K, Q) of the SM2 algorithm, where K is an encryption key and Q is a decryption key.
S406: the first equipment acquires the registration parameters of the software to be registered, wherein the registration parameters of the software to be registered consist of an MAC address, a disk serial number and a user identifier.
S407: and the first equipment performs hash operation on the registration parameters by using an SM3 algorithm to obtain a first registration identifier.
S408: the first device sends the first registration identification to the second device.
S409: and the second equipment performs hash operation on the first registration identifier and the service life of the software by using an SM3 algorithm to obtain a fourth registration identifier.
S410: the second device uses the key k to perform SM2 encryption on the fourth registration identifier to generate a registration code
S411: the second device sends the registration code and the decryption key Q to the first device.
S412: the first device decrypts the registration code by using the key Q to obtain a second registration identifier and a current actual time t, wherein the first device may obtain the current actual time through a network when decrypting the registration code.
S413: and the first device judges that the current actual time T is less than the software service life T, if so, S414 is executed, and if not, S417 is executed.
S414: and the first equipment applies an SM3 algorithm to carry out hash operation on the first registration identifier and the service life of the software to obtain a third registration identifier.
S415: the first device determines whether the third registration flag is consistent with the second registration flag, if so, performs S416, and if not, performs S417.
S416: and starting a software running interface when the software to be registered is successfully bound with the first equipment.
S417: the software terminates.
By applying the method provided by the embodiment of the invention, in the process of verifying the verification registration code, the current actual time is compared with the software service life of the software to be registered, so that whether the software to be registered is overdue can be accurately determined, and moreover, the SM3 algorithm is used for carrying out hash operation on data needing interaction of the system, so that on one hand, the data volume of algorithm operation can be reduced, and on the other hand, if the SM3 algorithm is a hardware-based implementation mode, the plaintext information of client hardware can be prevented from appearing in a memory. The SM2 algorithm has higher safety and lower calculation cost, and can improve the execution efficiency of the system. The service life of the software is also used as initial information generated by the registration code, so that the system scheme is also suitable for registration of the software which needs to be purchased and used according to the annual limit.
Corresponding to the method described in fig. 1, an embodiment of the present invention further provides a software registration apparatus, which is used for implementing the method in fig. 1 specifically, the software registration apparatus provided in the embodiment of the present invention may be applied to a computer terminal or various mobile devices, and a schematic structural diagram of the software registration apparatus is shown in fig. 5, and specifically includes:
a first sending unit 501, configured to send, in response to a software registration instruction, a software registration request of software to be registered corresponding to the registration instruction to a preset second device, so as to obtain an authentication code fed back by the second device based on the software registration request;
an obtaining unit 502, configured to obtain a registration parameter of the software to be registered when the verification code is verified, and use the registration parameter as an input of a preset SM3 algorithm to obtain a first registration identifier output by the SM3 algorithm;
a second sending unit 503, configured to send the first registration identifier to the second device, so as to trigger the second device to feed back, based on the first registration identifier, the registration code of the software to be registered and the decryption key of the registration code;
a decryption unit 504, configured to decrypt the registration code based on the decryption key by using a preset SM2 algorithm, so as to obtain a second registration identifier and a current actual time;
an execution unit 505, configured to use the first registration identifier and the software lifetime as inputs of the SM3 algorithm to obtain a third registration identifier output by the SM3 algorithm when the current actual time is less than the software lifetime of the software to be registered;
a determining unit 506, configured to determine whether the third registration identifier matches the second registration identifier;
a registering unit 507, configured to bind the software to be registered with the first device if it is determined that the third registration identifier matches the second registration identifier, so as to complete registration of the software to be registered.
In an embodiment provided by the present invention, based on the above scheme, optionally, the software registration apparatus further includes a verification unit, configured to obtain software version information of the software to be registered; matching the software version information with the verification code; if the software version information is successfully matched with the verification code, the verification code is determined to pass verification; and if the software version information is unsuccessfully matched with the verification code, determining that the verification code is not verified.
In an embodiment provided by the present invention, based on the above scheme, optionally, the obtaining unit 502 for obtaining the registration parameter of the software to be registered includes:
the acquisition subunit is used for acquiring the user identifier contained in the software registration instruction and acquiring the MAC address and the disk serial number of the first device;
and the execution subunit is configured to combine the user identifier, the MAC address, and the disk serial number into a registration parameter corresponding to the first device.
In an embodiment of the present invention, based on the above scheme, optionally, the determining unit 506 includes:
the processing subunit is configured to compare the third registration identifier with the second registration identifier;
the first judging subunit is configured to judge that the third registration identifier matches the second registration identifier if the third registration identifier is consistent with the second registration identifier;
and the second judging subunit is configured to judge that the third registration identifier is not matched with the second registration identifier if the third registration identifier is not matched with the second registration identifier.
In an embodiment provided by the present invention, based on the above scheme, optionally, the software registration apparatus further includes: a presentation unit;
and the prompting unit is used for sending out software expiration prompting information to the user under the condition that the current actual time is more than or equal to the preset software service life.
The specific principle and the execution process of each unit and each module in the software registration apparatus disclosed in the above embodiment of the present invention are the same as those of the software registration method disclosed in the above embodiment of the present invention, and reference may be made to corresponding parts in the software registration method provided in the above embodiment of the present invention, which are not described herein again.
An embodiment of the present invention provides a software registration code generating method, where the method may be applied to a second device, where the second device may be a server, and a flowchart of the method is shown in fig. 6, where the method specifically includes:
s601: when a first registration identifier sent by first equipment is received, determining the service life of software corresponding to the first registration identifier; the first registration identifier is obtained by the first device performing hash operation on registration parameters of software to be registered according to an SM3 algorithm; the registration parameters comprise user identification, the MAC address of the first equipment and the disk serial number of the first equipment;
in the method provided by the embodiment of the present invention, the first registration identifier may be an output of the SM3 obtained by using a registration parameter as an input of the SM3 when the verification code of the first device passes.
S602: taking the first registration identifier and the software service life as the input of a preset SM3 algorithm to obtain a fourth registration identifier output by the SM3 algorithm;
s603: and encrypting the fourth registration identifier by using a preset encryption key of an SM2 algorithm to generate a registration code of the software to be registered.
Optionally, after the registration code of the software to be registered is generated, the registration code of the software to be registered and the decryption key of the registration code are fed back to the first device, where the decryption key corresponds to the encryption key.
The software registration code generation method provided by the embodiment of the invention comprises the steps of forming registration parameters of software to be registered by user identification, MAC address and disk serial number, carrying out hash operation on the registration parameters by using SM3 algorithm to obtain a first registration identifier, carrying out hash operation on the first identifier and the service life of the software by using SM3 algorithm to obtain a fourth registration identifier, and encrypting the fourth registration identifier by using an encryption key of SM2 algorithm to generate a registration code. Compared with the mode of generating the registration code only by adopting the machine code in the prior art, the mode improves the safety of the registration code.
Corresponding to the method described in fig. 6, an embodiment of the present invention further provides a software registration code generating apparatus, which is used for implementing the method in fig. 6 specifically, and the software registration code generating apparatus provided in the embodiment of the present invention may be applied to a second device, and a schematic structural diagram of the software registration code generating apparatus is shown in fig. 7, and specifically includes:
a receiving unit 701, configured to determine, when receiving a first registration identifier sent by a first device, a software lifetime corresponding to the first registration identifier; the first registration identifier is obtained by the first device performing hash operation on registration parameters of software to be registered according to an SM3 algorithm; the registration parameters comprise user identification, the MAC address of the first equipment and the disk serial number of the first equipment;
a processing unit 702, configured to use the first registration identifier and the software lifetime as inputs of a preset SM3 algorithm, to obtain a fourth registration identifier output by the SM3 algorithm;
the generating unit 703 is configured to encrypt the fourth registration identifier by using a pre-generated encryption key of the SM2 algorithm, so as to generate a registration code of the software to be registered.
The specific principle and the execution process of each unit and each module in the software registration code generation apparatus disclosed in the embodiment of the present invention are the same as those of the software registration code generation method disclosed in the embodiment of the present invention, and reference may be made to corresponding parts in the software registration method provided in the embodiment of the present invention, which are not described herein again.
The embodiment of the invention also provides a storage medium, which comprises a stored instruction, wherein when the instruction runs, the device where the storage medium is located is controlled to execute the software registration method or the software registration code generation method.
An electronic device is provided in an embodiment of the present invention, and the structural diagram of the electronic device is shown in fig. 8, which specifically includes a memory 801 and one or more instructions 802, where the one or more instructions 802 are stored in the memory 801 and configured to be executed by the one or more processors 803 to perform the following operations:
responding to a software registration instruction, and sending a software registration request of software to be registered corresponding to the registration instruction to preset second equipment so as to obtain a verification code fed back by the second equipment based on the software registration request;
acquiring registration parameters of the software to be registered under the condition that the verification code passes verification, and taking the registration parameters as the input of a preset SM3 algorithm to obtain a first registration identifier output by the SM3 algorithm;
sending the first registration identifier to the second device to trigger the second device to feed back the registration code of the software to be registered and the decryption key of the registration code based on the first registration identifier;
decrypting the registration code by applying a preset SM2 algorithm based on the decryption key to obtain a second registration identifier and the current actual time;
under the condition that the current actual time is less than the software service life of the software to be registered, taking the first registration identifier and the software service life as the input of the SM3 algorithm to obtain a third registration identifier output by the SM3 algorithm;
judging whether the third registration identification is matched with the second registration identification;
and if the third registration identifier is matched with the second registration identifier, binding the software to be registered with the first equipment to complete the registration of the software to be registered.
Alternatively, the following operations are performed:
when a first registration identifier sent by first equipment is received, determining the service life of software corresponding to the first registration identifier; the first registration identifier is obtained by the first device performing hash operation on registration parameters of software to be registered according to an SM3 algorithm; the registration parameters comprise user identification, the MAC address of the first equipment and the disk serial number of the first equipment;
taking the first registration identifier and the software service life as the input of a preset SM3 algorithm to obtain a fourth registration identifier output by the SM3 algorithm;
and encrypting the fourth registration identifier by using a preset encryption key of an SM2 algorithm to generate a registration code of the software to be registered.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units may be implemented in the same software and/or hardware or in a plurality of software and/or hardware when implementing the invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The software registration method provided by the present invention is described in detail above, and the principle and the implementation of the present invention are explained in the present document by applying specific examples, and the description of the above examples is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A software registration method applied to a first device, the method comprising:
responding to a software registration instruction, and sending a software registration request of software to be registered corresponding to the registration instruction to preset second equipment so as to obtain a verification code fed back by the second equipment based on the software registration request;
acquiring registration parameters of the software to be registered under the condition that the verification code passes verification, and taking the registration parameters as the input of a preset SM3 algorithm to obtain a first registration identifier output by the SM3 algorithm;
sending the first registration identifier to the second device to trigger the second device to feed back the registration code of the software to be registered and the decryption key of the registration code based on the first registration identifier;
decrypting the registration code by applying a preset SM2 algorithm based on the decryption key to obtain a second registration identifier and the current actual time;
under the condition that the current actual time is less than the software service life of the software to be registered, taking the first registration identifier and the software service life as the input of the SM3 algorithm to obtain a third registration identifier output by the SM3 algorithm;
judging whether the third registration identification is matched with the second registration identification;
and if the third registration identifier is matched with the second registration identifier, binding the software to be registered with the first equipment to complete the registration of the software to be registered.
2. The method of claim 1, wherein the process of verifying the verification code comprises:
acquiring software version information of the software to be registered;
matching the software version information with the verification code;
if the software version information is successfully matched with the verification code, the verification code is determined to pass verification;
and if the software version information is unsuccessfully matched with the verification code, determining that the verification code is not verified.
3. The method according to claim 1, wherein the obtaining registration parameters of the software to be registered comprises:
acquiring a user identifier contained in the software registration instruction, and acquiring an MAC address and a disk serial number of the first device;
and forming the registration parameters of the software to be registered by the user identification, the MAC address and the disk serial number.
4. The method of claim 1, wherein the determining whether the third registration identifier matches the second registration identifier comprises:
comparing the third registration identifier with the second registration identifier;
if the third registration identifier is consistent with the second registration identifier, determining that the third registration identifier is matched with the second registration identifier;
and if the third registration identifier is inconsistent with the second registration identifier, determining that the third registration identifier is not matched with the second registration identifier.
5. The method of claim 1, further comprising:
and under the condition that the current actual time is more than or equal to the preset software service life, terminating the software to be registered, and sending a software expiration prompt message to the user.
6. A software registration apparatus, applied to a first device, the apparatus comprising:
the first sending unit is used for responding to a software registration instruction, sending a software registration request of software to be registered corresponding to the registration instruction to preset second equipment so as to obtain an authentication code fed back by the second equipment based on the software registration request;
the acquisition unit is used for acquiring the registration parameters of the software to be registered under the condition that the verification code passes the verification, and taking the registration parameters as the input of a preset SM3 algorithm to obtain a first registration identifier output by the SM3 algorithm;
a second sending unit, configured to send the first registration identifier to the second device, so as to trigger the second device to feed back, based on the first registration identifier, a registration code of the software to be registered and a decryption key of the registration code;
the decryption unit is used for decrypting the registration code based on the decryption key by applying a preset SM2 algorithm to obtain a second registration identifier and the current actual time;
the execution unit is used for taking the first registration identifier and the software service life as the input of the SM3 algorithm to obtain a third registration identifier output by the SM3 algorithm when the current actual time is less than the software service life of the software to be registered;
the judging unit is used for judging whether the third registration identification is matched with the second registration identification;
and the registration unit is used for binding the software to be registered with the first equipment if the third registration identifier is matched with the second registration identifier, so as to complete the registration of the software to be registered.
7. The apparatus according to claim 6, further comprising a verification unit, configured to obtain software version information of the software to be registered; matching the software version information with the verification code; if the software version information is successfully matched with the verification code, the verification code is determined to pass verification; and if the software version information is unsuccessfully matched with the verification code, determining that the verification code is not verified.
8. The apparatus according to claim 6, wherein the acquiring unit that acquires the registration parameters of the software to be registered includes:
the acquisition subunit is used for acquiring the user identifier contained in the software registration instruction and acquiring the MAC address and the disk serial number of the first device;
and the execution subunit is configured to combine the user identifier, the MAC address, and the disk serial number into a registration parameter corresponding to the first device.
9. A software registration code generation method is applied to a second device, and comprises the following steps:
when a first registration identifier sent by first equipment is received, determining the service life of software corresponding to the first registration identifier; the first registration identifier is obtained by the first device performing hash operation on registration parameters of software to be registered according to an SM3 algorithm; the registration parameters comprise user identification, the MAC address of the first equipment and the disk serial number of the first equipment;
taking the first registration identifier and the software service life as the input of a preset SM3 algorithm to obtain a fourth registration identifier output by the SM3 algorithm;
and encrypting the fourth registration identifier by using a preset encryption key of an SM2 algorithm to generate a registration code of the software to be registered.
10. A software registration code generation apparatus, applied to a second device, the apparatus comprising:
the device comprises a receiving unit, a judging unit and a judging unit, wherein the receiving unit is used for determining the service life of software corresponding to a first registration identifier when the first registration identifier sent by first equipment is received; the first registration identifier is obtained by the first device performing hash operation on registration parameters of software to be registered according to an SM3 algorithm; the registration parameters comprise user identification, the MAC address of the first equipment and the disk serial number of the first equipment;
the processing unit is used for taking the first registration identifier and the software service life as the input of a preset SM3 algorithm to obtain a fourth registration identifier output by the SM3 algorithm;
and the generating unit is used for encrypting the fourth registration identifier by applying a pre-generated encryption key of the SM2 algorithm to generate a registration code of the software to be registered.
CN202011622937.4A 2020-12-31 2020-12-31 Software registration method and device and software registration code generation method and device Active CN112685699B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011622937.4A CN112685699B (en) 2020-12-31 2020-12-31 Software registration method and device and software registration code generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011622937.4A CN112685699B (en) 2020-12-31 2020-12-31 Software registration method and device and software registration code generation method and device

Publications (2)

Publication Number Publication Date
CN112685699A true CN112685699A (en) 2021-04-20
CN112685699B CN112685699B (en) 2022-12-23

Family

ID=75453966

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011622937.4A Active CN112685699B (en) 2020-12-31 2020-12-31 Software registration method and device and software registration code generation method and device

Country Status (1)

Country Link
CN (1) CN112685699B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032773A (en) * 2021-05-21 2021-06-25 长扬科技(北京)有限公司 Software security application method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6233567B1 (en) * 1997-08-29 2001-05-15 Intel Corporation Method and apparatus for software licensing electronically distributed programs
FI20060929A0 (en) * 2006-10-23 2006-10-23 Valimo Wireless Oy Procedure and System for Secure Registration of a Public Key Infrastructure (PKI) Key
CN105653902A (en) * 2016-02-01 2016-06-08 深圳市新产业生物医学工程股份有限公司 Software registration method and device and registration code generating method and device
CN109960900A (en) * 2019-03-29 2019-07-02 富士施乐实业发展(中国)有限公司 A kind of registration code generating method and system
CN110096852A (en) * 2019-05-14 2019-08-06 北京天地和兴科技有限公司 A kind of offline industrial control software authentication method close based on state

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6233567B1 (en) * 1997-08-29 2001-05-15 Intel Corporation Method and apparatus for software licensing electronically distributed programs
FI20060929A0 (en) * 2006-10-23 2006-10-23 Valimo Wireless Oy Procedure and System for Secure Registration of a Public Key Infrastructure (PKI) Key
CN105653902A (en) * 2016-02-01 2016-06-08 深圳市新产业生物医学工程股份有限公司 Software registration method and device and registration code generating method and device
CN109960900A (en) * 2019-03-29 2019-07-02 富士施乐实业发展(中国)有限公司 A kind of registration code generating method and system
CN110096852A (en) * 2019-05-14 2019-08-06 北京天地和兴科技有限公司 A kind of offline industrial control software authentication method close based on state

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
闫乐林等: "基于RSA的双重加密技术在软件注册中的应用研究", 《网络安全技术与应用》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032773A (en) * 2021-05-21 2021-06-25 长扬科技(北京)有限公司 Software security application method and device

Also Published As

Publication number Publication date
CN112685699B (en) 2022-12-23

Similar Documents

Publication Publication Date Title
KR102018971B1 (en) Method for enabling network access device to access wireless network access point, network access device, application server and non-volatile computer readable storage medium
US9009463B2 (en) Secure delivery of trust credentials
CN110138744B (en) Method, device and system for replacing communication number, computer equipment and storage medium
CN107249004B (en) Identity authentication method, device and client
CN111770057B (en) Identity verification system and identity verification method
CN112134708A (en) Authorization method, authorization request method and device
CN112559993B (en) Identity authentication method, device and system and electronic equipment
CN109672523B (en) Information encryption method, device and equipment based on filter and readable storage medium
CN112313648A (en) Authentication system, authentication method, application providing device, authentication device, and authentication program
WO2021114614A1 (en) Application program secure startup method and apparatus, computer device, and storage medium
CN113765906B (en) Method, equipment and system for one-key login of terminal application program
CN108270561B (en) Data sending method and device and key index generating method and device
CN112800393B (en) Authorization authentication method, software development kit generation method, device and electronic equipment
CN109815666B (en) Identity authentication method and device based on FIDO protocol, storage medium and electronic equipment
JP2017531951A (en) Method, device, terminal and server for security check
CN113553572A (en) Resource information acquisition method and device, computer equipment and storage medium
CN106411520B (en) Method, device and system for processing virtual resource data
KR101715816B1 (en) Apparatus for securing information using accessibility method thereof
CN113709115A (en) Authentication method and device
CN112632573A (en) Intelligent contract execution method, device and system, storage medium and electronic equipment
CN112685699B (en) Software registration method and device and software registration code generation method and device
CN113377784B (en) Data processing method, system and storage medium based on middleware
CN114329541A (en) Data encryption method, device, equipment and storage medium
CN110830264B (en) Service data verification method, server, client and readable storage medium
CN111726320B (en) Data processing method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant