Electronic signature method and device, equipment and storage medium

By introducing SM2 certificate-free technology into the electronic signature system, the problems of large computing resources and high operating costs under PKI technology are solved, and efficient and reliable electronic signatures are achieved, reducing resource consumption.

CN119720292APending Publication Date: 2025-03-28CHENGDU WEISHITONG INFORMATION SECURITY TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411947317.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The existing electronic signature technology relies on PKI technology, resulting in high computing resources consumption and high operating costs, and embed certificates in the signature data structure, increasing resource consumption of storage and bandwidth.

Method used

The electronic signature system based on SM2 without certificate is adopted. The system public parameters are initialized by the server, the client generates identity identification and performs data authentication, and the SM2 algorithm is used for encryption and signature to realize the electronic signature without certificate.

Benefits of technology

It effectively guarantees the credibility and traceability of identity identification, ensures the accuracy and reliability of signatures, and reduces operating costs and resource losses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119720292A_ABST
    Figure CN119720292A_ABST
Patent Text Reader

Abstract

The invention discloses an electronic signature method, device and equipment and a storage medium, relates to the technical field of information security, is applied to an SM2-based certificateless electronic signature system, and comprises the following steps: calling a three-party trusted timestamp service through a client to authenticate timestamp data determined by using an identity label of a signer and label generation equipment information; after the authentication succeeds, encrypting a second user private key determined based on a first user private key sent by the client and the identity label through the server based on a preset SM2 encryption rule; verifying a target private key determined based on the encrypted data obtained by decryption through the client; after verification succeeds, signing the to-be-signed data through the client based on the target private key and an SM2 algorithm to obtain a signature value; performing data assembly based on the data type of the signature application data corresponding to the signature value through the server to obtain signature data; the application signature data is the initial to-be-signed data. And the cost can be effectively reduced.
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 an electronic signature method, device, equipment and storage medium. Background Art

[0002] With the rapid development of enterprise informatization and digital transformation, electronic signature has become an important part of the digital age.

[0003] However, in the current electronic signature process, PKI (Public Key Infrastructure) technology is mostly used. This technology requires the establishment of a systematic trusted certificate issuing agency and key management system. This technology requires the management of the entire life cycle of certificates from generation to revocation. The system deployment and operation requires huge computing resources and high operating costs. In addition, the electronic signature data structure using the PKI mechanism usually embeds the certificate, which increases the data size and the consumption of storage resources, especially in situations where storage and bandwidth resources are sensitive. Its use is limited. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide an electronic signature method, device, equipment and storage medium, which can effectively ensure the credibility and traceability of identity identification, thereby ensuring the accuracy and reliability of signatures, and can effectively implement certificateless electronic signatures according to the data type of the signature application data, thereby reducing operating costs and resource loss. The specific scheme is as follows:

[0005] In a first aspect, the present application provides an electronic signature method, which is applied to an electronic signature system based on SM2 without a certificate, including:

[0006] After the server initializes and generates system public parameters, the client generates a corresponding identity based on the signer information, and uses the identity and the corresponding identity generation device information to determine the corresponding timestamp data, so as to call the three-party trusted timestamp service located on the server for data authentication based on the timestamp data;

[0007] After the data authentication is successful, the server determines the corresponding user declared public key and the second user private key based on the system public parameters and the first user private key and the identity identifier sent by the client, and encrypts the user declared public key and the second user private key based on the preset SM2 encryption rule to obtain the corresponding encrypted data;

[0008] Decrypting the encrypted data returned by the server by the client using the first user private key, determining the target private key corresponding to the signer according to the decryption result and the first user private key, and triggering the corresponding target private key verification operation;

[0009] After the target private key is successfully verified, the client signs the data to be signed in the list of data to be signed obtained from the server based on the system public parameters, the user declared public key, the target private key and the SM2 algorithm to obtain a signature value;

[0010] The signature value returned by the client is received by the server, and data is assembled based on the data type of the application signature data corresponding to the signature value to complete the corresponding electronic signature operation and obtain the corresponding signature data; the application signature data is the initial data to be signed determined based on the signature request sent by the business system to the server.

[0011] Optionally, the generating of system public parameters through initialization on the server side includes:

[0012] Defining an elliptic curve and curve elements and base points corresponding to the elliptic curve on a target finite field through a server;

[0013] Determine a corresponding interval based on the order of the base point, and generate a random number according to the interval, so as to use the obtained random number as a system private key;

[0014] Determine a corresponding system public key based on the system private key and the base point;

[0015] Corresponding system public parameters are determined based on the elliptic curve, the base point, the order, the system public key and the SM3 algorithm.

[0016] Optionally, the client generates a corresponding identity based on the signer information, and uses the identity and the corresponding identity generation device information to determine the corresponding timestamp data, so as to call a third-party trusted timestamp service located on the server for data authentication based on the timestamp data, including:

[0017] Obtaining identification information and a corresponding time point input by the signer through the client, and generating a corresponding identity based on the identification information and the time point;

[0018] Obtaining device information for generating the identity identifier to obtain corresponding identifier generating device information;

[0019] Assembling the identity identifier and the identifier generating device information to obtain corresponding timestamp data;

