Registration code generation and verification method and system based on elliptic curve short signature

By using the elliptic curve short signature technology in the generation and verification of software registration codes, the problem of easy cracking of registration codes and too long authorization codes in the prior art is solved, and effective copyright protection of the software and user-friendly registration code generation are achieved.

CN119903492AActive Publication Date: 2025-04-29BEIJING ZHONGHONG LIDA TECH DEV CO LTD +1
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411882972.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-29
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

In the prior art, software registration code generation and verification methods based on symmetric algorithms are easily reversely analyzed and cracked, resulting in large quantities of pirated software, and the authorization code generated by the public key cryptography algorithm is too long and inconvenient to use.

Method used

The registration code generation and verification method based on the elliptic curve short signature is adopted. By short signature of the machine code of the software running environment, a registration code with a length similar to that of the traditional registration code is generated, and the binding of the registration code and the operating device is realized through signature verification.

Benefits of technology

It effectively solves the problem of software copyright protection, prevents the software from being used on unauthorized devices, and the generated registration code is short and easy to use, improves the user experience, and significantly improves the security of the software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903492A_ABST
    Figure CN119903492A_ABST
Patent Text Reader

Abstract

The invention relates to a registration code generation and verification method and system based on an elliptic curve short signature, and belongs to the technical field of information security. The registration code generation method comprises the following steps: generating a machine code based on hardware information of equipment for installing software and identification information of the software; generating a random elliptic curve key pair, and performing short signature on the machine code based on a private key in the key pair to obtain a corresponding signature value (r, s); a registration code is generated based on the signature value (r, s). The verification method comprises the following steps: generating a machine code corresponding to the equipment running the software; restoring the registration code to be verified to obtain a signature value (r ', s'); the registration code is verified based on the machine code and the signature value (r ', s'). The registration code is generated based on an elliptic curve public key password and a short signature algorithm, the length of the registration code is similar to that of a traditional registration code, the registration code is bound with running equipment to prevent software from being used on unauthorized equipment, and copyright protection of the software is achieved while the length of the registration code is effectively shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a registration code generation and verification method and system based on elliptic curve short signature. Background Art

[0002] There are many traditional software registration methods, including registration code registration, encryption lock registration, authorization file registration, etc. Among them, registration code registration is the most convenient and therefore more commonly used.

[0003] In the prior art, a symmetric computing protocol is used in the generation and verification algorithm protocol of the software registration code. Hackers can crack the generation algorithm of the registration code by reverse analyzing the registration verification module of the software, thereby writing the registration machine of this software and publishing it on the Internet. Users can generate legal registration codes through the registration machine and bypass the authorization verification function of the software. This is also the main reason why a large number of cracked versions of a large number of software exist on the Internet. Based on the registration code generation and verification method of the symmetric algorithm protocol, hackers can crack the generation algorithm of the registration code and develop the registration machine software through the reverse registration code verification program, which is the most important reason for the widespread piracy of software. In other words, the registration code and verification method generated by relying on the confidentiality of the registration code generation algorithm protocol have considerable limitations in protecting software copyrights, especially when the number of software users is large enough, hackers have strong motivation to attack the registration code, and this protection mechanism no longer meets the demand for software copyright protection capabilities.

