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

Through the registration code generation method based on the short signature of the elliptic curve, the machine code is generated using the device hardware information and software identification to generate the hardware binding between the software and the operating environment, solving the problem of software being easily piracy and the registration code being too long, and improving copyright protection and user experience.

CN119903492BActive Publication Date: 2025-09-02BEIJING ZHONGHONG LIDA TECH DEV CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing software registration code generation and verification algorithms are easily reversely analyzed, resulting in the proliferation of software piracy. The traditional registration code is too long and difficult to manually enter, and is not suitable for integrated software and hardware products, and has poor user experience.

Method used

The registration code generation method based on the elliptic curve short signature is adopted, and the machine code is generated through the equipment hardware information and software identification, and the random elliptic curve key pair is short-signed to generate displayable strings similar to the length of the traditional registration code, so as to realize the hardware binding between the software and the operating environment.

Benefits of technology

Effectively protect software copyright, prevent unauthorized devices from running, moderate signature length improves user experience, and rely on public key password protection to prevent registration codes from being cracked.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903492B_ABST
    Figure CN119903492B_ABST
Patent Text Reader

Abstract

The present invention relates to a registration code generation and verification method and system based on elliptic curve short signature, belonging to the field of information security technology. The registration code generation method includes: generating a machine code based on the hardware information of the device on which the software is installed and the identification information of the software; generating a random elliptic curve key pair, and performing a short signature on the machine code based on the private key in the key pair to obtain a corresponding signature value (r, s); and generating a registration code based on the signature value (r, s). The verification method includes: generating a machine code corresponding to the device running the software; restoring the registration code to be verified to obtain a signature value (r′, s′); and verifying the registration code based on the machine code and the signature value (r′, s′). The registration code of the present invention is generated based on elliptic curve public key cryptography and a short signature algorithm. The length of the registration code is similar to that of a traditional registration code, and the registration code is bound to the running device to prevent the software from being used on unauthorized devices. This effectively shortens the length of the registration code while achieving copyright protection for the software.
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 software registration codes. Hackers can crack the generation algorithm of the registration code by reverse-analyzing the registration verification module of the software, thereby writing a registration machine for the software and publishing it on the Internet. Users can then use the registration machine to generate legitimate registration codes and bypass the software's authorization verification function. This is also the main reason why there are a large number of cracked versions of a large number of software 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 registration machine software by reverse-engineering the registration code verification program. This is the most important reason for the current rampant software piracy. In other words, the registration code and verification method generated by relying on the confidentiality of the registration code generation algorithm protocol has considerable limitations in protecting software copyright. In particular, when the number of software users is large enough, hackers have strong motivation to attack the registration code. This protection mechanism no longer meets the requirements for software copyright protection capabilities.

[0004] Registration code generation and verification based on symmetric algorithm protocols (such as digital digest algorithms, keyed digital digest algorithms, and block cipher algorithms) often appear vulnerable to software reverse engineering attacks, and are difficult to defend against against registration machine software developed by hackers. Therefore, some software developers have attempted to implement registration code generation and verification using public key cryptography. The private key used to generate the registration code is owned by the software vendor, and verification requires only the public key, which is publicly available. The registration code generation and verification algorithm protocols based on public key cryptography are publicly available, and their security relies on public key cryptography. To crack the software's registration code protection, an attacker would need to crack the software developer's private key. However, the security of public key cryptography is guaranteed by the fact that, with current computer computing power, cracking public key cryptography would take at least thousands of years, making such attacks based on cracking public key cryptography ineffective. 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 factorization 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, which reaches more than 100 characters after encoding). It is obviously very inconvenient for users to enter it manually, and it can only be imported through an authorization file. 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 ease of operation. In addition, for some integrated hardware and software products, the registration code needs to be printed on the product label. An overly long registration code is also difficult to print on the product label, and entering an overly long registration code 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. By performing a short signature on the machine code of the software running environment, and encoding the signature to generate a registration code with a length similar to that of the traditional registration code, and binding the registration code to the running device through signature verification, the software is prevented from being used on unauthorized devices, thereby effectively realizing the copyright protection of the software.

[0006] In one aspect, the present invention provides a registration code generation method based on an elliptic curve short signature, which specifically comprises 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] Generate a registration code for the software running on the device 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 the signature value r 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] Furthermore, generating a registration code for the software running 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 the 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 position, and performing a logical operation on the two groups of data to obtain corresponding information bit 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 includes:

[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 character string to obtain a corresponding byte stream;

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

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

[0037] 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′;

[0038] Taking the large integer h′ modulo 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′, where 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, configured to generate a machine code corresponding to the software running on the device based on the hardware information of the device on which the software is installed and the identification information of the software;

[0045] 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;

[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 innovative short signature algorithm designed by this invention significantly shortens the signature length to meet the requirement that registration codes are typically less than 30 characters, significantly improving the user experience. This embodiment generates a machine code based on the hardware information of the software's running device and the software's identification information, and then generates a registration code based on the machine code. This achieves hardware binding between the software and the running environment, effectively addressing software copyright protection issues. Any illegally copied software to unauthorized devices will be unable to run.

[0051] The present invention generates a registration code by signing the machine code based on the software running environment through an elliptic curve. The private key used for the signature is owned only by the software developer, so the registration code cannot be counterfeited or forged. Any attack attempt to generate a tool software to crack the registration code is futile, effectively realizing the copyright protection of the software.

[0052] By using a public cryptographic algorithm to generate and verify the registration code, its security relies on public key cryptography. Given the current computer processing power, public key cryptography algorithms are generally recognized as secure, and the cryptographic strength is provably secure. Therefore, the generation and verification methods of the present invention are safe and effective, and solve the problem of hackers reverse-analyzing the registration code to obtain the registration code generation algorithm and then develop a registration machine cracking program. At the same time, because the present invention uses 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 be understood through practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] The accompanying 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 parts 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 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 will be 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, and are not used to limit the scope of the present invention.

[0060] Method Example

[0061] One embodiment of the present invention discloses a registration code generation method based on elliptic curve short signatures. This method generates a unique machine code corresponding to the software running on the device based on the hardware information of the device on which the software is installed and the identification information of the software. The machine code is then short-signed using an elliptic curve key to obtain a registration code for the software running on the device. This method includes both a method for generating a machine code and a method for generating a registration code.

[0062] Machine code generation method

[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 identification information of the software, including 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 be performed simultaneously.

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

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

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

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

[0070] Alternatively, the machine code character string is converted into a segmented character 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 using 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, the method 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 the public key, and 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. When a registration code is required, 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 into 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] ⑹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 "+", the process returns to step S202 and is repeated 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 embodiment, during the registration code generation process, sk is a large integer of 112 bits; and the random number k is 112 bits in length.

[0086] Furthermore, r of the signature value is determined based on the upper 32 bits (or lower 32 bits, or the middle 32 bits of all 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 then 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. Through the innovative short signature algorithm designed by the present invention, the signature length is greatly shortened to meet the requirement that registration codes are typically less than 30 characters, significantly improving the user experience. This embodiment generates a machine code based on the hardware information of the software running device and the software's identification information, and then generates a registration code based on the machine code. This achieves hardware binding between the software and the operating environment, effectively addressing software copyright protection issues. Any illegally copied software to unauthorized devices will be unable to run.

[0091] One embodiment of the present invention discloses a registration code verification method based on an elliptic curve short signature, which is used to verify a 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 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 5 of step 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 Indicates 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, the software is returned to the registration code input interface.

[0106] This embodiment discloses a registration code verification method based on an elliptic curve short signature, which verifies a registration code generated using the registration code generation method of the present invention. 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. Therefore, the registration code cannot be counterfeited or forged. Any attack attempt to generate a registration code cracking tool software is futile, effectively achieving copyright protection for the software.

[0107] The registration code generation and verification of the present invention utilizes a public cryptographic algorithm, and its security relies on public key cryptography. Given current computer processing capabilities, public key cryptographic algorithms are generally recognized as secure, and their cryptographic strength is provably secure. Therefore, the generation and verification methods of the present invention are safe and effective, and address the issue of hackers reverse-analyzing the registration code to obtain the registration code generation algorithm and develop a registration machine cracking program. Furthermore, because the present invention utilizes a short signature algorithm, it addresses the issue of authorization codes generated using public key cryptographic signature algorithms being too long to be used in the form of registration codes.

[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. 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 the 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 embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with this technical field within the technical scope disclosed by the present invention should be covered by the scope of protection 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 perform 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); including: generating a random number k and calculating the point P = k·G on the elliptic curve corresponding to k; wherein G is a base point of the elliptic curve, and its order is a prime number; determine the signature value r based on the x-coordinate of the elliptic curve point P, including determining the signature value r based on the upper 32 bits, or the lower 32 bits, or the middle 32 bits of all bits of the x-coordinate of the elliptic curve point P; calculate a 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; 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; sk is the private key, which is a 112-bit large integer, and the random number k is 112 bits long; the signature value (r, s) is constructed based on r and s; Generate a registration code for the software running on the device based on the signature value (r, s).

2. The registration code generation method according to claim 1, wherein: Generating a registration code for the software running 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.

3. The registration code generation method according to claim 2, wherein: 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: splicing the hardware information and the identification information into an information string; Calculate the 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 position, and performing a logical operation on the two groups of data to obtain corresponding information bit 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.

4. The registration code generation method according to claim 3, wherein: 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.

5. 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 according to any one of claims 1 to 4; The registration code verification method includes: 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').

6. The registration code verification method according to claim 5, 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 character string to obtain a corresponding byte stream; A signature value (r', s') is obtained based on the corresponding byte stream.

7. The registration code verification method according to claim 6, characterized in that: The verification of the registration code based on the machine code and the signature value (r′, s′) includes: 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′; Taking the large integer h′ modulo 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′, where 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.

8. A registration code generation and verification system based on elliptic curve short signature, characterized in that: include: A machine code generation module, configured to generate a machine code corresponding to the software running on the device 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 a machine code based on the private key sk in a generated random elliptic curve key pair (sk, PK) to obtain a corresponding signature value (r, s); generate a registration code for the software running on the device based on the signature value (r, s); wherein, performing 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) includes: generating a random number k and calculating a point P = k·G on the elliptic curve corresponding to k; wherein G is a base point of the elliptic curve, and its order is a prime number; determining the signature value r based on the x-coordinate of the elliptic curve point P, including determining the signature value r based on the upper 32 bits, or the lower 32 bits, or the middle 32 bits of all bits of 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; calculating 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; sk is the private key, which is a 112-bit large integer, and the random number k is 112 bits long; the signature value (r, s) is constructed based on r and s; 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′).

9. The registration code generation and verification system according to claim 8, 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

  • Software authorization method and system

    CN117313045A