[0020] The timestamp data is sent to the server, so that the server can call a three-party trusted timestamp service to perform trusted authentication on the timestamp data and obtain a corresponding authentication result.

[0021] Optionally, before the server performs the process based on the system public parameters and the first user private key and the identity identifier sent by the client, the process further includes:

[0022] Generating a random number within the interval by the client to obtain a corresponding first user private key;

[0023] Performing calculation based on the first user private key and the base point to obtain a corresponding first calculation result;

[0024] The first calculation result and the identity identifier are sent to the server.

[0025] Optionally, the determining, by the server based on the system public parameters and the first user private key and the identity identifier sent by the client, a corresponding user declared public key and a second user private key, and encrypting the user declared public key and the second user private key based on a preset SM2 encryption rule to obtain corresponding encrypted data includes:

[0026] The server performs calculation based on the system public parameters and the identity identifier to obtain a corresponding second calculation result;

[0027] Generate a random number within the interval, and determine a corresponding user declared public key using the obtained target random number, the base point, and the first calculation result;

[0028] Convert the data types corresponding to the abscissa and ordinate of the user declared public key into a bit string, and perform calculation using the converted abscissa, the converted ordinate and the second calculation result to obtain a corresponding third calculation result;

[0029] After converting the data type of the third calculation result into an integer, determining the second user private key based on the converted third calculation result, the target random number and the order;

[0030] The first calculation result is used as the public key, and the SM2 algorithm is used to encrypt the second user private key and the user declared public key to obtain corresponding encrypted data.

[0031] Optionally, determining a target private key corresponding to the signer according to the obtained decryption result and the first user private key, and triggering a corresponding target private key verification operation, includes:

[0032] Determine, by the client, a target private key corresponding to the signer using the first user private key and the second user private key in the decryption result;

[0033] When the target private key meets a preset condition, determining a corresponding first target public key based on the target private key;

[0034] Determine a corresponding second target public key based on the user declared public key, the identity identifier and the system public parameter;

[0035] It is determined whether the first target public key is equal to the second target public key, and when the determination result indicates that they are equal, it is determined that the target private key verification is successful to obtain the corresponding target public-private key pair.

[0036] Optionally, the step of signing the data to be signed in the list of data to be signed obtained from the server based on the system public parameters, the user declared public key, the target private key and the SM2 algorithm by the client to obtain a signature value includes:

[0037] Sending a request to obtain a list of data to be signed to the server through the client to obtain a current list of data to be signed;

[0038] Convert the data types corresponding to the abscissa and ordinate of the user's declared public key into a bit string to obtain the converted abscissa and the converted ordinate;

[0039] The data to be signed in the list of data to be signed is signed based on the converted horizontal coordinate, the converted vertical coordinate, the target private key, the system public parameters, the user declared public key and the SM2 algorithm to obtain a corresponding signature value.

[0040] Optionally, after obtaining the corresponding signed data, the process further includes:

[0041] Obtaining the signature data from the service end through the verification end, and parsing the signature data to obtain the corresponding signature value, the identity identifier, the user declared public key and the application signature data;

[0042] Performing user public key calculation based on the user declared public key, the identity identifier and the system public parameter to obtain a corresponding fourth calculation result;

[0043] The fourth calculation result and the signature value are verified based on the SM2 algorithm and the system public parameters to obtain corresponding verification results.

[0044] In a second aspect, the present application provides an electronic signature device, which is applied to an electronic signature system based on SM2 without a certificate, including:

[0045] A data authentication module is used to generate a corresponding identity based on the signer information through the client after the system public parameters are initialized and generated through the server, and to determine the corresponding timestamp data using the identity and the corresponding identification generation device information, so as to call the three-party trusted timestamp service located on the server for data authentication based on the timestamp data;

[0046] A first private key generation module is used to determine, through the server, a corresponding user declared public key and a second user private key based on the system public parameters and the first user private key and the identity identifier sent by the client after the data authentication is successful, and encrypt the user declared public key and the second user private key based on a preset SM2 encryption rule to obtain corresponding encrypted data;

[0047] A second private key generation module is used to decrypt the encrypted data returned by the server by using the first user private key through the client, and determine the target private key corresponding to the signer according to the obtained decryption result and the first user private key, and trigger the corresponding target private key verification operation;

[0048] A data signature module, used for signing the data to be signed in the list of data to be signed obtained from the server through the client based on the system public parameters, the user declared public key, the target private key and the SM2 algorithm after the target private key verification is successful, so as to obtain a signature value;

[0049] A data assembly module is used to receive the signature value returned by the client through the server, and to perform data assembly based on the data type of the application signature data corresponding to the signature value, so as to complete the corresponding electronic signature operation and obtain the corresponding signature data; the application signature data is the initial data to be signed determined based on the signature request sent by the business system to the server.

[0050] In a third aspect, the present application provides an electronic device, including:

[0051] Memory, used to store computer programs;

[0052] The processor is used to execute the computer program to implement the steps of the aforementioned electronic signature method.

[0053] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, which implements the steps of the aforementioned electronic signature method when executed by a processor.