[0004] The registration code generation and verification based on symmetric algorithm protocols (such as digital digest algorithms, digital digest algorithms with keys, and block cipher algorithms) often appear to be very rogue in the face of software reverse analysis attacks, and it is difficult to prevent registration machine software developed by hackers. Therefore, some software developers try to use public key cryptography algorithms to achieve registration code generation and verification. The private key used to generate the registration code is owned by the software vendor. Verification only requires the public key, which is publicly available. The registration code generation and verification algorithm protocol of the public key cryptography algorithm can be made public, and the security depends on public key cryptography technology. If an attacker wants to crack the registration code protection of the software, he needs to crack the private key of the software developer. The security of public key cryptography ensures that it will take at least thousands of years to crack the public key cryptography under the existing computer computing power. Obviously, this attack method by cracking the public key cryptography is invalid. However, public key cryptography is usually used, whether it is the RSA (Ron Rivest, Adi Shamir and Leonard Adleman) algorithm based on the difficulty of large number decomposition or the ECC (Elliptic Curve Cryptography) algorithm based on the difficulty of discrete logarithm. The length of the authorization registration code generated by the digital signature is relatively long (at least 64 bytes of binary data, more than 100 characters after encoding), which is obviously very inconvenient for users to enter manually, and can only be imported through authorization files; compared with the traditional registration code of only 20 to 30 characters, this results in a poor user experience in terms of scope of application and convenience of operation, and for some hardware and software integrated products, the registration code needs to be printed on the product label, and a registration code that is too long is also difficult to print on the product label, and entering a registration code that is too long is even more difficult for users to accept. Summary of the invention

[0005] In view of the above analysis, the present invention aims to disclose a registration code generation and verification method and system based on elliptic curve short signature, which performs a short signature on the machine code of the software running environment, and encodes the signature to generate a registration code with a length similar to that of the traditional registration code, and binds the registration code to the running device through signature verification, thereby preventing the software from being used on unauthorized devices, thereby effectively realizing the copyright protection of the software.

[0006] On the one hand, the present invention provides a registration code generation method based on elliptic curve short signature, which specifically includes the following steps:

[0007] Generate a machine code corresponding to the device running the software based on the hardware information of the device on which the software is installed and the identification information of the software;

[0008] Generate a random elliptic curve key pair (sk, PK), and use the private key sk in the key pair to perform a short signature on the machine code to obtain the corresponding signature value (r, s);

[0009] A registration code for the software running on the device is generated based on the signature value (r, s).

[0010] Furthermore, the short signing of the machine code based on the private key in the key pair to obtain the corresponding signature value includes:

[0011] Generate a random number k and calculate the point P = k·G on the elliptic curve corresponding to k; where G is a base point of the elliptic curve and its order is a prime number;

[0012] Determine r of the signature value based on the x coordinate of the elliptic curve point P;

[0013] Calculating a digital summary of the machine code to obtain a feature code of the machine code, and converting the feature code into a large integer h;

[0014] The signature value s is calculated based on h and the private key, s=k -1 (h+sk) mod n, where n is the order of the base point G; where sk is the private key;

[0015] The signature value (r, s) is constructed based on r and s.

[0016] Further, generating a registration code for the software to run on the device based on the signature value includes:

[0017] The byte stream obtained by splicing the byte streams of the signature value (r, s) is encoded using Base64 to obtain a displayable string; the displayable string does not contain the characters " / " or "+";

[0018] The registration code is obtained based on the displayable character string.

[0019] Furthermore, generating a machine code corresponding to the device running the software based on the hardware information of the device on which the software is installed and the identification information of the software includes:

[0020] splicing the hardware information and the identification information into an information string;

[0021] Calculate and obtain a corresponding digital summary of the information based on the information character string;

[0022] Dividing the information digital summary into two groups, high and low, according to the bit positions, and performing a logical operation on the two groups of data to obtain corresponding information bit position data;

[0023] Encoding the information bit data in hexadecimal to obtain a machine code string;

[0024] The machine code is determined based on the machine code string.

[0025] Furthermore, the hardware information includes hard disk serial number, CPU serial number, BIOS number, and network card MAC address;

[0026] The identification information includes the software name, developer name, and version number;

[0027] The corresponding information digital summary is calculated based on the information string using the SHA256 or SM3 algorithm.

[0028] On the other hand, the present invention also provides a registration code verification method based on elliptic curve short signature, which is used to verify the registration code generated by the registration code generation method; the registration code verification method comprises:

[0029] Generate a machine code corresponding to the device running the software based on the hardware information of the device on which the software is installed and the identification information of the software;

[0030] Restore the registration code to be verified to obtain the signature value (r′, s′);

[0031] The registration code is verified based on the machine code and the signature value (r', s').

