Disclosure of Invention
In order to solve the problems that in the prior art, under a complex power network environment, an illegal molecule is authenticated based on an RFID intelligent card, the illegal molecule is easy to impersonate legal equipment to misappropriate identity and single-point obstacle after acquiring equipment information, and meanwhile, in order to overcome the problems of low authentication efficiency and difficult key management caused by the complexity of a PKI authentication scheme, the invention provides a method and a system for authenticating an electric inspection device and a terminal based on an SM9 threshold signature algorithm, which are applicable to the scene, aiming at the scene that the electric inspection device needs to acquire data such as the running state of the terminal after the identity authentication of the electric terminal before overhauling the electric terminal.
According to an aspect of the invention, the invention provides a method for authenticating an electric inspection device and a terminal based on an SM9 threshold signature algorithm, which comprises the following steps:
the power terminal receives a request for verifying the identity of the power terminal, which is sent by the electric detection equipment;
the power terminal calls an integrated password module to generate an original message M according to the request, wherein the original message M comprises a terminal ID of the power terminal;
power terminal computing group G T Element g=e (P 1 ,P pub-s ) Generating a random number r 1 ∈[1,N-1]Calculation ofAnd combine the original messages M and w 1 To the power server, wherein P pub-s ,G 1 ,G 2 ,G T ,N,P 1 And g is a disclosure parameter of the cipher machine to the power terminal and the power server, P pub-s Is based on G 2 Generated master public key, G 1 ,G 2 ,G T Is a multiplication cyclic group with order of prime number N, P 1 Is G 1 G is G T E () is SM9 bilinear pair operation function;
the power terminal receives a server signature component h' and parameters s sent by the power server 2 Sum s 3 Wherein, the power server calculates a server signature component h' and a parameter s 2 Sum s 3 Comprising:
computing group G T Element g=e (P 1 ,P pub-s );
Generating random number r 2 ,r 3 ∈[1,N-1];
Calculation ofw′=w 2 ·w 3 ,h′=H 2 (M||w', N), wherein H 2 A second cryptographic function derived from the cryptographic hash function;
utilizing stored private key component d of power server s Calculation s 2 =d s ·r 3 ,s 3 =d s ·(r 2 -h), wherein the power server private key component d s The password machine is calculated by adopting an SM9 threshold signature algorithm based on the terminal ID of the power terminal;
the power terminal utilizes the power terminal private key component d t Calculating a terminal signature component s ', synthesizing a signature result (h ', s ') of the original message M with the server signature component h ', and sending the original message M and the signature result (h ', s ') to an electric inspection device, wherein a private key component of an electric power terminal is calculated by a crypto machine by adopting an SM9 threshold signature algorithm, and the calculation formula of the terminal signature component s ' is as follows:
s′=[r 1 ·s 2 +s 3 ]·d t ;
and the electric inspection equipment adopts an SM9 mathematical signature verification algorithm to verify the original message M and the signature result (h ', s'), and when the verification passes, the electric inspection equipment successfully authenticates the electric terminal.
According to another aspect of the present invention, there is provided a system for authenticating an electric inspection device and a terminal based on SM9 threshold signature algorithm, the system comprising: electric detection equipment, electric power terminal and electric power service end, wherein:
the electric detection equipment is used for sending a request for verifying the identity of the electric terminal to the electric terminal; adopting an SM9 mathematical signature verification algorithm to verify an original message M and a signature result (h ', s'), and when the verification passes, successfully authenticating the electric power terminal by the electric detection equipment;
the power terminal is used for receiving a request for verifying the identity of the power terminal, which is sent by the electric inspection equipment; according to the request, an integrated cryptographic module is called to generate the original message M; computing group G T Element g=e (P 1 ,P pub-s ) Generating a random number r 1 ∈[1,N-1]Calculation ofAnd combine the original messages M and w 1 Sending the data to an electric power server; receiving a server signature component h' and a parameter s sent by a power server 2 Sum s 3 The method comprises the steps of carrying out a first treatment on the surface of the Utilizing the power terminal private key component d t Calculating a terminal signature component s ', synthesizing a signature result (h', s ') of the original message M with the server signature component h', and transmitting the original message M and the signature result (h ', s') to an electric inspection device, wherein the original message M comprises a terminal ID of an electric terminal; p (P) pub-s ,G 1 ,G 2 ,G T ,N,P 1 And g is a disclosure parameter of the cipher machine to the power terminal and the power server, P pub-s Is based on G 2 Generated master public key, G 1 ,G 2 ,G T Is a multiplication cyclic group with order of prime number N, P 1 Is G 1 G is G T E () is SM9 bilinear pair operation function; the private key component of the electric power terminal is calculated by a cipher machine through an SM9 threshold signature algorithm, and the calculation formula of the terminal signature component s' is as follows:
s′=[r 1 ·s 2 +s 3 ]·d t ;
the power server is used for transmitting the original messages M and w according to the power terminal 1 Calculating to obtain a server signature component h' and a parameter s 2 Sum s 3 Comprising:
computing group G T Element g=e (P 1 ,P pub-s );
Generating random number r 2 ,r 3 ∈[1,N-1];
Calculation ofw′=w 2 ·w 3 ,h′=H 2 (M||w', N), wherein H 2 Is a second cryptographic function derived from the cryptographic hash function.
The method and the system for authenticating the electric inspection equipment and the terminal based on the SM9 threshold signature algorithm adopt the cryptographic technology based on the identity, register the terminal ID in batches at the power server according to the terminal serial number of the power terminal, take the terminal ID representing the equipment identity as a public key, and avoid the binding between the public key and the equipment identity by using certificates. The secret key is distributed through the cipher machine, and the authentication can be completed only by sending the terminal ID during authentication, so that the method and the system have high algorithm efficiency and low management cost, can effectively reduce the complexity of identity authentication in a massive terminal environment, and effectively ensure the security of the electric inspection equipment for authenticating the electric terminal by using the SM9 algorithm as a safe and efficient cipher algorithm. Further, the SM9 threshold signature mode is adopted to carry out equipment authentication, and a private key is divided into a plurality of participants in the threshold signature process, so that an effective signature of a message is generated, and a plurality of participants are required to cooperate, thereby effectively solving the problems of identity impersonation and single-point obstacle and avoiding the risk of single-point obstacle of terminal equipment.
Detailed Description
The exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, however, the present invention may be embodied in many different forms and is not limited to the examples described herein, which are provided to fully and completely disclose the present invention and fully convey the scope of the invention to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the accompanying drawings is not intended to be limiting of the invention. In the drawings, like elements/components are referred to by like reference numerals.
Unless otherwise indicated, terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. In addition, it will be understood that terms defined in commonly used dictionaries should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense.
Example method
Fig. 1 is a flow chart of a method according to a preferred embodiment of the invention. As shown in fig. 1, the method according to the preferred embodiment starts in step 101.
In step 101, the power terminal receives a request sent by the electrical inspection device to verify the identity of the power terminal.
In step 102, the power terminal invokes an integrated cryptographic module to generate an original message M according to the request, wherein the original message M includes a terminal ID of the power terminal;
in step 103, the power terminal calculates group G T Element g=e (P 1 ,P pub-s ) Generating a random number r 1 ∈[1,N-1]Calculate w 1 =g r1 And combine the original messages M and w 1 To the power server, wherein P pub-s ,G 1 ,G 2 ,G T ,N,P 1 And g is a disclosure parameter of the cipher machine to the power terminal and the power server, P pub-s Is based on G 2 Generated master public key, G 1 ,G 2 ,G T Is a multiplication cyclic group with order of prime number N, P 1 Is G 1 G is G T E () is SM9 bilinear pair operation function.
In step 104, the power terminal receives a server signature component h' and a parameter s sent by the power server 2 Sum s 3 Wherein, the power server calculates a server signature component h' and a parameter s 2 Sum s 3 Comprising:
computing group G T Element g=e (P 1 ,P pub-s );
Generating random number r 2 ,r 3 ∈[1,N-1];
Calculating w 2 =g r2 ,w 3 =w 1 r3 ,w′=w 2 ·w 3 ,h′=H 2 (M||w', N), wherein H 2 A second cryptographic function derived from the cryptographic hash function;
utilizing stored private key component d of power server s Calculation s 2 =d s ·r 3 ,s 3 =d s ·(r 2 -h), wherein the power server private key component d s The password machine is calculated by adopting an SM9 threshold signature algorithm based on the terminal ID of the power terminal.
Preferably, the method further comprises the steps of adopting an SM9 identification password algorithm to generate an initial authentication key of the power terminal and an initial authentication key of the power server according to the terminal serial number of the power terminal;
and generating a private key component of the power terminal and a private key component of the power server according to the initial authentication key of the power terminal and the initial authentication key of the power server by adopting an SM9 threshold signature algorithm.
Fig. 2 is a flowchart of a method for generating a power terminal initial authentication key and a power server initial authentication key using an SM9 identification cryptographic algorithm according to a preferred embodiment of the present invention. As shown in fig. 2, the method for generating the power terminal initial authentication key and the power server initial authentication key by using the SM9 identification cryptographic algorithm according to the preferred embodiment starts in step 201.
In step 201, the crypto-engine generates a master private key k from security parameters s Secret storage is carried out, and the public parameters are issued to the power terminal and the power server;
in step 202, the power terminal integrates a cryptographic module;
in step 203, the key distribution device applies for the initial authentication key of the power terminal to the power server in batches according to the terminal serial number of the power terminal;
in step 204, the power server registers power terminals in batches to generate terminal IDs;
in step 205, the power server sends the terminal ID to the crypto-engine;
in step 206, the cryptographic engine generates a server initial authentication key and generates a terminal initial authentication key according to the terminal ID;
in step 207, the crypto-engine sends a server-side initial authentication key to the power server;
in step 208, the crypto-engine transmits the terminal ID and the terminal initial authentication key corresponding to the terminal ID to the key distribution device;
in step 209, the key distribution device delivers the terminal ID and the terminal initial authentication key corresponding to the terminal ID to the power terminal;
in step 210, the power terminal locally stores the terminal ID and the terminal initial authentication key.
Fig. 3 is a flowchart of a method for generating a power terminal private key component and a power server private key component using an SM9 threshold signature algorithm according to a preferred embodiment of the present invention. As shown in fig. 3, the method for generating the private key component of the power terminal and the private key component of the power server using the SM9 threshold signature algorithm according to the preferred embodiment starts in step 301.
In step 301, the power terminal generates a signature message by using a terminal initial authentication key, and sends a terminal ID and the signature message to the power server to apply for a terminal private key;
in step 302, the power server verifies the signature message, and when the terminal is determined to be legal, the power server sends the terminal ID of the power terminal to the crypto-engine to apply for the terminal private key;
in step 303, the crypto-engine generates a power server private key component d from the terminal ID of the power terminal s And terminal private key component d t And the private key component d of the power server side s Transmitting to the power server to transmit the private key component d of the power terminal t Transmitting to the power terminal;
in step 304, the power server receives and locally stores the power server private key component d s ;
In step 305, the power terminal receives and locally stores the power terminal private key component d t 。
In step 105, the power terminal utilizes the power terminal private key component d t Calculating a terminal signature component s ', synthesizing a signature result (h ', s ') of the original message M with the server signature component h ', and sending the original message M and the signature result (h ', s ') to an electric inspection device, wherein a private key component of an electric power terminal is calculated by a crypto machine by adopting an SM9 threshold signature algorithm, and the calculation formula of the terminal signature component s ' is as follows:
s′=[r 1 ·s 2 +s 3 ]·d t 。
preferably, the private key generation function identifier hid expressed in one byte is selected and disclosed;
calculating t 1 =H 1 (ID||hid,N)+k s ,t 2 =k s ·t 1 -1 Generating a random number n, wherein H 1 A first cryptographic function derived from the cryptographic hash function;
calculating private key component d of power server s =n -1 ·t 2 mod N;
Calculating private key component d of power terminal t =[n]P 1 。
In step 106, the electric inspection device adopts an SM9 mathematical signature verification algorithm to verify the original message M and the signature result (h ', s'), and when the verification is passed, the electric inspection device successfully authenticates the electric terminal.
Preferably, the electrical inspection device verifies the original message M and the signature result by adopting an SM9 mathematical signature verification algorithm, including:
checking h'. Epsilon.1, N-1],s′∈G 1 Whether or not to establish;
when it is, group G is calculated in order T Element g=e (P 1 ,P pub-s ),t=g h′ ,h 1 =H 1 (ID||hid,N);
Sequentially calculating P= [ h 1 ]P 2 +P pub -s, u=e (s ', P), y' =u·t, wherein P 2 Is G 2 Is a generator of (1);
calculate h 2 =H 2 (M||y′,N);
Verification h 2 Whether or not=h' is established, and if the verification is passed, the authentication of the electric power terminal by the electric inspection device is successful.
In the preferred embodiment, an identification password system based on SM9 national cryptographic standard is adopted, the device ID and the private key are generated according to the unique identification of the terminal device of the electric power Internet of things, the identification is the public key, complex certificate registration, authentication and management are not needed, no user name password is transmitted, the safety problems of weak passwords, violent cracking, library collision attack and the like are avoided, and low-cost trusted authentication and key management are realized. In addition, in the authentication scheme, the authentication mode based on the threshold signature algorithm is adopted, and compared with the common authentication scheme based on the IBC algorithm, the authentication mode based on the threshold signature algorithm is more suitable for the electric inspection equipment to acquire equipment operation and maintenance information, state information and fault information by dividing the secret key to the electric Internet of things terminal equipment and the electric Internet of things server, so that single-point obstacle can be effectively overcome, and the safety of the system is improved.
Example System
Fig. 4 is a schematic structural diagram of a system for authenticating an electric inspection device and a terminal based on an SM9 threshold signature algorithm according to a preferred embodiment of the present invention. As shown in fig. 2, the system 400 according to the preferred embodiment includes an electrical inspection device 401, an electrical terminal 402, and an electrical server 403, where:
the electric inspection device 401 is configured to generate a request for verifying an identity of an electric power terminal, and send the request to the electric power terminal; adopting an SM9 mathematical signature verification algorithm to verify an original message M and a signature result (h ', s'), and when the verification passes, successfully authenticating the electric power terminal by the electric detection equipment;
the power terminal 402 is configured to receive a request for verifying an identity of the power terminal sent by the electrical inspection device; according to the request, an integrated cryptographic module is called to generate the original message M; computing group G T Element g=e (P 1 ,P pub-s ) Generating a random number r 1 ∈[1,N-1]Calculate w 1 =g r1 And combine the original messages M and w 1 Sending the data to an electric power server; receiving a server signature component h' and a parameter s sent by a power server 2 Sum s 3 The method comprises the steps of carrying out a first treatment on the surface of the Utilizing the power terminal private key component d t Calculating a terminal signature component s ', synthesizing a signature result (h', s ') of the original message M with the server signature component h', and transmitting the original message M and the signature result (h ', s') to an electric inspection device, wherein the original message M comprises a terminal ID of an electric terminal; p (P) pub-s ,G 1 ,G 2 ,G T ,N,P 1 And g is a disclosure parameter of the cipher machine to the power terminal and the power server, P pub-s Is based on G 2 Generated master public key, G 1 ,G 2 ,G T Is a multiplication cyclic group with order of prime number N, P 1 Is G 1 G is G T E () is SM9 bilinear pair operation function; the private key component of the electric power terminal is calculated by a cipher machine through an SM9 threshold signature algorithm, and the calculation formula of the terminal signature component s' is as follows:
s′=[r 1 ·s 2 +s 3 ]·d t ;
the power server 403 is configured to send the original messages M and w according to the power terminal 1 Calculating to obtain a server signature component h' and a parameter s 2 Sum s 3 Comprising:
computing group G T Element g=e (P 1 ,P pub-s );
Generating random number r 2 ,r 3 ∈[1,N-1];
Calculating w 2 =g r2 ,w 3 =w 1 r3 ,w′=w 2 ·w 3 ,h′=H 2 (M||w', N), wherein H 2 Is a second cryptographic function derived from the cryptographic hash function.
Preferably, the system further comprises a cryptographic engine 404, configured to generate an initial authentication key of the power terminal and an initial authentication key of the power server according to a terminal serial number of the power terminal by adopting an SM9 identification cryptographic algorithm; and generating a private key component of the power terminal and a private key component of the power server according to the initial authentication key of the power terminal and the initial authentication key of the power server by adopting an SM9 threshold signature algorithm.
Fig. 5 is a schematic structural diagram of a system for generating a power terminal initial authentication key and a power server initial authentication key using an SM9 identification cryptographic algorithm according to a preferred embodiment of the present invention. As shown in fig. 5, the system includes a power terminal 402, a power server 403, a cryptographic engine 404, and a key distribution device 405, wherein:
cipher machine 404 generates master private key k based on security parameters s And secret storage and release of the public parameters to the power terminal 402 and the power server 403;
the power terminal 402 integrates a cryptographic module;
the key distribution device 405 applies for the initial authentication key of the power terminal to the power server 403 in batches according to the terminal serial number of the power terminal;
the power server 403 registers power terminals in batches to generate terminal IDs;
the power server 403 sends the terminal ID to the crypto engine 404;
the cryptographic engine 404 generates a server side initial authentication key and generates a terminal initial authentication key according to the terminal ID;
the cryptographic engine 404 sends the server initial authentication key to the power server 403;
the power server 403 locally stores a server initial authentication key;
the crypto-engine sends 404 the terminal ID and the terminal initial authentication key corresponding to the terminal ID to the key distribution device 405;
the key distribution device 405 delivers the terminal ID and the terminal initial authentication key corresponding to the terminal ID to the power terminal 402;
the power terminal 402 locally stores the terminal ID and the terminal initial authentication key.
Fig. 6 is a schematic structural diagram of a system for generating a private key component of a power terminal and a private key component of a power server using an SM9 threshold signature algorithm according to a preferred embodiment of the present invention. As shown in fig. 6, the system includes a power terminal 402, a power server 403, and a cryptographic engine 404, where:
the power terminal 402 generates a signature message by using a terminal initial authentication key, and sends a terminal ID and the signature message to the power server to apply for a terminal private key;
the power server 403 verifies the signature message, and when the terminal is determined to be legal equipment, the power server 403 sends the terminal ID of the power terminal to the cipher 404 to apply for the terminal private key;
the crypto-engine 404 generates a power server private key component d from the terminal ID of the power terminal s And terminal private key component d t And the private key component d of the power server side s To the power server 403, to send the private key component d of the power terminal t To the power terminal 402;
the power server 403 receives and locally stores the power server private key component d s ;
The power terminal receives 402 and locally stores the power terminal private key component d t 。
Preferably, the cryptographic engine 404 generates the power server private key component d according to the terminal ID of the power terminal s And terminal private key component d t Comprising:
selecting and disclosing a private key generation function identifier hid expressed in one byte;
calculating t 1 =H 1 (ID||hid,N)+k s ,t 2 =k s ·t 1 -1 A random number n is generated, wherein,H 1 a first cryptographic function derived from the cryptographic hash function;
calculating private key component d of power server s =n -1 ·t 2 mod N;
Calculating private key component d of power terminal t =[n]P 1 。
Preferably, the electrical inspection device 401 uses SM9 mathematical signature verification algorithm to verify the original message M and the signature result, including:
checking h'. Epsilon.1, N-1],s′∈G 1 Whether or not to establish;
when it is, group G is calculated in order T Element g=e (P 1 ,P pub-s ),t=g h′ ,h 1 =H 1 (ID||hid,N);
Sequentially calculating P= [ h 1 ]P 2 +P pub-s U=e (s ', P), y' =u·t, where P 2 Is G 2 Is a generator of (1);
calculate h 2 =H 2 (M||y′,N);
Verification h 2 Whether or not=h' is established, and if the verification is passed, the authentication of the electric power terminal by the electric inspection device is successful.
In the system for electric detection equipment and terminal authentication based on the SM9 threshold signature algorithm in the preferred embodiment, a terminal ID is generated according to a serial number of an electric power terminal, an initial authentication key is generated based on the terminal ID, then a signature application terminal private key is generated according to the initial authentication key, after verifying that a signature determines that the electric power terminal is legal equipment, a terminal private key component and a server private key component are generated by a cipher machine, and steps of the electric detection equipment for authenticating the electric power terminal according to the terminal private key component and the server private key component are the same as steps in a method for electric detection equipment and terminal authentication based on the SM9 threshold signature algorithm, so that the achieved technical effects are the same and are not repeated.
The invention has been described with reference to a few embodiments. However, as is well known to those skilled in the art, other embodiments than the above disclosed invention are equally possible within the scope of the invention, as defined by the appended patent claims.
Generally, all terms used in the claims are to be interpreted according to their ordinary meaning in the technical field, unless explicitly defined otherwise therein. All references to "a/an/the [ means, component, etc. ]" are to be interpreted openly as referring to at least one instance of said means, component, etc., unless explicitly stated otherwise. The steps of any method disclosed herein do not have to be performed in the exact order disclosed, unless explicitly stated.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical aspects of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the above embodiments, it should be understood by those of ordinary skill in the art that: modifications and equivalents may be made to the specific embodiments of the invention without departing from the spirit and scope of the invention, which is intended to be covered by the claims.