[0054] It can be seen that in the present application, the electronic signature system based on SM2 certificateless, firstly, after the system public parameters are initialized and generated by the server, the corresponding identity is generated by the client based on the signer information, and the corresponding timestamp data is determined by using the identity and the corresponding identity generation device information, so as to call the third-party trusted timestamp service located on the server for data authentication based on the timestamp data; after the data authentication is successful, the server determines the corresponding user declared public key and the second user private key based on the system public parameters and the first user private key and the identity sent by the client, and encrypts the user declared public key and the second user private key based on the preset SM2 encryption rules to obtain the corresponding encrypted data; the client uses the first user private key to authenticate the data. The encrypted data returned by the server is decrypted, and the target private key corresponding to the signer is determined based on the decryption result and the first user private key, and the corresponding target private key verification operation is triggered; after the target private key verification is successful, the client signs the data to be signed in the list of data to be signed obtained from the server based on the system public parameters, the user declared public key, the target private key and the SM2 algorithm to obtain a signature value; the server receives the signature value returned by the client, and assembles the data based on the data type of the application signature data corresponding to the signature value to complete the corresponding electronic signature operation and obtain the corresponding signing data; the application signature data is the initial data to be signed determined based on the signature request sent by the business system to the server. That is, before the signature value, the client first performs a trusted authentication on the signer's identity and the device that generates the identity. After the authentication is successful, the client and the client are coordinated to determine the target private key corresponding to the signer using the identity and the system public parameters. After the target private key is successfully verified, the data to be signed in the list of data to be signed obtained from the server is signed by the client using the target private key and the SM2 algorithm to obtain a signature value. Afterwards, the signature value is assembled by the client according to the data type of the corresponding application signature data. In this way, on the one hand, a third-party trusted timestamp service is introduced to authenticate the generation of the identity, thereby ensuring the credibility and traceability of the identity, and further ensuring the accuracy and reliability of the signature; on the other hand, it can effectively realize certificateless electronic signature according to the data type of the application signature data, thereby reducing operating costs and resource loss. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0056] Figure 1 A flow chart of an electronic signature method provided for this application;

[0057] Figure 2 A schematic diagram of the process of generating a specific user identification and user key pair provided for this application;

[0058] Figure 3 A schematic diagram of a specific electronic signature process provided for this application;

[0059] Figure 4 A specific signature verification process diagram provided for this application;

[0060] Figure 5 A schematic diagram of the structure of an electronic signature device provided for this application;

[0061] Figure 6 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION

[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0063] However, in the current electronic signature process, PKI (Public Key Infrastructure) technology is mostly used. This technology requires the establishment of a systematic trusted certificate issuing agency and key management system. This technology requires the management of the entire life cycle of certificates from generation to revocation. The system deployment and operation requires huge computing resources, and the operating cost is high. In addition, the electronic signature data structure after using the PKI mechanism usually embeds the certificate, which increases the data size and storage resource consumption, especially in the case of sensitive storage and bandwidth resources. The use is limited. To this end, the present application provides an electronic signature scheme that can effectively ensure the credibility and traceability of the identity, thereby ensuring the accuracy and reliability of the signature, and can effectively implement certificateless electronic signatures according to the data type of the signature application data, thereby reducing operating costs and resource loss.

[0064] See also Figure 1 As shown, an embodiment of the present invention discloses an electronic signature method, which is applied to an electronic signature system based on SM2 without a certificate, including:

[0065] Step S11: After the server is initialized to generate system public parameters, the client generates a corresponding identity based on the signer information, and uses the identity and the corresponding identity generation device information to determine the corresponding timestamp data, so as to call the third-party trusted timestamp service located on the server for data authentication based on the timestamp data.

[0066] In this embodiment, combined with Figure 2 As shown, before starting to sign, the server of the electronic signature system needs to be initialized first, initialize the local key generation logic block, and generate the system public and private key pair and system public parameters. The system public parameters and system public key are released to the outside, and the system private key is protected by the cryptographic logic block in the system. The specific steps are as follows:

[0067] 1) Select system parameters through the server and define an elliptic curve E(Fq) on the target finite field Fq. E(Fq) is Y2=X3+ax+b. The elliptic curve parameters include the scale q of the finite field Fq (q≠2m). Define two curve elements a, b∈Fq of the elliptic function E(Fq), G=(x G ,y G )(G≠O) is the base point of the elliptic curve E(Fq), x G and G is the abscissa and ordinate of the base point G;

[0068] 2) Determine the corresponding interval [1, n-1] based on the order n of the base point, and generate a random number according to the interval, so as to use the obtained random number ms∈[1, n-1] as the system private key;

[0069] 3) Determine the corresponding system public key Ppub=[ms]G ​​based on the system private key ms and the base point;

[0070] Based on the elliptic curve, the base point, the order, the system public key and the SM3 algorithm, the corresponding system public parameters params={E(Fq), G, n, Ppub, H} are determined, where H is the national secret summary algorithm SM3.

[0071] Furthermore, in this embodiment, after the server completes initialization, the client needs to generate a corresponding identity based on the signer information, and use the identity and the corresponding identity generation device information to determine the corresponding timestamp data, so as to call the three-party trusted timestamp service located on the server for trusted authentication based on the timestamp data. Specifically,