[0032] Furthermore, the restoring of the registration code to be verified to obtain the signature value (r′, s′) includes:

[0033] Obtaining a corresponding displayable string based on the registration code to be verified;

[0034] Perform Base64 decoding on the corresponding displayable string to obtain a corresponding byte stream;

[0035] A signature value (r', s') is obtained based on the corresponding byte stream.

[0036] Further, the verification of the registration code based on the machine code and the signature value (r′, s′) includes:

[0037] Calculate the digital summary of the machine code to obtain a feature code of the machine code, and convert the feature code into a large integer h′;

[0038] Taking the large integer h′ modulo obtains the integer h1, h1=h′mod n, where n is the order of the base point G;

[0039] Calculate the point P1 on the elliptic curve corresponding to h1, P1 = h1·G;

[0040] The verification point P2 on the elliptic curve is calculated based on the public key in the key pair, P2=s′ -1 (P1+PK), where s′ -1 represents the modular inverse of s′, PK is the public key in the random elliptic curve key pair;

[0041] Determine r′ based on the x-coordinate of P2;

[0042] Compare r and r′ to see if they are equal. If they are equal, the registration code is legal, otherwise the registration code is illegal.

[0043] On the other hand, the present invention also provides a registration code generation and verification system based on elliptic curve short signature, comprising:

[0044] A machine code generation module, used to generate a machine code corresponding to the device running the software based on the hardware information of the device on which the software is installed and the identification information of the software;

[0045] A registration code generation module is used to perform a short signature on the machine code based on the private key sk in the generated random elliptic curve key pair (sk, PK) to obtain a corresponding signature value (r, s); based on the signature value (r, s), generate a registration code for the software to run on the device;

[0046] The registration code verification module is used to verify the registration code generated by the registration code generation module, including: generating a machine code corresponding to the device running the software based on the hardware information of the device on which the software is installed and the identification information of the software; restoring the registration code to be verified to obtain a signature value (r′, s′); and verifying the registration code to be verified based on the machine code and the signature value (r′, s′).

[0047] Furthermore, when generating the registration code, the registration code generation module securely obtains the private key in the random elliptic curve key pair from the software manufacturer;

[0048] The registration code verification module pre-configures the public key in the random elliptic curve key pair using a key dispersion algorithm.

[0049] The present invention can achieve at least one of the following beneficial effects:

[0050] The short signature algorithm process innovatively designed by the present invention greatly shortens the length of the signature to meet the requirement that the registration code is usually less than 30 characters, greatly improving the user's operating experience. In this embodiment, by generating a machine code based on the hardware information of the software running device and the identification information of the software, and generating a registration code based on the machine code, the hardware binding of the software and the running environment is achieved, which can effectively solve the copyright protection problem of the software, and any illegally copied software to an unauthorized device cannot be run.

[0051] The present invention generates a registration code by using an elliptic curve signature based on a machine code of a software running environment, and the private key used for the signature is owned only by the software developer, so the registration code cannot be counterfeited or forged, and any attack pattern of generating a registration code cracking tool software is futile, thereby effectively realizing copyright protection of the software.

[0052] By adopting a public cryptographic algorithm to generate a registration code and verify the registration code, its security relies on the public key cryptographic protection. Under the existing computer processing power, the public key cryptographic algorithm is recognized as safe, and the password strength is provably safe. Therefore, the generation method and verification method of the present invention are safe and effective, and solve the problem that the registration code is reverse analyzed by hackers to obtain the registration code generation algorithm and thus develop the registration machine cracking program. At the same time, because the present invention adopts a short signature algorithm, it solves the problem that the authorization code generated by the signature algorithm using the public key cryptography is too long to be used in the form of a registration code.

[0053] Other features and advantages of the present invention will be described in the following description, and some advantages may become apparent from the description, or may be understood by practicing the present invention. The purpose and other advantages of the present invention may be realized and obtained through the contents particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.

[0055] Figure 1 This is a flow chart of the registration code generation and verification method based on elliptic curve short signature of the present invention;

[0056] Figure 2 A schematic diagram of generating machine code according to an embodiment of the present invention;

[0057] Figure 3 A schematic diagram of generating a registration code according to an embodiment of the present invention;

[0058] Figure 4 The figure is a schematic diagram of the registration code verification process according to an embodiment of the present invention. DETAILED DESCRIPTION

[0059] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0060] Method Embodiment

[0061] An embodiment of the present invention discloses a registration code generation method based on an elliptic curve short signature, which generates a machine code uniquely corresponding to the device running the software based on the hardware information of the device on which the software is installed and the identification information of the software, and then performs a short signature on the machine code based on an elliptic curve key to obtain a registration code for the software running on the device. The method of this embodiment includes a method for generating a machine code and a method for generating a registration code.

[0062] How to generate machine code

[0063] Specifically, the machine code corresponding to the device running the software is generated based on the hardware information of the device on which the software is installed and the identification information of the software, including steps S101 to S104.

[0064] S101: When the device on which the software is installed runs the software for the first time, the hardware information of the device is obtained; the hardware information includes the hard disk serial number, CPU serial number, BIOS number, network card MAC address, etc.

[0065] S102: When the device on which the software is installed runs the software for the first time, obtain the identification information of the software, which includes the software name, developer name, version number, etc. It should be noted that steps S101 and S102 are not limited in execution order and can also be performed simultaneously.

[0066] S103: concatenate the hardware information and the identification information into an information string; and calculate a corresponding information digital summary based on the information string using a SHA256 or SM3 algorithm.

[0067] S104: Divide the information digital summary into two groups of high and low bits according to the bits, perform logical operations on the two groups of data to obtain corresponding information bit data; encode the information bit data according to hexadecimal to obtain a machine code string; and determine the machine code based on the machine code string.

[0068] Further, in step S104, determining the machine code based on the machine code string includes:

[0069] Using the machine code string as the machine code;

[0070] Or, the machine code string is converted into a segmented string using multiple connectors "-" as the machine code.

[0071] In one embodiment, the digital summary of the information is 32 bytes; the 32-byte digital summary of the information is divided into two groups of high 128 bits and low 128 bits, and the two groups of information bit data are XORed to obtain 128-bit data, and then hexadecimal encoding is performed to obtain a machine code string with a length of 32 bits; further, the 32-bit machine code string is divided into 5 segments according to "8-4-4-4-12", and the middle is connected with "-" to obtain a string of 36 characters, such as 20210914-B07D-64D7-2184-B07D64D72188.

[0072] How to generate a registration code

[0073] The registration code generation method includes generating a random elliptic curve key pair (sk, PK), performing a short signature on the machine code based on the private key sk in the key pair to obtain a corresponding signature value (r, s); and generating a registration code for the software running on the device based on the signature value (r, s). Specifically, it includes steps S201 to S204.

[0074] S201: Generate a random elliptic curve key pair (sk, PK), where PK = sk·G; sk is the private key, PK is a point on the elliptic curve, and is the public key; G is the base point of the elliptic curve parameters. It should be noted that the private key sk is securely stored by the software developer, and when a registration code needs to be generated, the private key in the random elliptic curve key pair is securely obtained from the software manufacturer.

[0075] S202: Perform a short signature on the machine code based on the private key in the key pair to obtain a corresponding signature value (r, s); including steps (1) to (6):

[0076] ⑴Generate a random number k;

[0077] ⑵ Calculate the point P = k·G on the elliptic curve corresponding to the random number k; where G is a base point of the elliptic curve and its order is a prime number;

[0078] (3) Determine the signature value r based on the x coordinate of the elliptic curve point P;

[0079] (4) Calculate the digital summary of the machine code to obtain the feature code of the machine code, and

[0080] The code is converted to a large integer h;