[0072] 1) Obtain the signer through the client (that is, Figure 2 The identification information (including ID card card_id, email address and other unique identification information) and the corresponding time point (expressed as time) entered by user A in the example above are used to generate the corresponding identity ID based on the identification information and the time point. A , ID A =H 256 (card_id||mail||time);

[0073] 2) Obtain the device information for generating the identity to obtain the corresponding device information for generating the identity, deviceInfo, where deviceInfo = (device mac address || device hard disk serial number);

[0074] 3) Assemble the identity identifier and the identifier generating device information to obtain the corresponding timestamp data timeStampApplyData(deviceInfo||ID A ), and call the application timestamp interface of the server to authenticate the generation of this identifier, that is, send the timestamp data to the server;

[0075] 4) The server calls the three-party trusted timestamp service to perform trusted authentication on the timestamp data and obtain the corresponding authentication result. The server stores the timestamp result. In this way, the client generates the user's identity, and uses timestamp protection for the identity and the environmental information generated by the identity, ensuring that the identity has been generated in the environment and at the time, and then the server performs trusted authentication on the identity and the environmental information generated by the identity. In this way, the user identification model in the electronic signature system is effectively constructed, ensuring the uniqueness and traceability of the identity.

[0076] Step S12: After the data authentication is successful, the server determines the corresponding user declared public key and the second user private key based on the system public parameters and the first user private key and the identity identifier sent by the client, and encrypts the user declared public key and the second user private key based on the preset SM2 encryption rules to obtain the corresponding encrypted data.

[0077] Combination Figure 2As shown, in this embodiment, after the trusted authentication of the identity identifier is passed, the client and the server need to collaborate to generate a user key pair. The specific steps are as follows:

[0078] 1) Generate a random number in the interval by the client A '∈[1,n-1], to obtain the corresponding first user private key, that is, the temporary private key of user A;

[0079] 2) Calculate U based on the first user private key and the base point A =[d A ']G, to obtain the corresponding first calculation result U A ;

[0080] 3) The first calculation result U A and the identity ID A Send to the server for registration;

[0081] 4) The server performs calculation based on the system public parameters and the identity identifier, H A =H 256 (ENTL A ||ID A ||a||b||x G ||y G ||x Pub ||y Pub ), to obtain the corresponding second calculation result H A , where H 256 SHA-256 (Secure Hash Algorithm 256-bit) refers to a hash algorithm with a digest result length of 256 bits. The default is the SM3 hash algorithm of the national secret. A is ID A The bit length of x is converted into two bytes; G and G is the horizontal and vertical coordinates of the base point G on the SM2 elliptic curve (i.e. the aforementioned elliptic curve E(Fq)); Pub ,y Pub are the horizontal and vertical coordinates of the system public key Ppub on the SM2 elliptic curve;

[0082] 5) Generate a random number w∈[1,n-1] within the interval, and use the obtained target random number w, the base point G, and the first calculation result U A Determine the corresponding user declared public key W A , W A =[w]G+U A ;

[0083] 6) According to the method given in 4.2.6 and 4.2.5 of GB / T 32918.1-2016, the user's declared public key W A The horizontal coordinate x WA and the ordinate y WA The corresponding data type is converted into a bit string, and the converted abscissa, the converted ordinate and the second calculation result are used to calculate λ=H 256 (x WA ‖y WA ‖H A ) mod n, to obtain a corresponding third calculation result λ, wherein mod is a modulus operator in mathematical operation symbols;

[0084] 7) After converting the data type of the third calculation result λ into an integer according to the method given in 4.2.4 and 4.2.3 of GB / T 32918.1-2016, determine the second user private key t based on the converted third calculation result, the target random number and the order A , t A =(w+λ*ms) mod n;

[0085] 8) The first calculation result U A As the public key, the SM2 algorithm is used to convert the second user's private key t A And the user declares the public key W A Encrypt to obtain the corresponding encrypted data.

[0086] Step S13: Decrypt the encrypted data returned by the server by the client using the first user private key, determine the target private key corresponding to the signer based on the decryption result and the first user private key, and trigger the corresponding target private key verification operation.

[0087] Specifically, in this embodiment, after obtaining the encrypted data, the encrypted data is transmitted to the client to the user A. Then the user A can use d A 'Decrypt to include t A After that, the user private key is determined and the key pair verification is performed. That is, the target private key corresponding to the signer is determined according to the obtained decryption result and the first user private key, and the corresponding target private key verification operation is triggered, including: using the first user private key d A ' and the second user private key t in the decryption result A Determine the target private key d corresponding to the signer A. When the target private key meets the preset conditions, determine the corresponding first target public key based on the target private key; determine the corresponding second target public key based on the user's declared public key, the identity identifier, and the system public parameters; determine whether the first target public key is equal to the second target public key, and when the judgment result indicates equality, determine that the verification of the target private key is successful to obtain the corresponding target public-private key pair. That is, user A calculates d A =(t A +d A ’) mod n, if 0 < d A < n - 1, then output (d A , W A ), otherwise return d A ’, where d A is the private key of user A, and W A is the declared public key of user A. Generate the user's public key using the user's private key, P A1 =[D A G. Generate the user's public key P A2 using the declared public key, user identifier, etc.:

[0088] H A =H 256 (ENTL A ||ID A ||a||b||x G ||y G ||x Pub ||y Pub );

[0089] λ = H 256 (x WA ||y WA ||H A ) mod n;

[0090] P A2 =W A + [λ]Ppub.

[0091] If P A1 = P A2 , then the verification passes, indicating that the user's key generation is correct, and determine the target public-private key pair corresponding to user A.

[0092] Step S14. After the verification of the target private key is successful, use the client to sign the data to be signed in the list of data to be signed obtained from the server based on the system public parameters, the user's declared public key, the target private key, and the SM2 algorithm to obtain the signature value.

[0093] In this embodiment, in combination with Figure 3As shown, after determining the target public-private key pair, the client will apply for the server's data list to be signed for electronic signature. It should be understood that the server processes the signature request, provides an interface to generate the signature request, and generates the corresponding data to be signed according to the data type. The specific steps are as follows:

[0094] 1) The business system uploads a request containing the signature application data through the interface to apply for a signature;

[0095] 2) The server parses the request and generates corresponding data to be signed according to the data type of the application signature data in the request. The server centrally preprocesses the application signature data to improve the signing efficiency. If the data format of the application signature data is a PDF (Portable Document Format) file, the data to be signed is obtained according to the "GMT 0112-2021 Technical Requirements for Password Application of PDF Format Documents"; if it is OFD (Open Fixed-layout Document), the data to be signed is obtained according to the "GMT 0099-2020 Technical Specifications for Password Application of Open Layout Documents"; if it is a pure string, no processing is performed, and the application signature data is directly determined as the data to be signed, that is, toSignData;

[0096] 3) Perform a summary operation on the determined data to be signed, H toSignData =H 256 (toSignData);

[0097] 4) Organizing the application information, which includes an application ID (Identity Document, identity information), the application signature data and the data to be signed HtoSignData, and storing the application information in the data list to be signed in the database.

[0098] Afterwards, the client accesses the server through an interface to obtain the list of data to be signed, and uses the target private key d A Sign and return the signature data to the server. The specific steps are as follows:

[0099] 1) The client sends a request to obtain a list of data to be signed to the server to obtain the current list of data to be signed;

[0100] 2) According to the method given in 4.2.6 and 4.2.5 of GB / T 32918.1-2016, the user's declared public key W A The horizontal coordinate x WA and the ordinate y WAThe corresponding data type is converted into a bit string to obtain the converted abscissa and the converted ordinate;

[0101] 3) The data to be signed H in the list of data to be signed is analyzed based on the converted horizontal coordinate, the converted vertical coordinate, the target private key, the system public parameter, the user declared public key and the SM2 algorithm. toSignData Sign SIGN(params,H A ,x WA ‖y WA ,H toSignData ,d A ) to obtain the corresponding signature value (r, s);

[0102] 4) Encapsulate the signature value in the following ASN1 (Abstract Syntax Notation One, which can be regarded as a high-level protocol description language) format:

[0103] ECS_SIGN ::= SEQUENCE {

[0104] r INTEGER,

[0105] s INTEGER,

[0106] W OCTET STRING OPTIONAL

[0107] }

[0108] After the encapsulation is completed, the encapsulated signature value is returned to the server.

[0109] Step S15: receiving the signature value returned by the client through the server, and assembling data based on the data type of the application signature data corresponding to the signature value to complete the corresponding electronic signature operation and obtain corresponding signing data; the application signature data is the initial data to be signed determined based on the signature request sent by the business system to the server.

[0110] Combined with the above Figure 3As shown, in this embodiment, the server receives the signature value sent by the client and assembles it to form signed data. Specifically, the server assembles the data by parsing the data type of the application signature data corresponding to the signature value. If the data type of the application signature data is a PDF file, the signed data is assembled according to the "GMT 0112-2021 Technical Requirements for Password Application of PDF Format Documents" and the signature value; if it is OFD, the signed data is assembled according to the "GMT0099-2020 Technical Specifications for Password Application of Open Format Documents" and the signature value; if it is a pure string, the PCKS7 structure and the signature value are used to assemble the signed data to obtain the signed data. In this way, this embodiment defines the signature structure according to the different data types of the data to be signed, assembles and parses the signed data, which can effectively improve the user experience.

[0111] In addition, after completing the electronic signature, this embodiment will notify the business system that the signature is completed. Then the business system can apply to the server to download the signed data. And the business system can verify the signed data as a verification end. Figure 4 As shown, the specific steps are as follows:

[0112] 1) The verification end obtains the signature data from the server and parses the signature data to obtain the corresponding signature value (r´, s´) and the identity ID A , the user declares the public key W A and the application signature data M´;

[0113] 2) Calculate the user public key based on the user declared public key, the identity identifier and the system public parameter to obtain a corresponding fourth calculation result P A ;

[0114] 3) Verify the fourth calculation result and the signature value based on the SM2 algorithm and the system public parameters VERIFY(params, H A ,x WA ‖y WA ‖M´,P A ,(r´,s´)) to get the corresponding verification result. In this way, the signature verification process based on SM2 without certificate is realized.