[0081] (5) Calculate the signature value s based on h and the private key, s = k -1 (h+sk)mod n, where n is the order of the base point G (n is #E(F Q )); wherein sk is the private key;

[0082] (6) Construct the signature value (r, s) based on r and s.

[0083] S203: The byte stream obtained by concatenating the byte streams of the signature value (r, s) is encoded using Base64 to obtain a displayable string; if the obtained displayable string contains the character " / " or "+", return to step S202 and execute again until the displayable string does not contain the character " / " or "+";

[0084] S204: Obtain the registration code based on the displayable character string.

[0085] In one implementation, during the registration code generation process, sk is a large integer of 112 bits; and the length of the random number k is 112 bits.

[0086] Further, the signature value r is determined based on the high 32 bits (or the low 32 bits, or the middle 32 bits of all the bits of the coordinate) of the x-coordinate of the elliptic curve point P.

[0087] Furthermore, a digital summary of the machine code is calculated using the SHA256 or SM3 algorithm to obtain a 256-bit feature code of the machine code.

[0088] Furthermore, the byte streams of the signature value (r, s) are concatenated to obtain an 18-byte byte stream, which is encoded using Base64 to obtain a displayable character string with a length of 24 bits.

[0089] Furthermore, the displayable character string with a length of 24 bits is divided into four segments in the format of "6-6-6-6", and the segments are connected with the character "-" to form the generated registration code, such as MdP4qY-m6xZWY-Xc5u91-fWyV8v.

[0090] This embodiment discloses a registration code generation method based on an elliptic curve short signature. The short signature algorithm process innovatively designed by the present invention greatly shortens the length of the signature to meet the requirement that the registration code is usually less than 30 characters, greatly improving the user's operating experience. In this embodiment, by generating a machine code based on the hardware information of the software running device and the identification information of the software, and generating a registration code based on the machine code, the hardware binding of the software and the running environment is achieved, which can effectively solve the copyright protection problem of the software. Any illegally copied software to an unauthorized device cannot be run.

[0091] An embodiment of the present invention discloses a registration code verification method based on elliptic curve short signature, which is used to verify the registration code generated by the registration code generation method of the present invention, and includes steps S301 to S306.

[0092] S301: Obtain the public key PK in the random elliptic curve key pair.

[0093] S302: Generate a machine code corresponding to the device running the software based on the hardware information of the device on which the software is installed and the identification information of the software. The generation process is the same as steps S101 to S104.

[0094] S303: Check whether the software has been registered. If not, enter the registration code to be verified; if already registered, read the registered registration code.

[0095] S304: restoring the registration code to be verified to obtain a signature value (r′, s′), including: obtaining a corresponding displayable string based on the registration code to be verified; performing Base64 decoding on the corresponding displayable string to obtain a corresponding byte stream; and obtaining a signature value (r′, s′) based on the corresponding byte stream.

[0096] S305: Verify the registration code based on the machine code and the signature value (r′, s′), including steps ① to ⑥:

[0097] ① Calculate the digital summary of the machine code to obtain the feature code of the machine code, and convert the feature code into a large integer h′; it should be noted that this step corresponds to step (4) of S202, and the length of the feature code of the calculated machine code should be the same as the length of the feature code obtained in step (4) of S202.

[0098] same;

[0099] ② Taking the modulus of the large integer h′, obtain the integer h1, h1=h′mod n, where n is the n in step ⑸ in S202;

[0100] ③ Calculate the point P1 on the elliptic curve corresponding to h1, P1 = h1·G;

[0101] ④ Calculate the verification point P2 on the elliptic curve based on the public key in the key pair, P2 = s′ -1

[0102] (P1+PK), where s′ -1 It means to find the modular inverse of s′;

[0103] ⑤ Determine r′ based on the x coordinate of P2;

[0104] ⑥ Compare r and r′ to see if they are equal. If they are equal, the registration code is legal, otherwise the registration code is illegal.

[0105] S306: If the registration code verification is passed, the software is entered normally, otherwise it returns to the registration code input interface.

[0106] The present embodiment discloses a registration code verification method based on an elliptic curve short signature, which verifies the registration code generated by the registration code generation method of the present invention, wherein the registration code is generated based on the machine code of the software running environment through an elliptic curve signature, and the private key used for the signature is owned only by the software developer, so the registration code cannot be counterfeited or forged, and any attack pattern of generating registration code cracking tool software is futile, thereby effectively realizing the copyright protection of the software.

[0107] The registration code generation and verification of the present invention adopts a public cryptographic algorithm, and the security relies on the public key cryptographic guarantee. Under the existing computer processing power, the public key cryptographic algorithm is recognized as safe, and the password strength is provably safe. Therefore, the generation method and verification method of the present invention are safe and effective, and solve the problem that the registration code is reversely analyzed by hackers to obtain the registration code generation algorithm and thus develop the function of the registration machine cracking program. At the same time, because the present invention adopts a short signature algorithm, it solves the problem that the authorization code generated by the signature algorithm using the public key cryptography is too long to be used in the form of a registration code.

[0108] System Example

[0109] Another specific embodiment of the present invention discloses a registration code generation and verification system based on elliptic curve short signature, including a machine code generation module, a registration code generation module and a registration code verification module.

[0110] Specifically, the machine code generation module is used to generate a machine code corresponding to the device running the software based on the hardware information of the device on which the software is installed and the identification information of the software;

[0111] The registration code generation module is used to perform a short signature on the machine code based on the private key sk in the generated random elliptic curve key pair (sk, PK) to obtain the corresponding signature value (r, s); based on the signature value (r, s), generate the registration code for the software to run on the device;

[0112] The registration code verification module is used to verify the registration code generated by the registration code generation module, including: generating a machine code corresponding to the device running the software based on the hardware information of the device on which the software is installed and the identification information of the software; restoring the registration code to be verified to obtain a signature value (r′, s′); and verifying the registration code to be verified based on the machine code and the signature value (r′, s′).

[0113] Furthermore, a random elliptic curve key pair can be generated in advance when the software is released, and the private key sk is securely stored by the software developer and used to generate the registration code; the public key PK is preset in the registration code verification module as a key parameter for verifying the registration code.

[0114] Furthermore, in order to protect the public key PK from being irreplaceable, the public key is dispersed through a key dispersion algorithm.

[0115] Furthermore, when generating the registration code, the registration code generation module securely obtains the private key in the random elliptic curve key pair from the software manufacturer.

[0116] Furthermore, when the registration code verification module verifies the registration code, the public key PK corresponding to the registration code signature is extracted and restored from the public key parameters preset in the registration code verification module through the inverse operation of the key distribution algorithm.

[0117] The registration code generation and verification system based on elliptic curve short signature disclosed in this embodiment can prevent the public key from being replaced by hackers, making it impossible for hackers to extract the correct public key to prevent replacement, thereby further ensuring the security of the registration code.

[0118] It should be noted that the above embodiments are based on the same inventive concept and parts not described repeatedly can be used as reference for each other.

[0119] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A registration code generation method based on elliptic curve short signature, characterized in that: The steps include: Generate a machine code corresponding to the device running the software based on the hardware information of the device on which the software is installed and the identification information of the software; Generate a random elliptic curve key pair (sk, PK), and use the private key sk in the key pair to perform a short signature on the machine code to obtain the corresponding signature value (r, s); A registration code for the software running on the device is generated based on the signature value (r, s).

2. The registration code generation method according to claim 1, characterized in that: The short signing of the machine code based on the private key in the key pair to obtain the corresponding signature value includes: Generate a random number k and calculate the point P = k·G on the elliptic curve corresponding to k; where G is a base point of the elliptic curve and its order is a prime number; Determine r of the signature value based on the x coordinate of the elliptic curve point P; Calculating a digital summary of the machine code to obtain a feature code of the machine code, and converting the feature code into a large integer h; The signature value s is calculated based on h and the private key, s=k -1 (h+sk) mod n, where n is the order of the base point G; where sk is the private key; The signature value (r, s) is constructed based on r and s.

3. The registration code generation method according to claim 2, characterized in that: Generating a registration code for the software to run on the device based on the signature value includes: The byte stream obtained by splicing the byte streams of the signature value (r, s) is encoded using Base64 to obtain a displayable string; the displayable string does not contain the characters " / " or "+"; The registration code is obtained based on the displayable character string.

4. The registration code generation method according to claim 3, characterized in that: The generating of the machine code corresponding to the device running the software based on the hardware information of the device on which the software is installed and the identification information of the software comprises: splicing the hardware information and the identification information into an information string; Calculate and obtain a corresponding digital summary of the information based on the information character string; Dividing the information digital summary into two groups, high and low, according to the bit positions, and performing a logical operation on the two groups of data to obtain corresponding information bit position data; Encoding the information bit data in hexadecimal to obtain a machine code string; The machine code is determined based on the machine code string.

5. The registration code generation method according to claim 4, characterized in that: The hardware information includes hard disk serial number, CPU serial number, BIOS number, and network card MAC address; The identification information includes the software name, developer name, and version number; The corresponding information digital summary is calculated based on the information string using the SHA256 or SM3 algorithm.

6. A registration code verification method based on elliptic curve short signature, characterized in that: Used to verify the registration code generated by the registration code generation method of any one of claims 1 to 5; The registration code verification method comprises: Generate a machine code corresponding to the device running the software based on the hardware information of the device on which the software is installed and the identification information of the software; Restore the registration code to be verified to obtain the signature value (r′, s′); The registration code is verified based on the machine code and the signature value (r', s').

7. The registration code verification method according to claim 6, characterized in that: The restoring of the registration code to be verified to obtain the signature value (r′, s′) includes: Obtaining a corresponding displayable string based on the registration code to be verified; Perform Base64 decoding on the corresponding displayable string to obtain a corresponding byte stream; A signature value (r', s') is obtained based on the corresponding byte stream.

8. The registration code verification method according to claim 7, characterized in that: The verification of the registration code based on the machine code and the signature value (r′, s′) comprises: Calculate the digital summary of the machine code to obtain a feature code of the machine code, and convert the feature code into a large integer h′; Taking the large integer h′ modulo obtains the integer h1, h1=h′mod n, where n is the order of the base point G; Calculate the point P1 on the elliptic curve corresponding to h1, P1 = h1·G; The verification point P2 on the elliptic curve is calculated based on the public key in the key pair, P2=s′ -1 (P1+PK), where s′ -1 represents the modular inverse of s′, PK is the public key in the random elliptic curve key pair; Determine r′ based on the x-coordinate of P2; Compare r and r′ to see if they are equal. If they are equal, the registration code is legal, otherwise the registration code is illegal.

9. A registration code generation and verification system based on elliptic curve short signature, characterized in that: include: A machine code generation module, used to generate a machine code corresponding to the device running the software based on the hardware information of the device on which the software is installed and the identification information of the software; A registration code generation module is used to perform a short signature on the machine code based on the private key sk in the generated random elliptic curve key pair (sk, PK) to obtain a corresponding signature value (r, s); based on the signature value (r, s), generate a registration code for the software to run on the device; The registration code verification module is used to verify the registration code generated by the registration code generation module, including: generating a machine code corresponding to the device running the software based on the hardware information of the device on which the software is installed and the identification information of the software; The registration code to be verified is restored to obtain the signature value (r′, s′); the registration code to be verified is verified based on the machine code and the signature value (r′, s′).

10. The registration code generation and verification system according to claim 9, characterized in that: When generating the registration code, the registration code generation module securely obtains the private key in the random elliptic curve key pair from the software manufacturer; The registration code verification module pre-configures the public key in the random elliptic curve key pair using a key dispersion algorithm.

Citation Information

Patent Citations

  • Method and system for processing short ciphertext signature of invoice

    CN108268779A

  • Digital signature generation method and device, computer equipment and storage medium

    CN111628868A

  • Software and hardware collaborative design SM9 digital signature communication method and system

    CN112202568A

  • License generation method and system

    CN116881865A

  • Software authorization method and system

    CN117313045A