[0115] In summary, the electronic signature process described in this embodiment has the following advantages over the traditional electronic signature system: compared with the traditional identity identification that directly uses the user's ID card and other information, this embodiment introduces a third-party trusted timestamp service to authenticate the identity identification generation, ensuring that the identity identification result is reliable and traceable; avoiding complex certificate management, and the signature data structure is usually less than 100 bytes, thereby reducing the storage and network transmission burden; the certificateless process based on SM2 consumes less computing resources than the certificateless process based on bilinear pairings. The signing and verification time of bilinear pairings is relatively long, usually more than ten times that of the ECC (Elliptic Curve Cryptography) algorithm, and has high performance requirements on terminal devices. At the same time, SM2 is the current mainstream national secret signature algorithm, which is easier to implement and promote in a national secret environment.

[0116] It can be seen that, before signing the value, the present application first uses the client to perform trusted authentication on the identity of the signer and the device that generates the identity. After the authentication is successful, the target private key corresponding to the signer is determined by the client and in collaboration with the client using the identity and the system public parameters. After the target private key is successfully verified, the data to be signed in the list of data to be signed obtained from the server is signed by the client using the target private key and the SM2 algorithm to obtain a signature value. Afterwards, the signature value is assembled by the client according to the data type of the corresponding application signature data. In this way, on the one hand, a third-party trusted timestamp service is introduced to authenticate the generation of the identity, thereby ensuring the credibility and traceability of the identity, and then ensuring the accuracy and reliability of the signature; on the other hand, it can effectively implement a certificateless electronic signature according to the data type of the application signature data, thereby reducing operating costs and resource loss.

[0117] See also Figure 5 As shown, the embodiment of the present application also discloses an electronic signature device, which is applied to the electronic signature system based on SM2 without certificate, including:

[0118] The data authentication module 11 is used to generate a corresponding identity based on the signer information through the client after the system public parameters are initialized through the server, and determine the corresponding timestamp data using the identity and the corresponding identification generation device information, so as to call the three-party trusted timestamp service located on the server for data authentication based on the timestamp data;

[0119] A first private key generation module 12 is used to determine, after the data authentication is successful, the corresponding user declared public key and the second user private key based on the system public parameters and the first user private key and the identity identifier sent by the client through the server, and encrypt the user declared public key and the second user private key based on a preset SM2 encryption rule to obtain corresponding encrypted data;

[0120] The second private key generation module 13 is used to decrypt the encrypted data returned by the server by using the first user private key through the client, and determine the target private key corresponding to the signer according to the obtained decryption result and the first user private key, and trigger the corresponding target private key verification operation;

[0121] A data signature module 14 is used to sign the data to be signed in the list of data to be signed obtained from the server through the client based on the system public parameters, the user declared public key, the target private key and the SM2 algorithm after the target private key verification is successful, so as to obtain a signature value;

[0122] The data assembly module 15 is used to receive the signature value returned by the client through the server, and perform data assembly based on the data type of the application signature data corresponding to the signature value to complete the corresponding electronic signature operation and obtain the corresponding signature data; the application signature data is the initial data to be signed determined based on the signature request sent by the business system to the server.

[0123] Among them, for more specific working processes of the above-mentioned modules, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0124] It can be seen that, before signing the value, the present application first uses the client to perform trusted authentication on the identity of the signer and the device that generates the identity. After the authentication is successful, the target private key corresponding to the signer is determined by the client and in collaboration with the client using the identity and the system public parameters. After the target private key is successfully verified, the data to be signed in the list of data to be signed obtained from the server is signed by the client using the target private key and the SM2 algorithm to obtain a signature value. Afterwards, the signature value is assembled by the client according to the data type of the corresponding application signature data. In this way, on the one hand, a third-party trusted timestamp service is introduced to authenticate the generation of the identity, thereby ensuring the credibility and traceability of the identity, and then ensuring the accuracy and reliability of the signature; on the other hand, it can effectively implement a certificateless electronic signature according to the data type of the application signature data, thereby reducing operating costs and resource loss.

[0125] In some specific embodiments, the data authentication module 11 may specifically include:

[0126] A curve definition unit, used to define an elliptic curve and curve elements and base points corresponding to the elliptic curve on a target finite field through a server;

[0127] a system private key determination unit, configured to determine a corresponding interval based on the order of the base point, and generate a random number according to the interval, so as to use the obtained random number as the system private key;

[0128] a system public key determination unit, configured to determine a corresponding system public key based on the system private key and the base point;

[0129] A public parameter determination unit is used to determine corresponding system public parameters based on the elliptic curve, the base point, the order, the system public key and the SM3 algorithm.

[0130] In some specific embodiments, the data authentication module 11 may specifically include:

[0131] An identification generating unit, used to obtain identification information and a corresponding time point input by the signer through the client, and generate a corresponding identity identification based on the identification information and the time point;

[0132] A device information acquisition unit, used to acquire the device information for generating the identity identification to obtain the corresponding identification generation device information;

[0133] The timestamp data acquisition device is used to assemble the identity identifier and the identifier generation device information to obtain the corresponding timestamp data;

[0134] The trusted authentication unit is used to send the timestamp data to the server, so that the server can call a three-party trusted timestamp service to perform trusted authentication on the timestamp data and obtain a corresponding authentication result.

[0135] In some specific embodiments, the electronic signature device may further include:

[0136] A first user private key generation unit, configured to generate a random number within the interval through the client to obtain a corresponding first user private key;

[0137] A first calculation unit, configured to perform calculation based on the first user private key and the base point to obtain a corresponding first calculation result;

[0138] A data sending unit is used to send the first calculation result and the identity identifier to the server.

[0139] In some specific embodiments, the first private key generation module 12 may specifically include:

[0140] A second calculation unit, configured to perform calculation based on the system public parameters and the identity identifier through the server to obtain a corresponding second calculation result;

[0141] a declared public key acquisition unit, configured to generate a random number within the interval, and determine a corresponding user declared public key using the obtained target random number, the base point, and the first calculation result;

[0142] a third calculation unit, configured to convert data types corresponding to the abscissa and the ordinate of the user-declared public key into a bit string, and perform calculation using the converted abscissa, the converted ordinate and the second calculation result to obtain a corresponding third calculation result;

[0143] A second user private key determining unit, configured to determine the second user private key based on the converted third calculation result, the target random number and the order after converting the data type of the third calculation result into an integer;

[0144] A data encryption unit is used to use the first calculation result as a public key and adopt an SM2 algorithm to encrypt the second user private key and the user declared public key to obtain corresponding encrypted data.

[0145] In some specific embodiments, the second private key generation module 13 may specifically include:

[0146] a target private key determination unit, configured to determine a target private key corresponding to the signer by using the first user private key and the second user private key in the decryption result through the client;

[0147] A first target public key generating unit, configured to determine a corresponding first target public key based on the target private key when the target private key meets a preset condition;

[0148] A second target public key generating unit, configured to determine a corresponding second target public key based on the user declared public key, the identity identifier and the system public parameter;

[0149] The verification success unit is used to determine whether the first target public key is equal to the second target public key, and when the judgment result shows that they are equal, determine that the target private key verification is successful to obtain the corresponding target public-private key pair.

[0150] In some specific embodiments, the data signature module 14 may specifically include:

[0151] A list acquisition unit, configured to send a request for acquiring a list of data to be signed to the server through the client to acquire a current list of data to be signed;

[0152] A type conversion unit, used to convert the data types corresponding to the abscissa and the ordinate of the user-declared public key into a bit string to obtain the converted abscissa and the converted ordinate;

[0153] A signature value acquisition unit is used to sign the data to be signed in the data list to be signed based on the converted horizontal coordinate, the converted vertical coordinate, the target private key, the system public parameters, the user declared public key and the SM2 algorithm to obtain a corresponding signature value.

[0154] In some specific embodiments, the electronic signature device may further include:

[0155] A data parsing unit, used to obtain the signed data from the service end through the verification end, and parse the signed data to obtain the corresponding signature value, the identity identifier, the user declared public key and the application signature data;

[0156] a fourth calculation unit, configured to calculate the user public key based on the user declared public key, the identity identifier and the system public parameter to obtain a corresponding fourth calculation result;

[0157] A signature value verification unit is used to verify the fourth calculation result and the signature value based on the SM2 algorithm and the system public parameters to obtain a corresponding verification result.

[0158] Furthermore, the present application also discloses an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0159] Figure 6 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the electronic signature method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0160] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0161] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0162] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including computer programs that can be used to complete the electronic signature method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.

[0163] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the electronic signature method disclosed above. The specific steps of the method can refer to the corresponding contents disclosed in the above embodiments, and will not be repeated here.

[0164] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0165] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0166] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0167] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0168] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An electronic signature method, characterized in that: Applied to SM2 certificateless electronic signature system, including: After the server initializes and generates system public parameters, the client generates a corresponding identity based on the signer information, and uses the identity and the corresponding identity generation device information to determine the corresponding timestamp data, so as to call the three-party trusted timestamp service located on the server for data authentication based on the timestamp data; After the data authentication is successful, the server determines the corresponding user declared public key and the second user private key based on the system public parameters and the first user private key and the identity identifier sent by the client, and encrypts the user declared public key and the second user private key based on the preset SM2 encryption rule to obtain the corresponding encrypted data; Decrypting the encrypted data returned by the server by the client using the first user private key, determining the target private key corresponding to the signer according to the decryption result and the first user private key, and triggering the corresponding target private key verification operation; After the target private key is successfully verified, the client signs the data to be signed in the list of data to be signed obtained from the server based on the system public parameters, the user declared public key, the target private key and the SM2 algorithm to obtain a signature value; The signature value returned by the client is received by the server, and data is assembled based on the data type of the application signature data corresponding to the signature value to complete the corresponding electronic signature operation and obtain the corresponding signature data; the application signature data is the initial data to be signed determined based on the signature request sent by the business system to the server.

2. The electronic signature method according to claim 1, characterized in that: The initialization of generating system public parameters through the server includes: Defining an elliptic curve and curve elements and base points corresponding to the elliptic curve on a target finite field through a server; Determine a corresponding interval based on the order of the base point, and generate a random number according to the interval, so as to use the obtained random number as a system private key; Determine a corresponding system public key based on the system private key and the base point; Corresponding system public parameters are determined based on the elliptic curve, the base point, the order, the system public key and the SM3 algorithm.

3. The electronic signature method according to claim 1, characterized in that: The client generates a corresponding identity based on the signer information, and uses the identity and the corresponding identification generation device information to determine the corresponding timestamp data, so as to call the three-party trusted timestamp service located at the server for data authentication based on the timestamp data, including: Obtaining identification information and a corresponding time point input by the signer through the client, and generating a corresponding identity based on the identification information and the time point; Obtaining device information for generating the identity identifier to obtain corresponding identifier generating device information; Assembling the identity identifier and the identifier generating device information to obtain corresponding timestamp data; The timestamp data is sent to the server, so that the server can call a three-party trusted timestamp service to perform trusted authentication on the timestamp data and obtain a corresponding authentication result.

4. The electronic signature method according to claim 2, characterized in that: Before the server is based on the system public parameters and the first user private key and the identity identifier sent by the client, the method further includes: Generating a random number within the interval by the client to obtain a corresponding first user private key; Performing calculation based on the first user private key and the base point to obtain a corresponding first calculation result; The first calculation result and the identity identifier are sent to the server.

5. The electronic signature method according to claim 4, characterized in that: The server determines the corresponding user declared public key and the second user private key based on the system public parameters and the first user private key and the identity identifier sent by the client, and encrypts the user declared public key and the second user private key based on a preset SM2 encryption rule to obtain corresponding encrypted data, including: The server performs calculation based on the system public parameters and the identity identifier to obtain a corresponding second calculation result; Generate a random number within the interval, and determine a corresponding user declared public key using the obtained target random number, the base point, and the first calculation result; Convert the data types corresponding to the abscissa and ordinate of the user declared public key into a bit string, and perform calculation using the converted abscissa, the converted ordinate and the second calculation result to obtain a corresponding third calculation result; After converting the data type of the third calculation result into an integer, determining the second user private key based on the converted third calculation result, the target random number and the order; The first calculation result is used as the public key, and the SM2 algorithm is used to encrypt the second user private key and the user declared public key to obtain corresponding encrypted data.

6. The electronic signature method according to claim 1, characterized in that: The step of determining the target private key corresponding to the signer according to the obtained decryption result and the first user private key, and triggering the corresponding target private key verification operation, includes: Determine, by the client, a target private key corresponding to the signer using the first user private key and the second user private key in the decryption result; When the target private key meets a preset condition, determining a corresponding first target public key based on the target private key; Determine a corresponding second target public key based on the user declared public key, the identity identifier and the system public parameter; It is determined whether the first target public key is equal to the second target public key, and when the determination result indicates that they are equal, it is determined that the target private key verification is successful to obtain the corresponding target public-private key pair.

7. The electronic signature method according to any one of claims 1 to 6, characterized in that: The client signs the data to be signed in the list of data to be signed obtained from the server based on the system public parameters, the user declared public key, the target private key and the SM2 algorithm to obtain a signature value, including: Sending a request to obtain a list of data to be signed to the server through the client to obtain a current list of data to be signed; Convert the data types corresponding to the abscissa and ordinate of the user's declared public key into a bit string to obtain the converted abscissa and the converted ordinate; The data to be signed in the list of data to be signed is signed based on the converted horizontal coordinate, the converted vertical coordinate, the target private key, the system public parameters, the user declared public key and the SM2 algorithm to obtain a corresponding signature value.

8. The electronic signature method according to claim 7, characterized in that: After obtaining the corresponding signature data, the following steps are also included: Obtaining the signature data from the service end through the verification end, and parsing the signature data to obtain the corresponding signature value, the identity identifier, the user declared public key and the application signature data; Performing user public key calculation based on the user declared public key, the identity identifier and the system public parameter to obtain a corresponding fourth calculation result; The fourth calculation result and the signature value are verified based on the SM2 algorithm and the system public parameters to obtain corresponding verification results.

9. An electronic signature device, characterized in that: Applied to SM2 certificateless electronic signature system, including: A data authentication module is used to generate a corresponding identity based on the signer information through the client after the system public parameters are initialized and generated through the server, and to determine the corresponding timestamp data using the identity and the corresponding identification generation device information, so as to call the three-party trusted timestamp service located on the server for data authentication based on the timestamp data; A first private key generation module is used to determine, through the server, a corresponding user declared public key and a second user private key based on the system public parameters and the first user private key and the identity identifier sent by the client after the data authentication is successful, and encrypt the user declared public key and the second user private key based on a preset SM2 encryption rule to obtain corresponding encrypted data; A second private key generation module is used to decrypt the encrypted data returned by the server by using the first user private key through the client, and determine the target private key corresponding to the signer according to the obtained decryption result and the first user private key, and trigger the corresponding target private key verification operation; A data signature module, used for signing the data to be signed in the list of data to be signed obtained from the server through the client based on the system public parameters, the user declared public key, the target private key and the SM2 algorithm after the target private key verification is successful, so as to obtain a signature value; A data assembly module is used to receive the signature value returned by the client through the server, and to perform data assembly based on the data type of the application signature data corresponding to the signature value, so as to complete the corresponding electronic signature operation and obtain the corresponding signature data; the application signature data is the initial data to be signed determined based on the signature request sent by the business system to the server.

10. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the electronic signature method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the electronic signature method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Identity authentication method, system, equipment and medium

    CN120090888A

  • Service request verification method and device, electronic equipment and storage medium

    CN120528606A

  • SM2-based encryption authentication method, apparatus and device, and storage medium

    CN121125312A