CN115102700A - Secure communication method, device, chip, electronic equipment and readable storage medium - Google Patents

Secure communication method, device, chip, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN115102700A
CN115102700A CN202211022575.4A CN202211022575A CN115102700A CN 115102700 A CN115102700 A CN 115102700A CN 202211022575 A CN202211022575 A CN 202211022575A CN 115102700 A CN115102700 A CN 115102700A
Authority
CN
China
Prior art keywords
power distribution
algorithm
key
distribution terminal
encryption
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211022575.4A
Other languages
Chinese (zh)
Inventor
罗安琴
甄岩
肖小龙
郑利斌
李新军
周颖
王洪勉
赵猛
刘彤蕾
李擘
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Corp of China SGCC
Beijing Smartchip Microelectronics Technology Co Ltd
Electric Power Research Institute of State Grid Jiangsu Electric Power Co Ltd
Original Assignee
State Grid Corp of China SGCC
Beijing Smartchip Microelectronics Technology Co Ltd
Electric Power Research Institute of State Grid Jiangsu Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Corp of China SGCC, Beijing Smartchip Microelectronics Technology Co Ltd, Electric Power Research Institute of State Grid Jiangsu Electric Power Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN202211022575.4A priority Critical patent/CN115102700A/en
Publication of CN115102700A publication Critical patent/CN115102700A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0838Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/06Electricity, gas or water supply
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3066Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy involving algebraic varieties, e.g. elliptic or hyper-elliptic curves
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S40/00Systems for electrical power generation, transmission, distribution or end-user application management characterised by the use of communication or information technologies, or communication or information technology specific aspects supporting them
    • Y04S40/20Information technology specific aspects, e.g. CAD, simulation, modelling, system security

Abstract

The present disclosure relates to the technical field of information security, and in particular, to a secure communication method, apparatus, chip, electronic device, and readable storage medium, where the secure communication method includes: the method comprises the steps that authentication is carried out on the basis of an improved SM2 algorithm with a power distribution main station, and after the authentication is successful, key agreement is carried out on the basis of the improved SM2 algorithm with the power distribution main station to obtain a session key K of a power distribution terminal and the power distribution main station, wherein in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm to realize binding between a random public key and an identifier; and when the key negotiation result is true, carrying out encrypted communication with the power distribution main station by utilizing the session key K based on an SM1 algorithm. The method avoids the bottleneck of high concurrency of the power distribution main station when a large number of power distribution terminals are accessed, saves communication resources and computing resources, and improves the applicability of the scheme.

Description

Secure communication method, device, chip, electronic equipment and readable storage medium
Technical Field
The present disclosure relates to the field of information security technologies, and in particular, to a secure communication method, apparatus, chip, electronic device, and readable storage medium.
Background
In recent years, more and more intelligent power Distribution terminals are popularized and deployed in an intelligent power Distribution network system, secondary equipment of a power Distribution network, such as a Remote Terminal Unit (RTU), a power Distribution Terminal Unit (DTU) and the like, is monitored in real time, meanwhile, various communication modes including wired communication and wireless communication are applied to the intelligent power Distribution network, and two-way communication is achieved between the intelligent power Distribution terminals and an intelligent power Distribution master station. The intelligent power distribution network is a core component of the intelligent power grid and is an important system directly connected with consumer users.
With the development of information technology and the continuous evolution of information security policies of various countries, the frequency of occurrence of homemade network attack security accidents is higher and higher, the variability, the concealment, the pertinence and the continuity of attacks are also strengthened, and the network attack becomes a novel war form of national politics and economy. The power grid accidents caused by the power grid accidents happen at home and abroad, and great national economic loss is caused. The intelligent power distribution network is a core component of the intelligent power grid, and if a large-area power failure event is possibly caused by network attack, key infrastructure of other countries such as finance, energy, communication, traffic and the like can be directly damaged, and the normal production and life order of the countries and the society is destroyed. The intelligent degree of the intelligent power distribution network is higher and higher, and the information safety risk of the intelligent power distribution network system is objectively increased. At present, a reliable safety mechanism is not adopted for data interaction communication between an intelligent distribution network main station and an intelligent distribution terminal. The intelligent power distribution terminal safety protection has the following safety risks.
1) And accessing the illegal terminal. The intelligent power distribution network has more and more huge intelligent interactive terminals, the network security protection boundary is more and more extensive, and the power distribution service access requirements are more and more flexible and various, so that the power distribution terminal has security risks of illegal access.
2) And (4) controlling by a fake master station. The intelligent power distribution network master station mainly performs application functions such as data acquisition, monitoring and analysis on the intelligent power distribution terminal in a real-time mode, and as a core component of the intelligent power distribution network, the intelligent power distribution network master station sends control instructions to the intelligent power distribution terminal through multiple communication modes, and provides service support and command service for production operation and maintenance work, scheduling operation work and fault accident emergency repair work. If an attacker impersonates the master station to send a malicious control instruction to the intelligent power distribution terminal, the attacker makes a wrong action, and immeasurable consequences can be caused to the whole power system and the national infrastructure.
3) The communication data is corrupted. In an intelligent power distribution network communication system, data transmission between a main station and a terminal is mainly achieved, the data transmission comprises control data sent by the main station to a power distribution terminal and real-time monitoring data sent by the terminal to the main station, once the data are tampered and the integrity of the data is damaged, the intelligent power distribution terminal can possibly make a wrong action, and the intelligent power distribution network main station can possibly make a wrong decision.
The shared secret key can be obtained by the intelligent power distribution master station and the terminal on an insecure communication channel by using the existing secret SM2 algorithm. However, due to the high concurrency of the master station and the limited computing and storage capabilities of the terminal, the bidirectional identity authentication of the master station and the terminal of the intelligent distribution network cannot be ensured by using the standard SM2 algorithm.
Disclosure of Invention
In order to solve the problems in the related art, embodiments of the present disclosure provide a secure communication method, apparatus, chip, electronic device and readable storage medium method, apparatus, electronic device and readable storage medium.
In a first aspect, an embodiment of the present disclosure provides a secure communication method applied to a power distribution terminal, including:
the method comprises the steps that authentication is carried out on the basis of an improved SM2 algorithm with a power distribution main station, and after the authentication is successful, key agreement is carried out on the basis of the improved SM2 algorithm with the power distribution main station to obtain a session key K of a power distribution terminal and the power distribution main station, wherein in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm to realize binding between a random public key and an identifier;
and when the key negotiation result is true, carrying out encrypted communication with the power distribution main station by utilizing the session key K based on an SM1 algorithm.
According to the embodiment of the disclosure, the authentication of the power distribution terminal and the power distribution main station based on the improved SM2 algorithm comprises the following steps:
the power distribution terminal generates a first random public key factor r1, a unique identifier S1 of the session and a unique identifier ID1 of the power distribution terminal;
receiving a second random public key factor r2 sent by a power distribution master station and an identity displacement identifier ID2 of the power distribution master station;
calculating a first Request value Request according to the r1, the S1 and the ID1, and sending the first Request value Request to the power distribution main station, wherein the first Request value Request comprises a first encryption result obtained by carrying out encryption calculation on r1, S1 and ID1 based on an SM2 algorithm public key of the power distribution main station, and a second encryption result obtained by carrying out encryption calculation on an SM3 algorithm hash operation result of the r1, the S1 and the ID1 based on an MS2 algorithm private key of the power distribution terminal;
when a first judgment result obtained by the power distribution master station through calculation according to the first Request value Request is true, receiving a first Reply value Reply sent by the power distribution master station, wherein the first Reply value includes a third encryption result obtained by carrying out encryption calculation on r2, S1 and ID2 based on an SM2 algorithm public key of the power distribution terminal, and a fourth encryption result obtained by carrying out encryption calculation on an SM3 algorithm hash operation result of r2, S1 and ID2 based on an SM2 algorithm private key of the power distribution master station;
decrypting the first Reply value Reply to obtain the r2, the S1 and the ID 2;
and decrypting the fourth encryption result based on the SM2 algorithm public key of the power distribution main station to obtain a first decryption result, and successfully authenticating the power distribution terminal and the power distribution main station when the first decryption result is determined to be the same as the SM3 algorithm hash operation results of the r2, the S1 and the ID 2.
According to an embodiment of the present disclosure, the first Request value Request is calculated by the following formula: request = E pc (r1ǁS1ǁID1)ǁE dt (H (r 1 ǁ S1 ǁ ID 1)), the first recovery value Reply being calculated by the following formula: reply = E pt (r2ǁS1ǁID2)ǁE dc (H (r 2 ǁ S1 ǁ ID 2)), where ǁ is data stitching operation, H () is SM3 algorithm hash operation on data in parentheses, E pc () The SM2 algorithm public key of the distribution main station is used for carrying out encryption operation on data in brackets, E dt () Carrying out encryption operation on data in brackets by using SM2 algorithm private key of a power distribution terminal, E pt () Carrying out encryption operation on data in brackets by using SM2 algorithm public key of a power distribution terminal, E dc () The SM2 algorithm private key of the power distribution main station is used for carrying out encryption operation on data in brackets, E pt (r2ǁS1ǁID2)For the third encryption result, E dc (H (r 2 ǁ S1 ǁ ID 2)) is the fourth encryption result.
According to an embodiment of the present disclosure, decrypting the first Reply value Reply to obtain the r2, S1, and ID2 includes:
and carrying out decryption operation on the third encryption result based on an SM2 algorithm private key of the power distribution terminal to obtain the r2, the S1 and the ID 2.
According to the embodiment of the disclosure, the first judgment result is obtained by comparing a hash operation result of the SM3 algorithm of the distribution master station according to r1, S1 and ID1 with a second decryption result obtained by decrypting the second encryption result by using an SM2 algorithm public key of a distribution terminal;
wherein, when the SM3 algorithm hash operation result of the r1, the S1 and the ID1 is the same as the second decryption result, the first judgment result is true;
when the SM3 algorithm hash operation result of the r1, the S1 and the ID1 is different from the second decryption result, the first judgment result is false.
According to an embodiment of the disclosure, the key agreement with the power distribution master station based on the modified SM2 algorithm after the authentication is successful includes:
selecting point a = (x) on elliptic curve A ,y A ) Wherein, the point A satisfies an elliptic curve equation and is a point which is not at infinity;
receiving point B (x) transmitted by power distribution main station B ,y B ) Wherein point B satisfies the elliptic curve equation and is a non-infinite point;
obtaining the domain element in the point A, and carrying out dual transformation on the domain element in the point A to obtain a first conjugate value
Figure DEST_PATH_IMAGE001
Wherein, the first and the second end of the pipe are connected with each other,
Figure 505902DEST_PATH_IMAGE002
n is a natural number,&is a bitwise AND operation;
calculating a first intermediate value based on the first conjugate value
Figure DEST_PATH_IMAGE003
Wherein mod is a modulo operation;
obtaining the domain element in the point B, and carrying out dual transformation on the domain element in the point B to obtain a second conjugate value
Figure 157463DEST_PATH_IMAGE004
According to the first intermediate value t A And a second conjugate value
Figure DEST_PATH_IMAGE005
Calculating a point on an elliptic curve
Figure 281408DEST_PATH_IMAGE006
Wherein h is a cofactor;
when the point U is judged to be a non-infinite point, a third random number R is calculated A = R1^ R2, and transmits the R A To the distribution main station so that the distribution main station can be operated according to the third random number R A And a fourth random number R B Judging the result of key agreement, wherein the fourth random number R B The power distribution master station calculates a third random number R by adopting a mode of calculating a power distribution terminal A Calculated in the same way, and is a logic operation bit by bit.
According to an embodiment of the present disclosure, when the third random number R A And a fourth random number R B And if so, the key negotiation result is true, otherwise, the key negotiation result is false.
According to an embodiment of the present disclosure, the session key K is obtained by:
according to the formula K = KDF (x) U ǁy U ǁZ t ǁZ c ǁr1ǁr2,L K ) Calculating a session key K of the power distribution terminal and the power distribution main station, wherein KDF () is a key derivation function, x U And y U A field element of point U, Z t As a distinguishable mark, partial ellipse, with respect to the distribution terminalHash value, Z, of the circular curve system parameter and its public key c Is a hash value of a discernable identification about the distribution main station, a partial elliptic curve system parameter and its public key, L K Is the encoding length of the session key K.
According to an embodiment of the disclosure, the performing encrypted communication with the power distribution master station based on the SM1 algorithm by using the session key K includes:
acquiring monitoring data;
carrying out SM1 encryption operation on the monitoring data based on the session key K to obtain encrypted monitoring data, and sending the encrypted monitoring data to the power distribution master station;
acquiring encrypted control data sent by a power distribution master station, wherein the encrypted control data is obtained by carrying out SM1 encryption operation on the control data by the power distribution master station based on the session key K, and the control data is generated by the power distribution master station according to the received encrypted monitoring data;
and carrying out SM1 decryption operation on the encrypted control data according to the session key K to obtain the control data.
According to the embodiment of the disclosure, the safety communication method is applied to power distribution service communication, the connection between a power distribution terminal and a power distribution main station is disconnected after each power distribution service is finished, and a currently used session key is deleted and is not reused.
According to the embodiment of the disclosure, the power distribution terminal and the power distribution master station perform authentication and key agreement again when power distribution service communication is required or connection is overtime.
In a second aspect, an embodiment of the present disclosure provides a secure communication method, applied to a power distribution master station, including:
the method comprises the steps that authentication is carried out on the basis of an improved SM2 algorithm with a power distribution terminal, and after the authentication is successful, key agreement is carried out on the basis of the improved SM2 algorithm with the power distribution terminal to obtain a session key K of the power distribution terminal and a power distribution main station, wherein in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm to realize binding between a random public key and an identifier;
and when the key negotiation result is true, carrying out encrypted communication with the power distribution terminal by using the session key K based on an SM1 algorithm.
According to the embodiment of the disclosure, the authentication of the power distribution main station and the power distribution terminal based on the improved SM2 algorithm comprises the following steps:
the power distribution master station generates a second random public key factor r2 and an identity displacement identifier ID2 of the power distribution master station;
receiving a first random public key factor r1, a unique identifier S1 of the session and an identity unique identifier ID1 of the power distribution terminal, which are sent by the power distribution terminal;
receiving a first Request value Request sent by the power distribution terminal, wherein the first Request value Request is obtained by the power distribution terminal through calculation according to the r1, the S1 and the ID1, and the first Request value Request comprises a first encryption result obtained through encryption calculation of r1, S1 and ID1 based on an SM2 algorithm public key of a power distribution main station and a second encryption result obtained through encryption calculation of r1, S1 and the ID1 based on an SM2 algorithm private key of the power distribution terminal;
decrypting the first encryption result based on an SM2 algorithm private key of the power distribution master station to obtain r1, S1 and ID 1;
and decrypting the second encryption result based on the SM2 algorithm public key of the power distribution terminal to obtain a second decryption result, and when the second decryption result is determined to be the same as the SM3 algorithm hash operation result of the r1, the S1 and the ID1, the power distribution master station successfully authenticates the power distribution terminal.
According to an embodiment of the present disclosure, further comprising:
and after the power distribution main station successfully authenticates the power distribution terminal, sending a first recovery value Reply to the power distribution terminal so that the power distribution terminal authenticates the power distribution main station according to the first recovery value Reply.
According to an embodiment of the present disclosure, the first Request value Request is calculated by: wherein, | | is data splicing operation, H () is SM3 algorithm hash operation on the data in the parentheses, E | pc () The SM2 algorithm public key of the distribution main station is used for carrying out encryption operation on data in brackets, E dt () Is made by usingAnd the SM2 algorithm private key of the electric terminal carries out encryption operation on the data in the brackets to obtain the first encryption result and the second encryption result.
According to an embodiment of the disclosure, the key agreement with the power distribution terminal based on the modified SM2 algorithm after the authentication is successful includes:
selecting point B (x) on the elliptic curve B ,y B ) Wherein point B satisfies the elliptic curve equation and is a non-infinite point;
receiving point A = (x) transmitted by power distribution terminal A ,y A ) Wherein point a satisfies an elliptic curve equation and is a non-infinite point;
obtaining the domain element in the point B, and carrying out dual transformation on the domain element in the point B to obtain a second conjugate value
Figure DEST_PATH_IMAGE007
Wherein the content of the first and second substances,
Figure 348721DEST_PATH_IMAGE008
n is a natural number,&is a bitwise AND operation;
calculating a second intermediate value based on the second conjugate value
Figure DEST_PATH_IMAGE009
Wherein mod is a modulo operation;
obtaining the domain elements in the point A, and carrying out dual transformation on the domain elements in the point A to obtain a first conjugate value
Figure 631935DEST_PATH_IMAGE010
According to the second intermediate value t B And a first conjugate value
Figure DEST_PATH_IMAGE011
Calculating a point on an elliptic curve
Figure 64184DEST_PATH_IMAGE012
Wherein h is more thanA factor;
when the point V is judged to be a point which is not at infinity, a fourth random number R is calculated B = R2^ R1, and transmits the R B To the distribution main station so that the distribution main station can be operated according to the fourth random number R B And a third random number R A Judging the result of key agreement, wherein the third random number R A The power distribution terminal calculates a fourth random number R by adopting a mode of calculating a power distribution main station B Calculated in the same way, is a bitwise logic operation.
According to the embodiment of the present disclosure, when the fourth random number R B And a third random number R A And if so, the key negotiation result is true, otherwise, the key negotiation result is false.
According to an embodiment of the present disclosure, the session key K is obtained by:
according to the formula K = KDF (x) U ǁy U ǁZ t ǁZ c ǁr1ǁr2,L K ) Calculating a session key K of the power distribution terminal and the power distribution main station, wherein KDF () is a key derivation function, x V And y V A field element of point V, Z t Is a hash value of the discernible identifier relating to the distribution terminal, the partial elliptic curve system parameter and its public key, Z c Is a hash value of the discernible identity, partial elliptic curve system parameters and its public key with respect to the distribution main station, L K Is the encoding length of the session key K.
According to an embodiment of the disclosure, the encrypted communication with the power distribution terminal by using the session key K based on the SM1 algorithm includes:
acquiring encrypted monitoring data sent by a power distribution terminal, wherein the encrypted monitoring data is obtained by carrying out SM1 encryption operation on the monitoring data by the power distribution terminal based on the session key K;
carrying out decryption operation on the encrypted monitoring data based on the session key K to obtain the monitoring data;
generating corresponding control data according to the monitoring data;
carrying out SM1 encryption operation on the control data based on the session key K to obtain encrypted control data;
and sending the encrypted control data to the power distribution terminal.
According to the embodiment of the disclosure, the safety communication method is applied to power distribution service communication, the connection between a power distribution terminal and a power distribution main station is disconnected after each power distribution service is finished, and a currently used session key is deleted and is not reused.
According to the embodiment of the disclosure, the power distribution master station and the power distribution terminal perform authentication and key agreement again when power distribution service communication is required or connection is overtime.
In a third aspect, an embodiment of the present disclosure provides a secure communication device, located at a power distribution terminal, including:
the first authentication and key agreement module is configured to enable the power distribution terminal and the power distribution master station to perform authentication based on an improved SM2 algorithm, and perform key agreement with the power distribution master station based on the improved SM2 algorithm after the authentication is successful, so as to obtain a session key K of the power distribution terminal and the power distribution master station, wherein in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm, so that binding between a random public key and an identifier is realized;
and the first encryption communication module is configured to enable the power distribution terminal to perform encryption communication with the power distribution main station by using the session key K based on an SM1 algorithm when the key negotiation result is true.
According to the embodiment of the disclosure, the authentication of the power distribution terminal and the power distribution main station based on the improved SM2 algorithm comprises the following steps:
the power distribution terminal generates a first random public key factor r1, a unique identifier S1 of the session and a unique identifier ID1 of the power distribution terminal;
receiving a second random public key factor r2 sent by a power distribution master station and an identity displacement identifier ID2 of the power distribution master station;
calculating a first Request value Request according to the r1, the S1 and the ID1, and sending the first Request value Request to the power distribution main station, wherein the first Request value Request comprises a first encryption result obtained by carrying out encryption calculation on r1, S1 and ID1 based on an SM2 algorithm public key of the power distribution main station, and a second encryption result obtained by carrying out encryption calculation on an SM3 algorithm hash operation result of the r1, the S1 and the ID1 based on an MS2 algorithm private key of the power distribution terminal;
when a first judgment result obtained by the power distribution master station through calculation according to the first Request value Request is true, receiving a first Reply value Reply sent by the power distribution master station, wherein the first Reply value includes a third encryption result obtained by carrying out encryption calculation on r2, S1 and ID2 based on an SM2 algorithm public key of the power distribution terminal, and a fourth encryption result obtained by carrying out encryption calculation on an SM3 algorithm hash operation result of r2, S1 and ID2 based on an SM2 algorithm private key of the power distribution master station;
decrypting the first Reply value Reply to obtain the r2, the S1 and the ID 2;
and decrypting the fourth encryption result based on the SM2 algorithm public key of the power distribution main station to obtain a first decryption result, and successfully authenticating the power distribution terminal and the power distribution main station when the first decryption result is determined to be the same as the SM3 algorithm hash operation results of the r2, the S1 and the ID 2.
According to an embodiment of the present disclosure, the first Request value Request is calculated by: request = E pc (r1ǁS1ǁID1)ǁE dt (H (r 1 ǁ S1 ǁ ID 1)), the first recovery value Reply being calculated by: reply = E pt (r2ǁS1ǁID2)ǁE dc (H (r 2 ǁ S1 ǁ ID 2)), where ǁ is data stitching operation, H () is SM3 algorithm hash operation on data in parentheses, E pc () The public key of SM2 algorithm of distribution main station is used to make encryption operation on the data in parentheses, E dt () The SM2 algorithm private key of the power distribution terminal is used for carrying out encryption operation on data in brackets, E pt () Carrying out encryption operation on data in brackets by using SM2 algorithm public key of a power distribution terminal, E dc () Carrying out encryption operation on data in brackets by using SM2 algorithm private key of a power distribution main station, E pt (r 2 ǁ S1 ǁ ID 2) is the third encryption result, E dc (H (r 2 ǁ S1 ǁ ID 2)) is the fourth encryption result.
According to an embodiment of the present disclosure, decrypting the first Reply value Reply to obtain the r2, S1, and ID2 includes:
and carrying out decryption operation on the third encryption result based on an SM2 algorithm private key of the power distribution terminal to obtain the r2, the S1 and the ID 2.
According to the embodiment of the disclosure, the first judgment result is obtained by comparing a hash operation result of the SM3 algorithm of the distribution master station according to r1, S1 and ID1 with a second decryption result obtained by decrypting the second encryption result by using an SM2 algorithm public key of a distribution terminal;
wherein, when the SM3 algorithm hash operation result of the r1, the S1 and the ID1 is the same as the second decryption result, the first judgment result is true;
when the SM3 algorithm hash operation result of the r1, the S1 and the ID1 is different from the second decryption result, the first judgment result is false.
According to an embodiment of the disclosure, the key agreement with the power distribution master station based on the modified SM2 algorithm after the authentication is successful includes:
selecting point a = (x) on elliptic curve A ,y A ) Wherein, the point A satisfies an elliptic curve equation and is a point which is not at infinity;
receiving point B (x) transmitted by distribution master station B ,y B ) Wherein point B satisfies the elliptic curve equation and is a non-infinite point;
obtaining the domain element in the point A, and carrying out dual transformation on the domain element in the point A to obtain a first conjugate value
Figure 862376DEST_PATH_IMAGE001
Wherein the content of the first and second substances,
Figure 202221DEST_PATH_IMAGE002
n is a natural number,&is a bitwise AND operation;
calculating a first intermediate value based on the first conjugate value
Figure 74362DEST_PATH_IMAGE003
Wherein mod is a modulo operation;
obtaining the domain element in the point B, and carrying out dual transformation on the domain element in the point B to obtain a second conjugate value
Figure 333305DEST_PATH_IMAGE004
According to the first intermediate value t A And a second conjugate value
Figure 290897DEST_PATH_IMAGE005
Calculating a point on an elliptic curve
Figure 168854DEST_PATH_IMAGE006
Wherein h is a cofactor;
when the point U is judged to be a non-infinite point, a third random number R is calculated A = R1^ R2, and transmits the R A To the distribution main station so that the distribution main station can be operated according to the third random number R A And a fourth random number R B Judging the result of key agreement, wherein the fourth random number R B The power distribution main station calculates a third random number R by adopting a mode of calculating a third random number R with the power distribution terminal A Calculated in the same way, is a bitwise logic operation.
According to an embodiment of the present disclosure, when the third random number R A And a fourth random number R B And if so, the key negotiation result is true, otherwise, the key negotiation result is false.
According to an embodiment of the present disclosure, the session key K is obtained by:
according to the formula K = KDF (x) U ǁy U ǁZ t ǁZ c ǁr1ǁr2,L K ) Calculating a session key K of the power distribution terminal and the power distribution main station, wherein KDF () is a key derivation function, x U And y U A field element of point U, Z t Is a hash value of the discernible identifier relating to the distribution terminal, the partial elliptic curve system parameter and its public key, Z c Is a distinguishable identification about the distribution main station, partial elliptic curve system parameters and the public thereofHash value of the key, L K Is the encoding length of the session key K.
According to an embodiment of the disclosure, the performing encrypted communication with the power distribution master station based on the SM1 algorithm by using the session key K includes:
acquiring monitoring data;
carrying out SM1 encryption operation on the monitoring data based on the session key K to obtain encrypted monitoring data, and sending the encrypted monitoring data to the power distribution master station;
acquiring encrypted control data sent by a power distribution master station, wherein the encrypted control data is obtained by carrying out SM1 encryption operation on the control data by the power distribution master station based on the session key K, and the control data is generated by the power distribution master station according to the received encrypted monitoring data;
and carrying out SM1 decryption operation on the encrypted control data according to the session key K to obtain the control data.
According to the embodiment of the disclosure, the safety communication device is applied to power distribution service communication, the connection between the power distribution terminal and the power distribution main station is disconnected after each power distribution service is finished, and the currently used session key is deleted and is not reused.
According to the embodiment of the disclosure, the power distribution terminal and the power distribution master station perform authentication and key agreement again when power distribution service communication is required or connection is overtime.
In a fourth aspect, an embodiment of the present disclosure provides a secure communication apparatus located at a power distribution master station, including:
the second authentication and key agreement module is configured to enable the power distribution master station and the power distribution terminal to perform authentication based on an improved SM2 algorithm, and perform key agreement with the power distribution terminal after the authentication is successful based on the improved SM2 algorithm, so as to obtain a session key K of the power distribution terminal and the power distribution master station, wherein in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm, so that binding between a random public key and an identifier is realized;
and the second encryption communication module is configured to enable the power distribution main station and the power distribution terminal to carry out encryption communication based on an SM1 algorithm by using the session key K when the key negotiation result is true.
According to the embodiment of the disclosure, the authentication of the power distribution main station and the power distribution terminal based on the improved SM2 algorithm comprises the following steps:
the power distribution master station generates a second random public key factor r2 and an identity displacement identifier ID2 of the power distribution master station;
receiving a first random public key factor r1, a unique identifier S1 of the session and an identity unique identifier ID1 of the power distribution terminal, which are sent by the power distribution terminal;
receiving a first Request value Request sent by the power distribution terminal, wherein the first Request value Request is obtained by the power distribution terminal through calculation according to the r1, the S1 and the ID1, and comprises a first encryption result obtained through encryption calculation of an SM2 algorithm public key of the power distribution main station on the r1, the S1 and the ID1, and a second encryption result obtained through encryption calculation of an SM2 algorithm private key of the power distribution terminal on the r1, the S1 and the ID 1;
decrypting the first encryption result based on an SM2 algorithm private key of the power distribution master station to obtain r1, S1 and ID 1;
and decrypting the second encryption result based on the SM2 algorithm public key of the power distribution terminal to obtain a second decryption result, and when the second decryption result is determined to be the same as the SM3 algorithm hash operation result of the r1, the S1 and the ID1, the power distribution master station successfully authenticates the power distribution terminal.
According to an embodiment of the present disclosure, further comprising:
and after the power distribution main station successfully authenticates the power distribution terminal, sending a first recovery value Reply to the power distribution terminal so that the power distribution terminal authenticates the power distribution main station according to the first recovery value Reply.
According to an embodiment of the present disclosure, the first Request value Request is calculated by the following formula: wherein | | is data splicing operation, H () is SM3 algorithm hash operation on the data in parentheses, E | | pc () The SM2 algorithm public key of the distribution main station is used for carrying out encryption operation on data in brackets, E dt () Is calculated by SM2 of the distribution terminalAnd the private key carries out encryption operation on the data in the brackets to obtain the first encryption result and the second encryption result.
According to an embodiment of the disclosure, the key agreement with the power distribution terminal based on the modified SM2 algorithm after the authentication is successful includes:
selecting point B (x) on the elliptic curve B ,y B ) Wherein point B satisfies the elliptic curve equation and is a non-infinite point;
receiving point A = (x) transmitted by power distribution terminal A ,y A ) Wherein point a satisfies an elliptic curve equation and is a non-infinite point;
obtaining the domain element in the point B, and carrying out dual transformation on the domain element in the point B to obtain a second conjugate value
Figure 895502DEST_PATH_IMAGE007
Wherein the content of the first and second substances,
Figure 856505DEST_PATH_IMAGE008
n is a natural number,&is a bitwise AND operation;
calculating a second intermediate value based on the second conjugate value
Figure 239076DEST_PATH_IMAGE009
Wherein mod is a modulo operation;
obtaining the domain element in the point A, and carrying out dual transformation on the domain element in the point A to obtain a first conjugate value
Figure 711602DEST_PATH_IMAGE010
According to the second intermediate value t B And a first conjugate value
Figure 620652DEST_PATH_IMAGE011
Calculating a point on an elliptic curve
Figure 362343DEST_PATH_IMAGE012
Wherein h is more thanA factor;
when the point V is judged to be a non-infinite point, a fourth random number R is calculated B = R2^ R1, and transmits the R B To the distribution main station to make the distribution main station according to the fourth random number R B And a third random number R A Judging the result of key agreement, wherein the third random number R A The power distribution terminal calculates a fourth random number R by adopting a mode of calculating a power distribution main station B Calculated in the same way, is a bitwise logic operation.
According to the embodiment of the present disclosure, when the fourth random number R B And a third random number R A And if so, the key negotiation result is true, otherwise, the key negotiation result is false.
According to an embodiment of the present disclosure, the session key K is obtained by:
according to the formula K = KDF (x) U ǁy U ǁZ t ǁZ c ǁr1ǁr2,L K ) Calculating a session key K of the power distribution terminal and the power distribution main station, wherein KDF () is a key derivation function, x V And y V A field element of point V, Z t Is a hash value of the discernible identifier relating to the distribution terminal, the partial elliptic curve system parameter and its public key, Z c Is a hash value of the discernible identity, partial elliptic curve system parameters and its public key with respect to the distribution main station, L K Is the encoding length of the session key K.
According to an embodiment of the disclosure, the encrypted communication with the power distribution terminal by using the session key K based on the SM1 algorithm includes:
acquiring encrypted monitoring data sent by a power distribution terminal, wherein the encrypted monitoring data is obtained by carrying out SM1 encryption operation on the monitoring data by the power distribution terminal based on the session key K;
carrying out decryption operation on the encrypted monitoring data based on the session key K to obtain the monitoring data;
generating corresponding control data according to the monitoring data;
carrying out SM1 encryption operation on the control data based on the session key K to obtain encrypted control data;
and sending the encrypted control data to the power distribution terminal.
According to the embodiment of the disclosure, the safety communication device is applied to power distribution service communication, the connection between the power distribution terminal and the power distribution main station is disconnected after each power distribution service is finished, and the currently used session key is deleted and is not reused.
According to the embodiment of the disclosure, the power distribution master station and the power distribution terminal perform authentication and key agreement again every time power distribution service communication needs to be performed or connection is overtime.
In a fifth aspect, embodiments of the present disclosure provide a chip including the secure communication apparatus according to any one of the third aspect or the fourth aspect.
In a sixth aspect, the present disclosure provides an electronic device, comprising a memory and a processor, wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to any one of the first aspect or the second aspect.
In a seventh aspect, the present disclosure provides a computer-readable storage medium, on which computer instructions are stored, and when executed by a processor, the computer instructions implement the method according to the first or second aspect.
According to the technical scheme provided by the embodiment of the disclosure, a power distribution terminal and a power distribution master station perform authentication based on an improved SM2 algorithm, and perform key agreement with the power distribution master station based on the improved SM2 algorithm after the authentication is successful to obtain a session key K of the power distribution terminal and the power distribution master station, wherein in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm to realize the binding between a random public key and an identifier; and when the key negotiation result is true, carrying out encrypted communication with the power distribution main station by utilizing the session key K based on an SM1 algorithm. By adopting the technical scheme of the embodiment of the disclosure, authentication and key agreement between the power distribution terminal and the power distribution main station are realized through the improved SM2 algorithm, and encrypted communication between the power distribution terminal and the power distribution main station is realized through the SM1 algorithm, so that both communication parties can use less communication resources and calculation resources on the premise of ensuring the security of the key agreement, the utilization rate of system resources in the power distribution terminal is optimized, the bottleneck of high concurrency of the power distribution main station when massive power distribution terminals are accessed is avoided, and the applicability of the scheme is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
Other features, objects, and advantages of the present disclosure will become more apparent from the following detailed description of non-limiting embodiments when taken in conjunction with the accompanying drawings. In the drawings.
Fig. 1 shows a flow diagram of a secure communication method according to an embodiment of the present disclosure.
Fig. 2 shows a schematic diagram of a safety shield of a power distribution terminal.
Fig. 3 shows a flow diagram of another secure communication method according to an embodiment of the present disclosure.
Fig. 4 shows a block diagram of a secure communication device according to an embodiment of the present disclosure.
Fig. 5 shows a block diagram of another secure communication device according to an embodiment of the present disclosure.
Fig. 6 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
FIG. 7 shows a schematic block diagram of a computer system suitable for use in implementing methods according to embodiments of the present disclosure.
Detailed Description
Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. Also, for the sake of clarity, parts not relevant to the description of the exemplary embodiments are omitted in the drawings.
In the present disclosure, it is to be understood that terms such as "including" or "having," etc., are intended to indicate the presence of the disclosed features, numbers, steps, behaviors, components, parts, or combinations thereof, and are not intended to preclude the possibility that one or more other features, numbers, steps, behaviors, components, parts, or combinations thereof may be present or added.
It should also be noted that the embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
In the present disclosure, if an operation of acquiring user information or user data or an operation of presenting user information or user data to others is involved, the operations are all operations authorized, confirmed by a user, or actively selected by the user.
The shared key can be obtained by the intelligent power distribution master station and the terminal on an insecure communication channel by using the existing secret SM2 algorithm. However, due to the high concurrency of the master station and the limited computing and storage capabilities of the terminal, the bidirectional identity authentication of the master station and the terminal of the intelligent distribution network cannot be ensured by using the standard SM2 algorithm.
In view of this, an embodiment of the present disclosure provides a secure communication method, including: the power distribution terminal and the power distribution master station perform authentication and key agreement based on an improved SM2 algorithm, wherein in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm to realize the binding between a random public key and an identifier; the power distribution terminal and the power distribution main station carry out encrypted communication based on an SM1 algorithm. By adopting the technical scheme of the embodiment of the disclosure, authentication and key agreement between the power distribution terminal and the power distribution main station are realized through the improved SM2 algorithm, and encrypted communication between the power distribution terminal and the power distribution main station is realized through the SM1 algorithm, so that both communication parties can use less communication resources and calculation resources on the premise of ensuring the security of key agreement, the utilization rate of system resources in the power distribution terminal is optimized, the bottleneck of high concurrency of the power distribution main station when massive power distribution terminals are accessed is avoided, and the applicability of the scheme is improved.
Fig. 1 shows a flow diagram of a secure communication method according to an embodiment of the present disclosure. As shown in fig. 1, the secure communication method is applied to a power distribution terminal, and includes the following steps S101 to S102:
in step S101, performing authentication with a power distribution master station based on an improved SM2 algorithm, and performing key agreement with the power distribution master station after the authentication is successful based on the improved SM2 algorithm to obtain a session key K of the power distribution terminal and the power distribution master station, where in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm, so as to realize binding between a random public key and an identifier;
in step S102, when the key agreement result is true, encrypted communication is performed with the power distribution master station based on the SM1 algorithm by using the session key K.
In the embodiment of the disclosure, the secure communication method is applied to a power distribution terminal, so that the power distribution terminal can perform secure communication with a power distribution main station. The distribution terminal can be various remote monitoring and control units installed on the medium-voltage distribution network site, and comprises a feeder terminal FTU, a distribution transformer monitoring terminal TTU, a remote terminal unit RTU, a distribution terminal unit DTU and the like. The power distribution terminal can be internally provided with a safety protection device for realizing the safety communication between the power distribution terminal and the power distribution main station.
Fig. 2 shows an example of a safety protection device of a power distribution terminal, and in the safety protection device shown in fig. 2, a processor, a wireless communication module, a serial communication module, a network cable socket, a safety chip, an SDRAM memory, an SD card slot, a power supply module, and a real-time clock may be included. Wherein, the processor can be a processor adopting S3C2416XH-40ARM926EJ dominant frequency 400 MHz; the wireless communication module is used for information interaction with external modules such as a power distribution main station and the like; the serial port communication module is used for accessing a serial port terminal; the network cable socket mainly plays a role in redundancy design and is used for increasing the reliability of the power distribution terminal equipment; the SDRAM memory is used for providing an operation space for programs needing to be operated in the power distribution terminal; the SD card slot is used for expanding a system in the power distribution terminal and expanding storage capacity; the power supply module is used for supplying power to modules such as a processor, a safety chip, an SDRAM (synchronous dynamic random access memory) and the like; the real-time clock is used for providing a time signal, and a time counter can be arranged in the real-time clock; the security chip is used for completing security authentication, security storage of important data and encryption and decryption of key data so as to realize security and integrity of data interaction between the security access device and the security access platform, standard domestic commercial key algorithms such as SM1 and SM2 are built in the security chip, and multiple functions of data communication line protection, data encryption and decryption, identity authentication, signature verification and the like can be realized so as to improve the service data transmission security of the power distribution terminal equipment.
In the embodiment of the disclosure, the power distribution terminal and the power distribution master station perform authentication and key agreement based on an improved SM2 algorithm, wherein in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm, and the binding between a random public key and an identifier is realized. Specifically, the power distribution terminal performs mutual authentication with the power distribution master station based on the improved SM2 algorithm, and after the mutual authentication is successful, the power distribution terminal and the power distribution master station perform key negotiation based on the improved SM2 algorithm.
In the embodiment of the present disclosure, the authentication between the power distribution terminal and the power distribution master station based on the improved SM2 algorithm includes: the power distribution terminal generates a first random public key factor r1, a unique identifier S1 of the session and a unique identifier ID1 of the power distribution terminal; receiving a second random public key factor r2 sent by a power distribution master station and an identity displacement identifier ID2 of the power distribution master station; calculating a first Request value Request according to the r1, the S1 and the ID1, and sending the first Request value Request to the power distribution main station, wherein the first Request value Request comprises a first encryption result obtained by carrying out encryption calculation on r1, S1 and ID1 based on an SM2 algorithm public key of the power distribution main station, and a second encryption result obtained by carrying out encryption calculation on an SM3 algorithm hash operation result of the r1, the S1 and the ID1 based on an MS2 algorithm private key of the power distribution terminal; when a first judgment result obtained by the power distribution master station through calculation according to the first Request value Request is true, receiving a first Reply value Reply sent by the power distribution master station, wherein the first Reply value includes a third encryption result obtained by carrying out encryption calculation on r2, S1 and ID2 based on an SM2 algorithm public key of the power distribution terminal, and a fourth encryption result obtained by carrying out encryption calculation on an SM3 algorithm hash operation result of r2, S1 and ID2 based on an SM2 algorithm private key of the power distribution master station; decrypting the first Reply value Reply to obtain the r2, the S1 and the ID 2; and decrypting the fourth encryption result based on the SM2 algorithm public key of the power distribution main station to obtain a first decryption result, and successfully authenticating the power distribution terminal and the power distribution main station when the first decryption result is determined to be the same as the SM3 algorithm hash operation results of the r2, the S1 and the ID 2.
Specifically, the power distribution terminal firstly generates a first random public key factor r1, a session unique identifier S1 and an identity unique identifier ID1 by using the distinguishable identifier of the power distribution terminal, the partial elliptic curve system parameter and the hash value Zt of the public key of the power distribution terminal, the distinguishable identifier of the power distribution master station, the partial elliptic curve system parameter and the hash value Zc of the public key of the power distribution master station, and the SM2 algorithm public key Pt of the power distribution terminal and the SM2 algorithm private key dt of the power distribution terminal. Meanwhile, the power distribution main station also generates a second random public key factor r2 and an identity displacement identifier ID2 based on the distinguishable identifier of the power distribution main station, the parameter of the partial elliptic curve system and the hash value ZA of the public key of the power distribution main station, the distinguishable identifier of the power distribution terminal, the parameter of the partial elliptic curve system and the hash value ZB of the public key of the power distribution terminal, and the SM2 algorithm public key Pt of the power distribution terminal and the SM2 algorithm private key dt of the power distribution terminal. And the power distribution terminal receives the second random public key factor r2 and the identity displacement identification ID2 of the power distribution main station, and temporarily stores the r2 and the ID2 for subsequent use.
Then, the power distribution terminal calculates a first Request value Request according to the first random public key factor r1, the session unique identifier S1 and the identity unique identifier ID1 of the power distribution terminal, where the first Request value Request may be calculated by the following formula: request = E pc (r1ǁS1ǁID1)ǁE dt (H (r 1 ǁ S1 ǁ ID 1)), where ǁ is data stitching operation, H () is SM3 algorithm hash operation on data in parentheses, E pc () The SM2 algorithm public key of the distribution main station is used for carrying out encryption operation on data in brackets, E dt () Carrying out encryption operation on data in brackets by using SM2 algorithm private key of a power distribution terminal, E pc (r1 ǁ S1 ǁ ID 1) as the first encryption result, E dt (H (r 1 ǁ S1 ǁ ID 1)) is recorded as a second encryption result. And the power distribution terminal sends the first Request value Request to the power distribution main station so that the power distribution main station obtains a first judgment result based on the first Request value Request.
In an embodiment of the present disclosure, the power distribution master station obtaining the first determination result based on the first Request value Request may be that the power distribution master station decrypts the first encryption result based on an SM2 algorithm private key of the power distribution master station, that is, calculates D dc (E pc (r 1 ǁ S1 ǁ ID 1)) to yield the r1, S1 and ID 1; decrypting the second encrypted result based on the SM2 algorithm public key of the power distribution terminal, namely calculating D pt (E dt (H (r 1 ǁ S1 ǁ ID 1))) to obtain a second decryption result; judging whether the second decryption result is the same as the SM3 algorithm hash operation result of the r1, the S1 and the ID1, if so, determining that the first judgment result is true, and sending a first Reply value Reply to the distribution terminal by the distribution master station, wherein the first Reply value Reply is calculated by the following formula: reply = E pt (r2ǁS1ǁID2)ǁE dc (r 2 ǁ S1 ǁ ID 2)), wherein E pt () The SM2 algorithm public key of the power distribution terminal is used for carrying out encryption operation on data in brackets, E dc () The method is to use the SM2 algorithm private key of the distribution main station to carry out encryption operation on the data in brackets, and can be recorded as E pt (r 2 ǁ S1 ǁ ID 2) is the third encryption result, E dc (H (r 2 ǁ S1 ǁ ID 2)) is a fourth encryption result; and if the first judgment result is false, judging that the first judgment result is false, and immediately interrupting the connection with the power distribution terminal by the power distribution main station.
The power distribution terminal receives the first Reply value Reply sent by the power distribution master station, and firstly, the third encryption result is decrypted based on an SM2 algorithm private key of the power distribution terminal to obtain r2, S1 and ID 2; then, decrypting the fourth encryption result based on an SM2 algorithm public key of the power distribution master station to obtain a first decryption result, judging whether the first decryption result is the same as the hash operation result of the SM3 algorithm of the r2, the S1 and the ID2, if so, successfully authenticating the power distribution master station by the power distribution terminal, and finishing bidirectional authentication by the power distribution terminal and the power distribution master station; and if the power distribution terminals are different from the power distribution main station, the power distribution terminals are disconnected from the power distribution main station.
In this disclosure, the performing, after successful authentication, key agreement with the distribution master station based on the modified SM2 algorithm includes: selecting point a = (x) on elliptic curve A ,y A ) Wherein point a satisfies an elliptic curve equation and is a non-infinite point; receiving point B (x) transmitted by distribution master station B ,y B ) Wherein point B satisfies the elliptic curve equation and is a point that is not at infinity; obtaining the domain element in the point A, and carrying out dual transformation on the domain element in the point A to obtain a first conjugate value
Figure 294527DEST_PATH_IMAGE001
Wherein, in the step (A),
Figure 904500DEST_PATH_IMAGE002
n is a natural number,&is a bitwise AND operation; calculating a first intermediate value based on the first conjugate value
Figure 543423DEST_PATH_IMAGE003
Wherein mod is a modulo operation; obtaining the domain element in the point B, and carrying out dual transformation on the domain element in the point B to obtain a second conjugate value
Figure 518332DEST_PATH_IMAGE004
(ii) a According to the first intermediate value t A And a second conjugate value
Figure 129DEST_PATH_IMAGE005
Calculating a point on an elliptic curve
Figure 23580DEST_PATH_IMAGE006
Wherein h is a cofactor; when the point U is judged to be a non-infinite point, a third random number R is calculated A = R1^ R2, and transmits the R A To the distribution main station so that the distribution main station can be operated according to the third random number R A And a fourth random number R B Judging the result of key agreement, wherein the second stepFour random numbers R B The power distribution main station calculates a third random number R by adopting a mode of calculating a third random number R with the power distribution terminal A Calculated in the same way, is a bitwise logic operation. Specifically, when calculating the second conjugate value, after obtaining the field element in the point B, the data type of the field element may be first converted into an integer type, and then the second conjugate value is calculated; likewise, when calculating the first conjugate value, after acquiring the field element in the point a, the data type of the field element may be first converted into an integer type, and then the first conjugate value may be calculated. When calculating the third random number, the data type in the point U may be first converted into a character string type, and then the third random number is calculated. And if the point U is judged to be an infinite point, the key negotiation between the power distribution terminal and the power distribution main station fails, and the power distribution terminal is disconnected with the power distribution main station.
In the embodiment of the present disclosure, when the third random number R A And a fourth random number R B And if so, the key negotiation result is true, otherwise, the key negotiation result is false.
In this disclosure, after the key agreement between the power distribution terminal and the power distribution master station is successful, the session key K = KDF (x) of the power distribution terminal and the power distribution master station may be calculated U ǁy U ǁZ t ǁZ c ǁr1ǁr2,L K ) Where KDF () is a key derivation function, x U And y U A field element of point U, Z t Is a hash value of a discernible identifier relating to the distribution terminal, a partial elliptic curve system parameter and its public key, Z c Is a hash value of the discernible identity, partial elliptic curve system parameters and its public key with respect to the distribution main station, L K Is the encoding length of the session key K. And when the key negotiation result is true, the power distribution terminal performs data transmission with the power distribution master station based on the session key K.
In this disclosure, the performing encrypted communication with the distribution master station by using the session key K based on the SM1 algorithm includes: acquiring monitoring DATA 1; performing SM1 encryption operation on the monitoring DATA DATA1 based on the session key K to obtain encrypted monitoring DATAE 1 =E K (DATA 1), and encrypting the encrypted monitor DATA E 1 Sending the power distribution main station to the power distribution main station; obtaining encrypted control data E sent by power distribution master station 2 =E K (DATA 2), the encryption control DATA E 2 Performing SM1 encryption operation on control DATA DATA2 for the power distribution master station based on the session key K, wherein the control DATA DATA2 is obtained by the power distribution master station according to the received encrypted monitoring DATA E 1 The result is obtained; carrying out SM1 decryption operation D on the encrypted control data according to the session key K K (E K (DATA 2)), the control DATA2 is obtained.
According to the technical scheme of the embodiment of the disclosure, authentication and key agreement between the power distribution terminal and the power distribution main station are realized through an improved SM2 algorithm, encrypted communication between the power distribution terminal and the power distribution main station is realized through an SM1 algorithm, so that both communication parties can use less communication resources and calculation resources on the premise of ensuring the security of the key agreement, the utilization rate of system resources in the power distribution terminal is optimized, the bottleneck of high concurrency of the power distribution main station when massive power distribution terminals are accessed is avoided, and the applicability of the scheme is improved.
According to the embodiment of the disclosure, the safety communication method is applied to power distribution service communication, the connection between a power distribution terminal and a power distribution main station is disconnected after each power distribution service is finished, and a currently used session key is deleted and is not reused. The method comprises the steps that authentication and key agreement are required to be carried out again when power distribution service communication is required to be carried out between the power distribution main station and the power distribution terminal every time, and the authentication and key agreement are required to be carried out again when the connection between the power distribution main station and the power distribution terminal is overtime.
According to the technical scheme of the embodiment of the disclosure, the authentication and the key negotiation between the power distribution terminal and the power distribution master station are required to be carried out again when the service communication is carried out each time and the connection is overtime, so that the safety is further improved.
Fig. 3 shows a flow diagram of a secure communication method according to an embodiment of the present disclosure. As shown in fig. 3, the secure communication method is applied to a power distribution master station, and includes the following steps S301 to S302:
in step S301, performing authentication with a power distribution terminal based on an improved SM2 algorithm, and performing key agreement with the power distribution terminal based on the improved SM2 algorithm after the authentication is successful, to obtain a session key K of the power distribution terminal and the power distribution master station, where in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm, so as to realize binding between a random public key and an identifier;
in step S302, when the key agreement result is true, encrypted communication is performed with the distribution terminal based on the SM1 algorithm using the session key K.
According to the embodiment of the disclosure, the authentication of the power distribution main station and the power distribution terminal based on the improved SM2 algorithm comprises the following steps: the power distribution master station generates a second random public key factor r2 and an identity displacement identifier ID2 of the power distribution master station; receiving a first random public key factor r1, a unique identifier S1 of the session and an identity unique identifier ID1 of the power distribution terminal, which are sent by the power distribution terminal; receiving a first Request value Request sent by the power distribution terminal, wherein the first Request value Request is obtained by the power distribution terminal through calculation according to the r1, the S1 and the ID1, and the first Request value Request comprises a first encryption result obtained through encryption calculation of r1, S1 and ID1 based on an SM2 algorithm public key of a power distribution main station and a second encryption result obtained through encryption calculation of r1, S1 and the ID1 based on an SM2 algorithm private key of the power distribution terminal; decrypting the first encryption result based on an SM2 algorithm private key of the power distribution master station to obtain r1, S1 and ID 1; and decrypting the second encryption result based on the SM2 algorithm public key of the power distribution terminal to obtain a second decryption result, and when the second decryption result is determined to be the same as the SM3 algorithm hash operation result of the r1, the S1 and the ID1, the power distribution master station successfully authenticates the power distribution terminal.
According to the embodiment of the disclosure, after the power distribution master station successfully authenticates the power distribution terminal, a first Reply value Reply is sent to the power distribution terminal, so that the power distribution terminal authenticates the power distribution master station according to the first Reply value Reply.
According to the embodiment of the present disclosure, the first Request value Request is calculated by the following formulaTo: request = E pc (r1ǁS1ǁID1)ǁE dt (H (r 1 ǁ S1 ǁ ID 1)), where | | is the data concatenation operation, H () is the SM3 algorithm hash operation on the data in parentheses, E |) pc () The public key of SM2 algorithm of distribution main station is used to make encryption operation on the data in parentheses, E dt () The SM2 algorithm private key of the power distribution terminal is used for carrying out encryption operation E on the data in brackets pc (r 1 ǁ S1 ǁ ID 1) is the first encryption result, E dt (H (r 1 ǁ S1 ǁ ID 1)) is the second encryption result.
According to the embodiment of the disclosure, the key agreement with the power distribution terminal based on the improved SM2 algorithm after the authentication is successful includes: selecting point B (x) on the elliptic curve B ,y B ) Wherein point B satisfies the elliptic curve equation and is a non-infinite point; receiving point A = (x) transmitted by power distribution terminal A ,y A ) Wherein point a satisfies an elliptic curve equation and is a non-infinite point; obtaining the domain element in the point B, and carrying out dual transformation on the domain element in the point B to obtain a second conjugate value
Figure 48168DEST_PATH_IMAGE007
Wherein, in the step (A),
Figure 131662DEST_PATH_IMAGE008
n is a natural number,&is a bitwise AND operation; calculating a second intermediate value based on the second conjugate value
Figure 772858DEST_PATH_IMAGE009
Wherein mod is a modulo operation; obtaining the domain element in the point A, and carrying out dual transformation on the domain element in the point A to obtain a first conjugate value
Figure 724634DEST_PATH_IMAGE010
(ii) a According to the second intermediate value t B And a first conjugate value
Figure 275832DEST_PATH_IMAGE011
Calculating a point on an elliptic curve
Figure 592544DEST_PATH_IMAGE012
Wherein h is a cofactor; when the point V is judged to be a non-infinite point, a fourth random number R is calculated B = R2^ R1, and transmits the R B To the distribution main station so that the distribution main station can be operated according to the fourth random number R B And a third random number R A Judging the result of key agreement, wherein the third random number R A The power distribution terminal calculates a fourth random number R by adopting a mode of calculating a power distribution main station B Calculated in the same way, is a bitwise logic operation.
According to the embodiment of the present disclosure, when the fourth random number R B And a third random number R A And if so, the key negotiation result is true, otherwise, the key negotiation result is false.
According to the embodiment of the present disclosure, the session key K is obtained by: according to the formula K = KDF (x) U ǁy U ǁZ t ǁZ c ǁr1ǁr2,L K ) Calculating a session key K of the power distribution terminal and the power distribution master station, wherein KDF () is a key derivation function, x V And y V A field element of point V, Z t Is a hash value of the discernible identifier relating to the distribution terminal, the partial elliptic curve system parameter and its public key, Z c Is a hash value of the discernible identity, partial elliptic curve system parameters and its public key with respect to the distribution main station, L K Is the encoding length of the session key K.
According to the embodiment of the disclosure, the performing encrypted communication with the power distribution terminal by using the session key K based on the SM1 algorithm includes: obtaining encrypted monitoring data E sent by power distribution terminal 1 Said encrypted monitoring data E 1 The distribution terminal performs SM1 encryption operation E on monitoring DATA DATA1 based on the session key K K (DATA 1); carrying out decryption operation D on the encrypted monitoring data E1 based on the session key K K (E K (DATA 1)), obtaining the monitoring DATA 1; generating corresponding control DATA2 according to the monitoring DATA 1; based on the session key K pairThe control DATA DATA2 performs an SM1 encryption operation E K (DATA 2) obtaining encrypted control DATA E 2 (ii) a Transmitting the encryption control data E 2 To the power distribution terminal.
According to the technical scheme of the embodiment of the disclosure, authentication and key agreement between the power distribution terminal and the power distribution main station are realized through an improved SM2 algorithm, encrypted communication between the power distribution terminal and the power distribution main station is realized through an SM1 algorithm, so that both communication parties can use less communication resources and calculation resources on the premise of ensuring the security of the key agreement, the utilization rate of system resources in the power distribution terminal is optimized, the bottleneck of high concurrency of the power distribution main station when massive power distribution terminals are accessed is avoided, and the applicability of the scheme is improved.
According to the embodiment of the disclosure, the safety communication method is applied to power distribution service communication, the connection between a power distribution terminal and a power distribution main station is disconnected after each power distribution service is finished, and a currently used session key is deleted and is not reused. The method comprises the steps that authentication and key agreement are required to be carried out again when power distribution service communication is required to be carried out between the power distribution main station and the power distribution terminal every time, and the authentication and key agreement are required to be carried out again when the connection between the power distribution main station and the power distribution terminal is overtime.
According to the technical scheme of the embodiment of the disclosure, the authentication and key agreement between the power distribution terminal and the power distribution master station are required to be carried out again by setting when the service communication is carried out each time and the connection is overtime, so that the safety is further improved.
Fig. 4 shows a block diagram of a secure communication device according to an embodiment of the present disclosure. The apparatus may be implemented as part or all of an electronic device through software, hardware, or a combination of both.
The secure communication device 400 may be located at a power distribution terminal, as shown in fig. 4, the secure communication device 400 including:
the first authentication and key agreement module 401 is configured to enable the power distribution terminal and the power distribution master station to perform authentication based on an improved SM2 algorithm, and perform key agreement with the power distribution master station based on the improved SM2 algorithm after the authentication is successful, so as to obtain a session key K of the power distribution terminal and the power distribution master station, where in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm, so as to implement binding between a random public key and an identifier;
a first encryption communication module 402 configured to enable the power distribution terminal to perform encryption communication with the power distribution master station based on an SM1 algorithm by using the session key K when the key negotiation result is true.
According to the embodiment of the disclosure, the authentication of the power distribution terminal and the power distribution master station based on the improved SM2 algorithm includes: the power distribution terminal generates a first random public key factor r1, a unique identifier S1 of the session and a unique identifier ID1 of the power distribution terminal; receiving a second random public key factor r2 sent by a power distribution master station and an identity displacement identifier ID2 of the power distribution master station; calculating a first Request value Request according to the r1, the S1 and the ID1, and sending the first Request value Request to the power distribution main station, wherein the first Request value Request comprises a first encryption result obtained by carrying out encryption calculation on r1, S1 and ID1 based on an SM2 algorithm public key of the power distribution main station, and a second encryption result obtained by carrying out encryption calculation on an SM3 algorithm hash operation result of the r1, S1 and ID1 based on an MS2 algorithm private key of the power distribution terminal; when a first judgment result obtained by the power distribution master station through calculation according to the first Request value Request is true, receiving a first Reply value Reply sent by the power distribution master station, wherein the first Reply value includes a third encryption result obtained by carrying out encryption calculation on r2, S1 and ID2 based on an SM2 algorithm public key of the power distribution terminal, and a fourth encryption result obtained by carrying out encryption calculation on an SM3 algorithm hash operation result of r2, S1 and ID2 based on an SM2 algorithm private key of the power distribution master station; decrypting the first Reply value Reply to obtain the r2, the S1 and the ID 2; and decrypting the fourth encryption result based on the SM2 algorithm public key of the power distribution main station to obtain a first decryption result, and successfully authenticating the power distribution terminal and the power distribution main station when the first decryption result is determined to be the same as the SM3 algorithm hash operation results of the r2, the S1 and the ID 2.
Wherein the first Request value Request is calculated by the following formula: request = E pc (r1ǁS1ǁID1)ǁE dt (H (r 1 ǁ S1 ǁ ID 1)), the first recovery value Reply being calculated by the following formula: reply = E pt (r2ǁS1ǁID2)ǁE dc (H (r 2 ǁ S1 ǁ ID 2)), where ǁ is data stitching operation, H () is SM3 algorithm hash operation on data in parentheses, E pc () The SM2 algorithm public key of the distribution main station is used for carrying out encryption operation on data in brackets, E dt () The SM2 algorithm private key of the power distribution terminal is used for carrying out encryption operation on data in brackets, E pt () The SM2 algorithm public key of the power distribution terminal is used for carrying out encryption operation on data in brackets, E dc () The SM2 algorithm private key of the power distribution main station is used for carrying out encryption operation on data in brackets, E pt (r 2 ǁ S1 ǁ ID 2) is the third encryption result, E dc (H (r 2 ǁ S1 ǁ ID 2)) is the fourth encryption result. The decrypting the first Reply value Reply to obtain the r2, the S1 and the ID2 includes: and carrying out decryption operation on the third encryption result based on an SM2 algorithm private key of the power distribution terminal to obtain r2, S1 and ID 2.
According to the embodiment of the disclosure, the first judgment result is obtained by comparing a hash operation result of the SM3 algorithm of the distribution master station according to r1, S1 and ID1 with a second decryption result obtained by decrypting the second encryption result by using an SM2 algorithm public key of the distribution terminal; wherein, when the SM3 algorithm hash operation result of the r1, the S1 and the ID1 is the same as the second decryption result, the first judgment result is true; when the SM3 algorithm hash operation result of the r1, the S1 and the ID1 is different from the second decryption result, the first judgment result is false.
According to the embodiment of the disclosure, after the authentication is successful, performing key agreement with the power distribution master station based on the improved SM2 algorithm includes: selecting point a = (x) on elliptic curve A ,y A ) Wherein point a satisfies an elliptic curve equation and is a non-infinite point; receiving point B (x) transmitted by power distribution main station B ,y B ) Wherein point B satisfies the elliptic curve equation and is a non-infinite point; obtaining the domain elements in the point A, and carrying out dual transformation on the domain elements in the point A to obtainFirst conjugate value
Figure 48933DEST_PATH_IMAGE001
Wherein, in the step (A),
Figure 351870DEST_PATH_IMAGE002
n is a natural number,&is a bitwise AND operation; calculating a first intermediate value based on the first conjugate value
Figure 944525DEST_PATH_IMAGE003
Wherein mod is a modulo operation; obtaining the domain element in the point B, and carrying out dual transformation on the domain element in the point B to obtain a second conjugate value
Figure 232523DEST_PATH_IMAGE004
(ii) a According to the first intermediate value t A And a second conjugate value
Figure 910629DEST_PATH_IMAGE005
Calculating a point on the elliptic curve
Figure 345152DEST_PATH_IMAGE006
Wherein h is a cofactor; when the point U is judged to be a non-infinite point, a third random number R is calculated A = R1^ R2, and transmits the R A To the distribution main station so that the distribution main station can be operated according to the third random number R A And a fourth random number R B Judging a key negotiation result, wherein the fourth random number R B The power distribution main station calculates a third random number R by adopting a mode of calculating a third random number R with the power distribution terminal A Calculated in the same way, is a bitwise logic operation. When the third random number R A And a fourth random number R B And if so, the key negotiation result is true, otherwise, the key negotiation result is false. According to the formula K = KDF (x) U ǁy U ǁZ t ǁZ c ǁr1ǁr2,L K ) And calculating a session key K of the power distribution terminal and the power distribution main station, wherein KDF () is a key derivation function, x U And y U A field element of point U, Z t To be related toDiscernable identification of an electrical terminal, hash value, Z, of partial elliptic curve system parameters and of its public key c Is a hash value of the discernible identity, partial elliptic curve system parameters and its public key with respect to the distribution main station, L K The encoding length of the session key K is; and when the key negotiation result is true, the power distribution terminal performs data transmission with the power distribution master station based on the session key K.
According to the embodiment of the disclosure, the encrypted communication with the power distribution master station by using the session key K based on the SM1 algorithm includes: acquiring monitoring data; carrying out SM1 encryption operation on the monitoring data based on the session key K to obtain encrypted monitoring data, and sending the encrypted monitoring data to the power distribution master station; acquiring encrypted control data sent by a power distribution master station, wherein the encrypted control data is obtained by carrying out SM1 encryption operation on the control data by the power distribution master station based on the session key K, and the control data is generated by the power distribution master station according to the received encrypted monitoring data; and carrying out SM1 decryption operation on the encrypted control data according to the session key K to obtain the control data.
According to the technical scheme of the embodiment of the disclosure, authentication and key agreement between the power distribution terminal and the power distribution main station are realized through an improved SM2 algorithm, encrypted communication between the power distribution terminal and the power distribution main station is realized through an SM1 algorithm, so that both communication parties can use less communication resources and calculation resources on the premise of ensuring the security of the key agreement, the utilization rate of system resources in the power distribution terminal is optimized, the bottleneck of high concurrency of the power distribution main station when massive power distribution terminals are accessed is avoided, and the applicability of the scheme is improved.
Fig. 5 shows a block diagram of another secure communication device according to an embodiment of the present disclosure. The apparatus may be implemented as part or all of an electronic device through software, hardware, or a combination of both.
The secure communication device 500 may be located at a power distribution main station, as shown in fig. 5, and the secure communication device 500 includes:
the second authentication and key agreement module 501 is configured to enable the power distribution master station and the power distribution terminal to perform authentication based on an improved SM2 algorithm, and perform key agreement with the power distribution terminal after the authentication is successful based on the improved SM2 algorithm, so as to obtain a session key K of the power distribution terminal and the power distribution master station, where in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm, so as to realize binding between a random public key and an identifier;
and a second encrypted communication module 502 configured to enable the power distribution master station and the power distribution terminal to perform encrypted communication based on an SM1 algorithm by using the session key K when the key agreement result is true.
According to the embodiment of the disclosure, the authentication of the power distribution main station and the power distribution terminal based on the improved SM2 algorithm includes: the power distribution master station generates a second random public key factor r2 and an identity displacement identifier ID2 of the power distribution master station; receiving a first random public key factor r1, a unique identifier S1 of the session and an identity unique identifier ID1 of the power distribution terminal, which are sent by the power distribution terminal; receiving a first Request value Request sent by the power distribution terminal, wherein the first Request value Request is obtained by the power distribution terminal through calculation according to the r1, the S1 and the ID1, and comprises a first encryption result obtained through encryption calculation of an SM2 algorithm public key of the power distribution main station on the r1, the S1 and the ID1, and a second encryption result obtained through encryption calculation of an SM2 algorithm private key of the power distribution terminal on the r1, the S1 and the ID 1; decrypting the first encryption result based on an SM2 algorithm private key of the power distribution master station to obtain r1, S1 and ID 1; and decrypting the second encryption result based on the SM2 algorithm public key of the power distribution terminal to obtain a second decryption result, and when the second decryption result is determined to be the same as the SM3 algorithm hash operation result of the r1, the S1 and the ID1, the power distribution master station successfully authenticates the power distribution terminal. And after the power distribution main station successfully authenticates the power distribution terminal, sending a first recovery value Reply to the power distribution terminal so that the power distribution terminal authenticates the power distribution main station according to the first recovery value Reply.
Wherein the first Request value Request is calculated by the following formula: request = E pc (r1ǁS1ǁID1)ǁE dt (H(r1ǁS1ǁID1) Wherein, | | is data splicing operation, H () is SM3 algorithm hash operation on the data in parentheses, E | pc () The public key of SM2 algorithm of distribution main station is used to make encryption operation on the data in parentheses, E dt () The SM2 algorithm private key of the power distribution terminal is used for carrying out encryption operation E on the data in brackets pc (r 1 ǁ S1 ǁ ID 1) is the first encryption result, E dt (H (r 1 ǁ S1 ǁ ID 1)) is the second encryption result.
According to the embodiment of the disclosure, the key agreement with the power distribution terminal based on the improved SM2 algorithm after the authentication is successful includes: selecting point B (x) on the elliptic curve B ,y B ) Wherein point B satisfies the elliptic curve equation and is a non-infinite point; receiving point A = (x) transmitted by power distribution terminal A ,y A ) Wherein, the point A satisfies an elliptic curve equation and is a point which is not at infinity; obtaining the domain element in the point B, and carrying out dual transformation on the domain element in the point B to obtain a second conjugate value
Figure 729997DEST_PATH_IMAGE007
Wherein, in the step (A),
Figure 450828DEST_PATH_IMAGE008
n is a natural number,&is a bitwise AND operation; calculating a second intermediate value based on the second conjugate value
Figure 491597DEST_PATH_IMAGE009
Wherein mod is a modulo operation;
obtaining the domain element in the point A, and carrying out dual transformation on the domain element in the point A to obtain a first conjugate value
Figure 260970DEST_PATH_IMAGE010
(ii) a According to the second intermediate value t B And a first conjugate value
Figure 828217DEST_PATH_IMAGE011
Calculating a point on an elliptic curve
Figure 595316DEST_PATH_IMAGE012
Wherein h is a cofactor; when the point V is judged to be a non-infinite point, a fourth random number R is calculated B = R2^ R1, and transmits the R B To the distribution main station so that the distribution main station can be operated according to the fourth random number R B And a third random number R A Judging the result of key agreement, wherein the third random number R A The power distribution terminal calculates a fourth random number R by adopting a mode of calculating a power distribution main station B Calculated in the same way, is a bitwise logic operation. When the fourth random number R B And a third random number R A And if so, the key negotiation result is true, otherwise, the key negotiation result is false. According to the formula K = KDF (x) U ǁy U ǁZ t ǁZ c ǁr1ǁr2,L K ) Calculating a session key K of the power distribution terminal and the power distribution main station, wherein KDF () is a key derivation function, x V And y V A field element of point V, Z t Is a hash value of the discernible identifier relating to the distribution terminal, the partial elliptic curve system parameter and its public key, Z c Is a hash value of the discernible identity, partial elliptic curve system parameters and its public key with respect to the distribution main station, L K Is the encoding length of the session key K.
According to the embodiment of the disclosure, the encrypted communication with the power distribution terminal by using the session key K based on the SM1 algorithm includes: acquiring encrypted monitoring data sent by a power distribution terminal, wherein the encrypted monitoring data is obtained by carrying out SM1 encryption operation on the monitoring data by the power distribution terminal based on the session key K; carrying out decryption operation on the encrypted monitoring data based on the session key K to obtain the monitoring data; generating corresponding control data according to the monitoring data; performing SM1 encryption operation on the control data based on the session key K to obtain encrypted control data; and sending the encrypted control data to the power distribution terminal.
According to the technical scheme of the embodiment of the disclosure, authentication and key agreement between the power distribution terminal and the power distribution main station are realized through an improved SM2 algorithm, encrypted communication between the power distribution terminal and the power distribution main station is realized through an SM1 algorithm, so that both communication parties can use less communication resources and calculation resources on the premise of ensuring the security of the key agreement, the utilization rate of system resources in the power distribution terminal is optimized, the bottleneck of high concurrency of the power distribution main station when massive power distribution terminals are accessed is avoided, and the applicability of the scheme is improved.
The embodiment of the present disclosure also provides a chip, where the chip includes the above secure communication device, and the device may be implemented as part or all of the chip through software, hardware, or a combination of both.
The present disclosure also discloses an electronic device, and fig. 6 shows a block diagram of the electronic device according to an embodiment of the present disclosure.
As shown in fig. 6, the electronic device includes a memory and a processor, where the memory is to store one or more computer instructions, where the one or more computer instructions are executed by the processor to implement a method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the method includes: the power distribution terminal and the power distribution master station perform authentication and key agreement based on an improved SM2 algorithm, wherein in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm to realize the binding between a random public key and an identifier; the power distribution terminal and the power distribution main station carry out encrypted communication based on an SM1 algorithm. Or, the power distribution master station and the power distribution terminal perform authentication and key agreement based on an improved SM2 algorithm, wherein in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm, and the binding between a random public key and an identifier is realized; the power distribution main station and the power distribution terminal carry out encrypted communication based on an SM1 algorithm.
FIG. 7 shows a schematic block diagram of a computer system suitable for use in implementing methods according to embodiments of the present disclosure.
As shown in fig. 7, the computer system includes a processing unit that can execute the various methods in the above-described embodiments according to a program stored in a Read Only Memory (ROM) or a program loaded from a storage section into a Random Access Memory (RAM). In the RAM, various programs and data necessary for the operation of the computer system are also stored. The processing unit, the ROM, and the RAM are connected to each other by a bus. An input/output (I/O) interface is also connected to the bus.
The following components are connected to the I/O interface: an input section including a keyboard, a mouse, and the like; an output section including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section including a hard disk and the like; and a communication section including a network interface card such as a LAN card, a modem, or the like. The communication section performs a communication process via a network such as the internet. The drive is also connected to the I/O interface as needed. A removable medium such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive as necessary, so that a computer program read out therefrom is mounted into the storage section as necessary. The processing unit can be realized as a CPU, a GPU, a TPU, an FPGA, an NPU and other processing units.
In particular, the methods described above may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the above-described method. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section, and/or installed from a removable medium.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present disclosure may be implemented by software or by programmable hardware. The units or modules described may also be provided in a processor, and the names of the units or modules do not in some cases constitute a limitation on the units or modules themselves.
As another aspect, the present disclosure also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the electronic device or the computer system in the above embodiments; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described in the present disclosure.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is possible without departing from the inventive concept. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (45)

1. A secure communication method is applied to a power distribution terminal and is characterized by comprising the following steps:
the method comprises the steps that authentication is carried out on the basis of an improved SM2 algorithm with a power distribution main station, and after the authentication is successful, key agreement is carried out on the basis of the improved SM2 algorithm with the power distribution main station to obtain a session key K of a power distribution terminal and the power distribution main station, wherein in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm to realize binding between a random public key and an identifier;
and when the key negotiation result is true, carrying out encrypted communication with the power distribution main station by utilizing the session key K based on an SM1 algorithm.
2. The method of claim 1, wherein the power distribution terminal authenticates with the power distribution master station based on a modified SM2 algorithm, comprising:
the power distribution terminal generates a first random public key factor r1, a session unique identifier S1 and an identity unique identifier ID1 of the power distribution terminal;
receiving a second random public key factor r2 sent by a power distribution master station and an identity displacement identifier ID2 of the power distribution master station;
calculating a first Request value Request according to the r1, the S1 and the ID1, and sending the first Request value Request to the power distribution main station, wherein the first Request value Request comprises a first encryption result obtained by carrying out encryption calculation on r1, S1 and ID1 based on an SM2 algorithm public key of the power distribution main station, and a second encryption result obtained by carrying out encryption calculation on an SM3 algorithm hash operation result of the r1, the S1 and the ID1 based on an MS2 algorithm private key of the power distribution terminal;
when a first judgment result obtained by the power distribution master station through calculation according to the first Request value Request is true, receiving a first Reply value Reply sent by the power distribution master station, wherein the first Reply value Reply comprises a third encryption result obtained by carrying out encryption calculation on r2, S1 and ID2 based on an SM2 algorithm public key of the power distribution terminal, and a fourth encryption result obtained by carrying out encryption calculation on SM3 algorithm hash calculation results of r2, S1 and ID2 based on an SM2 algorithm private key of the power distribution master station;
decrypting the first Reply value Reply to obtain the r2, the S1 and the ID 2;
and decrypting the fourth encryption result based on the SM2 algorithm public key of the power distribution main station to obtain a first decryption result, and successfully authenticating the power distribution terminal and the power distribution main station when the first decryption result is determined to be the same as the SM3 algorithm hash operation results of the r2, the S1 and the ID 2.
3. The method of claim 2,
the first Request value Request is calculated by the following formula: request = E pc (r1ǁS1ǁID1)ǁE dt (H (r 1 ǁ S1 ǁ ID 1)), the first recovery value Reply being calculated by: reply = E pt (r2ǁS1ǁID2)ǁE dc (H (r 2 ǁ S1 ǁ ID 2)), where ǁ is a data concatenation operation, H () is an SM3 algorithm hash operation on the data in parentheses, and E pc () The SM2 algorithm public key of the distribution main station is used for carrying out encryption operation on data in brackets, E dt () The SM2 algorithm private key of the power distribution terminal is used for carrying out encryption operation on data in brackets, E pt () Carrying out encryption operation on data in brackets by using SM2 algorithm public key of a power distribution terminal, E dc () The SM2 algorithm private key of the power distribution main station is used for carrying out encryption operation on data in brackets, E pt (r 2 ǁ S1 ǁ ID 2) is the third encryption result, E dc (H (r 2 ǁ S1 ǁ ID 2)) is the fourth encryption result.
4. The method according to claim 2, wherein the decrypting the first Reply value Reply to obtain the r2, the S1 and the ID2 comprises:
and carrying out decryption operation on the third encryption result based on an SM2 algorithm private key of the power distribution terminal to obtain r2, S1 and ID 2.
5. The method of claim 2, wherein the first determination result is obtained by comparing the result of the SM3 algorithm hash operation of the distribution master station according to r1, S1 and ID1 with a second decryption result obtained by decrypting the second encryption result by using the SM2 algorithm public key of the distribution terminal;
wherein, when the SM3 algorithm hash operation result of the r1, the S1 and the ID1 is the same as the second decryption result, the first judgment result is true;
when the SM3 algorithm hash operation result of the r1, the S1 and the ID1 is different from the second decryption result, the first judgment result is false.
6. The method of claim 1, wherein performing key agreement with the distribution master station based on the modified SM2 algorithm after successful authentication comprises:
selecting point a = (x) on elliptic curve A ,y A ) Wherein point a satisfies an elliptic curve equation and is a non-infinite point;
receiving point B (x) transmitted by distribution master station B ,y B ) Wherein point B satisfies the elliptic curve equation and is a point that is not at infinity;
obtaining the domain elements in the point A, and carrying out dual transformation on the domain elements in the point A to obtain a first conjugate value
Figure DEST_PATH_IMAGE002
Wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE004
n is a natural number,&is a bitwise AND operation;
calculating a first intermediate value based on the first conjugate value
Figure DEST_PATH_IMAGE006
Wherein mod is a modulo operation;
obtaining the domain element in the point B, and carrying out dual transformation on the domain element in the point B to obtain a second conjugate value
Figure DEST_PATH_IMAGE008
According to the first intermediate value t A And a second conjugate value
Figure DEST_PATH_IMAGE010
Calculating a point on an elliptic curve
Figure DEST_PATH_IMAGE012
Wherein h is a cofactor;
when the point U is judged to be a non-infinite point, a third random number R is calculated A = R1^ R2, and transmits the R A To the distribution main station so that the distribution main station can be operated according to the third random number R A And a fourth random number R B Judging a key negotiation result, wherein the fourth random number R B The power distribution main station calculates a third random number R by adopting a mode of calculating a third random number R with the power distribution terminal A Calculated in the same way, is a bitwise logic operation.
7. The method of claim 6,
when the third random number R A And a fourth random number R B And if so, the key negotiation result is true, otherwise, the key negotiation result is false.
8. The method of claim 6, wherein the session key K is obtained by:
according to the formula K = KDF (x) U ǁy U ǁZ t ǁZ c ǁr1ǁr2,L K ) Calculating a session key K of the power distribution terminal and the power distribution main station, wherein KDF () is a key derivation function, x U And y U A field element of point U, Z t Is a hash value of the discernible identifier relating to the distribution terminal, the partial elliptic curve system parameter and its public key, Z c Is a hash value of the discernible identity, partial elliptic curve system parameters and its public key with respect to the distribution main station, L K Is the encoding length of the session key K.
9. The method of claim 8, wherein the using the session key K for encrypted communication with the distribution master station based on the SM1 algorithm comprises:
acquiring monitoring data;
carrying out SM1 encryption operation on the monitoring data based on the session key K to obtain encrypted monitoring data, and sending the encrypted monitoring data to the power distribution master station;
acquiring encrypted control data sent by a power distribution master station, wherein the encrypted control data is obtained by carrying out SM1 encryption operation on the control data by the power distribution master station based on the session key K, and the control data is generated by the power distribution master station according to the received encrypted monitoring data;
and carrying out SM1 decryption operation on the encrypted control data according to the session key K to obtain the control data.
10. The method of claim 1, wherein the secure communication method is applied to power distribution service communication, and after each power distribution service is finished, the connection between the power distribution terminal and the power distribution main station is disconnected, and the currently used session key is deleted and is not reused.
11. The method of claim 10, wherein the power distribution terminal and the power distribution master station re-authenticate and re-key the key agreement each time power distribution service communication or connection timeout is required.
12. A safe communication method is applied to a power distribution main station and is characterized by comprising the following steps:
the method comprises the steps that authentication is carried out on the basis of an improved SM2 algorithm with a power distribution terminal, and after the authentication is successful, key agreement is carried out on the basis of the improved SM2 algorithm with the power distribution terminal to obtain a session key K of the power distribution terminal and a power distribution main station, wherein in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm to realize binding between a random public key and an identifier;
and when the key negotiation result is true, carrying out encrypted communication with the power distribution terminal by using the session key K based on an SM1 algorithm.
13. The method of claim 12, wherein the power distribution master station authenticates with the power distribution terminal based on a modified SM2 algorithm, comprising:
the power distribution master station generates a second random public key factor r2 and an identity displacement identifier ID2 of the power distribution master station;
receiving a first random public key factor r1, a session unique identifier S1 and an identity unique identifier ID1 of a power distribution terminal, which are sent by the power distribution terminal;
receiving a first Request value Request sent by the power distribution terminal, wherein the first Request value Request is obtained by the power distribution terminal through calculation according to the r1, the S1 and the ID1, and the first Request value Request comprises a first encryption result obtained through encryption calculation of r1, S1 and ID1 based on an SM2 algorithm public key of a power distribution main station and a second encryption result obtained through encryption calculation of r1, S1 and the ID1 based on an SM2 algorithm private key of the power distribution terminal;
decrypting the first encryption result based on an SM2 algorithm private key of the power distribution master station to obtain r1, S1 and ID 1;
and decrypting the second encryption result based on the SM2 algorithm public key of the power distribution terminal to obtain a second decryption result, and when the second decryption result is determined to be the same as the SM3 algorithm hash operation result of the r1, the S1 and the ID1, the power distribution master station successfully authenticates the power distribution terminal.
14. The method of claim 13, further comprising:
and after the power distribution main station successfully authenticates the power distribution terminal, sending a first recovery value Reply to the power distribution terminal so that the power distribution terminal authenticates the power distribution main station according to the first recovery value Reply.
15. The method of claim 13,
the first Request value Request is calculated by the following formula: request = E pc (r1ǁS1ǁID1)ǁE dt (H (r 1 ǁ S1 ǁ ID 1)), where | | | is the data concatenation operation, H (R1 ǁ S1 ǁ ID 1)) The data in parentheses is subjected to SM3 algorithm hashing operation, E pc () The SM2 algorithm public key of the distribution main station is used for carrying out encryption operation on data in brackets, E dt () The SM2 algorithm private key of the power distribution terminal is used for carrying out encryption operation E on the data in brackets pc (r 1 ǁ S1 ǁ ID 1) is the first encryption result, E dt (H (r 1 ǁ S1 ǁ ID 1)) is the second encryption result.
16. The method of claim 12, wherein the key agreement with the distribution terminal based on the modified SM2 algorithm after the authentication is successful comprises:
selecting point B (x) on the elliptic curve B ,y B ) Wherein point B satisfies the elliptic curve equation and is a non-infinite point;
receiving point A = (x) transmitted by power distribution terminal A ,y A ) Wherein, the point A satisfies an elliptic curve equation and is a point which is not at infinity;
obtaining the domain element in the point B, and carrying out dual transformation on the domain element in the point B to obtain a second conjugate value
Figure DEST_PATH_IMAGE014
Wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE016
n is a natural number,&is a bitwise AND operation;
calculating a second intermediate value based on the second conjugate value
Figure DEST_PATH_IMAGE018
Wherein mod is a modulo operation;
obtaining the domain element in the point A, and carrying out dual transformation on the domain element in the point A to obtain a first conjugate value
Figure DEST_PATH_IMAGE020
According to the second intermediate value t B And a first conjugate value
Figure DEST_PATH_IMAGE022
Calculating a point on the elliptic curve
Figure DEST_PATH_IMAGE024
Wherein h is a cofactor;
when the point V is judged to be a non-infinite point, a fourth random number R is calculated B = R2^ R1, and transmits the R B To the distribution main station so that the distribution main station can be operated according to the fourth random number R B And a third random number R A Judging the result of key agreement, wherein the third random number R A The power distribution terminal calculates a fourth random number R by adopting a mode of calculating a power distribution main station B Calculated in the same way, is a bitwise logic operation.
17. The method of claim 16,
when the fourth random number R B And a third random number R A And if so, the key negotiation result is true, otherwise, the key negotiation result is false.
18. The method of claim 16, wherein the session key K is obtained by:
according to the formula K = KDF (x) U ǁy U ǁZ t ǁZ c ǁr1ǁr2,L K ) Calculating a session key K of the power distribution terminal and the power distribution main station, wherein KDF () is a key derivation function, x V And y V Being a field element of point V, Z t Is a hash value of the discernible identifier relating to the distribution terminal, the partial elliptic curve system parameter and its public key, Z c Is a hash value of a discernable identification about the distribution main station, a partial elliptic curve system parameter and its public key, L K Is the encoding length of the session key K.
19. The method of claim 12, wherein the utilizing the session key K for encrypted communication with the distribution terminal based on the SM1 algorithm comprises:
acquiring encrypted monitoring data sent by a power distribution terminal, wherein the encrypted monitoring data is obtained by carrying out SM1 encryption operation on the monitoring data by the power distribution terminal based on the session key K;
carrying out decryption operation on the encrypted monitoring data based on the session key K to obtain the monitoring data;
generating corresponding control data according to the monitoring data;
performing SM1 encryption operation on the control data based on the session key K to obtain encrypted control data;
and sending the encrypted control data to the power distribution terminal.
20. The method of claim 12, wherein the secure communication method is applied to power distribution service communication, and the connection between the power distribution terminal and the power distribution master station is disconnected after each power distribution service is finished, and the currently used session key is deleted and is not reused.
21. The method of claim 20, wherein the power distribution master station and the power distribution terminal perform authentication and key agreement again each time power distribution service communication is required or a connection time-out occurs.
22. A secure communications device at a power distribution terminal, comprising:
the first authentication and key agreement module is configured to enable the power distribution terminal and the power distribution master station to perform authentication based on an improved SM2 algorithm, and perform key agreement with the power distribution master station based on the improved SM2 algorithm after the authentication is successful, so as to obtain a session key K of the power distribution terminal and the power distribution master station, wherein in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm, so that binding between a random public key and an identifier is realized;
and the first encryption communication module is configured to enable the power distribution terminal to perform encryption communication with the power distribution main station by using the session key K based on an SM1 algorithm when the key negotiation result is true.
23. The apparatus of claim 22, wherein the power distribution terminal authenticates with the power distribution master station based on a modified SM2 algorithm, comprising:
the power distribution terminal generates a first random public key factor r1, a unique identifier S1 of the session and a unique identifier ID1 of the power distribution terminal;
receiving a second random public key factor r2 sent by a power distribution master station and an identity displacement identifier ID2 of the power distribution master station;
calculating a first Request value Request according to the r1, the S1 and the ID1, and sending the first Request value Request to the power distribution main station, wherein the first Request value Request comprises a first encryption result obtained by carrying out encryption calculation on r1, S1 and ID1 based on an SM2 algorithm public key of the power distribution main station, and a second encryption result obtained by carrying out encryption calculation on an SM3 algorithm hash operation result of the r1, S1 and ID1 based on an MS2 algorithm private key of the power distribution terminal;
when a first judgment result obtained by the power distribution master station through calculation according to the first Request value Request is true, receiving a first Reply value Reply sent by the power distribution master station, wherein the first Reply value includes a third encryption result obtained by carrying out encryption calculation on r2, S1 and ID2 based on an SM2 algorithm public key of the power distribution terminal, and a fourth encryption result obtained by carrying out encryption calculation on an SM3 algorithm hash operation result of r2, S1 and ID2 based on an SM2 algorithm private key of the power distribution master station;
decrypting the first Reply value Reply to obtain the r2, the S1 and the ID 2;
and decrypting the fourth encryption result based on the SM2 algorithm public key of the power distribution main station to obtain a first decryption result, and successfully authenticating the power distribution terminal and the power distribution main station when the first decryption result is determined to be the same as the SM3 algorithm hash operation results of the r2, the S1 and the ID 2.
24. The apparatus of claim 23, wherein the first Request value Request is calculated by: request = E pc (r1ǁS1ǁID1)ǁE dt (H (r 1 ǁ S1 ǁ ID 1)), the first recovery value Reply being calculated by: reply = E pt (r2ǁS1ǁID2)ǁE dc (H (r 2 ǁ S1 ǁ ID 2)), where ǁ is data stitching operation, H () is SM3 algorithm hash operation on data in parentheses, E pc () The public key of SM2 algorithm of distribution main station is used to make encryption operation on the data in parentheses, E dt () Carrying out encryption operation on data in brackets by using SM2 algorithm private key of a power distribution terminal, E pt () The SM2 algorithm public key of the power distribution terminal is used for carrying out encryption operation on data in brackets, E dc () The SM2 algorithm private key of the power distribution main station is used for carrying out encryption operation on data in brackets, E pt (r 2 ǁ S1 ǁ ID 2) is the third encryption result, E dc (H (r 2 ǁ S1 ǁ ID 2)) is the fourth encryption result.
25. The apparatus of claim 23, wherein the decrypting the first Reply value Reply to obtain the r2, the S1, and the ID2 comprises:
and carrying out decryption operation on the third encryption result based on an SM2 algorithm private key of the power distribution terminal to obtain the r2, the S1 and the ID 2.
26. The apparatus of claim 23, wherein the first determination result is obtained by comparing a hash operation result of the SM3 algorithm of r1, S1 and ID1 by the distribution master station and a second decryption result obtained by decrypting the second encryption result by using an SM2 algorithm public key of the distribution terminal;
wherein, when the SM3 algorithm hash operation result of the r1, the S1 and the ID1 is the same as the second decryption result, the first judgment result is true;
when the SM3 algorithm hash result of the r1, S1, and ID1 is different from the second decryption result, the first judgment result is false.
27. The apparatus of claim 22, wherein the key agreement with the distribution master station based on the modified SM2 algorithm after the authentication is successful comprises:
selecting point a = (x) on elliptic curve A ,y A ) Wherein point a satisfies an elliptic curve equation and is a non-infinite point;
receiving point B (x) transmitted by power distribution main station B ,y B ) Wherein point B satisfies the elliptic curve equation and is a non-infinite point;
obtaining the domain elements in the point A, and carrying out dual transformation on the domain elements in the point A to obtain a first conjugate value
Figure 945950DEST_PATH_IMAGE002
Wherein the content of the first and second substances,
Figure 535194DEST_PATH_IMAGE004
n is a natural number, and n is a natural number,&is a bitwise AND operation;
calculating a first intermediate value based on the first conjugate value
Figure 501882DEST_PATH_IMAGE006
Wherein mod is a modulo operation;
obtaining the domain element in the point B, and carrying out dual transformation on the domain element in the point B to obtain a second conjugate value
Figure 834774DEST_PATH_IMAGE008
According to the first intermediate value t A And a second conjugate value
Figure 337562DEST_PATH_IMAGE010
Calculating a point on an elliptic curve
Figure 894445DEST_PATH_IMAGE012
Wherein h is a cofactor;
when the point U is judged to be a non-infinite point, a third random number R is calculated A = R1^ R2, and transmits the R A To the power distribution main station to make the power distribution main station according to the third random number R A And a fourth random number R B Judging a key negotiation result, wherein the fourth random number R B The power distribution main station calculates a third random number R by adopting a mode of calculating a third random number R with the power distribution terminal A Calculated in the same way, is a bitwise logic operation.
28. The apparatus of claim 27,
when the third random number R A And a fourth random number R B And if so, the key negotiation result is true, otherwise, the key negotiation result is false.
29. The apparatus of claim 27, wherein the session key K is obtained by:
according to the formula K = KDF (x) U ǁy U ǁZ t ǁZ c ǁr1ǁr2,L K ) Calculating a session key K of the power distribution terminal and the power distribution main station, wherein KDF () is a key derivation function, x U And y U Is a field element of point U, Z t Is a hash value of a discernible identifier relating to the distribution terminal, a partial elliptic curve system parameter and its public key, Z c Is a hash value of the discernible identity, partial elliptic curve system parameters and its public key with respect to the distribution main station, L K Is the encoding length of the session key K.
30. The apparatus of claim 22, wherein said utilizing the session key K to perform encrypted communications with the power distribution master station based on the SM1 algorithm comprises:
acquiring monitoring data;
carrying out SM1 encryption operation on the monitoring data based on the session key K to obtain encrypted monitoring data, and sending the encrypted monitoring data to the power distribution master station;
acquiring encrypted control data sent by a power distribution master station, wherein the encrypted control data is obtained by carrying out SM1 encryption operation on the control data by the power distribution master station based on the session key K, and the control data is generated by the power distribution master station according to the received encrypted monitoring data;
and carrying out SM1 decryption operation on the encrypted control data according to the session key K to obtain the control data.
31. The apparatus of claim 22, wherein the secure communication means is adapted to communicate with the power distribution service, and wherein after each power distribution service is completed, the connection between the power distribution terminal and the power distribution master station is disconnected, and the currently used session key is deleted and not reused.
32. The apparatus of claim 31, wherein the power distribution terminal and the power distribution master station re-authenticate and re-key each time power distribution service communication or connection timeout is required.
33. A secure communications device at a power distribution master station, comprising:
the second authentication and key agreement module is configured to enable the power distribution main station and the power distribution terminal to perform authentication based on an improved SM2 algorithm, and perform key agreement with the power distribution terminal based on the improved SM2 algorithm after the authentication is successful, so as to obtain a session key K of the power distribution terminal and the power distribution main station, wherein in the improved SM2 algorithm, a random public key factor directly participates in an identifier mapping algorithm, so that binding between a random public key and an identifier is realized;
and the second encryption communication module is configured to enable the power distribution main station and the power distribution terminal to perform encryption communication based on an SM1 algorithm by using the session key K when the key negotiation result is true.
34. The apparatus of claim 33, wherein the power distribution master station authenticates with the power distribution terminal based on a modified SM2 algorithm, comprising:
the power distribution master station generates a second random public key factor r2 and an identity displacement identifier ID2 of the power distribution master station;
receiving a first random public key factor r1, a unique identifier S1 of the session and an identity unique identifier ID1 of the power distribution terminal, which are sent by the power distribution terminal;
receiving a first Request value Request sent by the power distribution terminal, wherein the first Request value Request is obtained by the power distribution terminal through calculation according to the r1, the S1 and the ID1, and the first Request value Request comprises a first encryption result obtained through encryption calculation of r1, S1 and ID1 based on an SM2 algorithm public key of a power distribution main station and a second encryption result obtained through encryption calculation of r1, S1 and the ID1 based on an SM2 algorithm private key of the power distribution terminal;
decrypting the first encryption result based on an SM2 algorithm private key of the power distribution master station to obtain r1, S1 and ID 1;
and decrypting the second encryption result based on the SM2 algorithm public key of the power distribution terminal to obtain a second decryption result, and when the second decryption result is determined to be the same as the SM3 algorithm hash operation results of the r1, the S1 and the ID1, the power distribution master station successfully authenticates the power distribution terminal.
35. The apparatus of claim 34, further comprising:
and after the power distribution main station successfully authenticates the power distribution terminal, sending a first recovery value Reply to the power distribution terminal so that the power distribution terminal authenticates the power distribution main station according to the first recovery value Reply.
36. The apparatus of claim 34, wherein the first Request value Request is calculated by: request = E pc (r1ǁS1ǁID1)ǁE dt (H (r 1 ǁ S1 ǁ ID 1)), where | | | is the data stitching operation, and H () is the SM3 algorithm performed on the data in parenthesesHash operation, E pc () The SM2 algorithm public key of the distribution main station is used for carrying out encryption operation on data in brackets, E dt () The SM2 algorithm private key of the power distribution terminal is used for carrying out encryption operation E on the data in brackets pc (r 1 ǁ S1 ǁ ID 1) is the first encryption result, E dt (H (r 1 ǁ S1 ǁ ID 1)) is the second encryption result.
37. The apparatus of claim 33, wherein the performing key agreement with the power distribution terminal based on the modified SM2 algorithm after the authentication is successful comprises:
selecting point B (x) on the elliptic curve B ,y B ) Wherein point B satisfies the elliptic curve equation and is a point that is not at infinity;
receiving point A = (x) transmitted by power distribution terminal A ,y A ) Wherein point a satisfies an elliptic curve equation and is a non-infinite point;
obtaining the domain element in the point B, and carrying out dual transformation on the domain element in the point B to obtain a second conjugate value
Figure 833582DEST_PATH_IMAGE014
Wherein, the first and the second end of the pipe are connected with each other,
Figure 16171DEST_PATH_IMAGE016
n is a natural number,&is a bitwise AND operation;
calculating a second intermediate value based on the second conjugate value
Figure 622733DEST_PATH_IMAGE018
Wherein mod is a modulo operation;
obtaining the domain elements in the point A, and carrying out dual transformation on the domain elements in the point A to obtain a first conjugate value
Figure 38933DEST_PATH_IMAGE020
According to the second intermediate value t B And a first conjugate value
Figure 730945DEST_PATH_IMAGE022
Calculating a point on an elliptic curve
Figure 202378DEST_PATH_IMAGE024
Wherein h is a cofactor;
when the point V is judged to be a non-infinite point, a fourth random number R is calculated B = R2^ R1, and transmits the R B To the distribution main station so that the distribution main station can be operated according to the fourth random number R B And a third random number R A Judging the result of key agreement, wherein the third random number R A The power distribution terminal calculates a fourth random number R by adopting a mode of calculating a power distribution main station B Calculated in the same way, is a bitwise logic operation.
38. The apparatus of claim 37,
when the fourth random number R B And a third random number R A And if so, the key negotiation result is true, otherwise, the key negotiation result is false.
39. The apparatus of claim 37, wherein the session key K is obtained by:
according to the formula K = KDF (x) U ǁy U ǁZ t ǁZ c ǁr1ǁr2,L K ) Calculating a session key K of the power distribution terminal and the power distribution main station, wherein KDF () is a key derivation function, x V And y V A field element of point V, Z t Is a hash value of the discernible identifier relating to the distribution terminal, the partial elliptic curve system parameter and its public key, Z c Is a hash value of the discernible identity, partial elliptic curve system parameters and its public key with respect to the distribution main station, L K Is the encoding length of the session key K.
40. The apparatus of claim 33, wherein the utilizing the session key K for encrypted communication with the distribution terminal based on the SM1 algorithm comprises:
acquiring encrypted monitoring data sent by a power distribution terminal, wherein the encrypted monitoring data is obtained by carrying out SM1 encryption operation on the monitoring data by the power distribution terminal based on the session key K;
carrying out decryption operation on the encrypted monitoring data based on the session key K to obtain the monitoring data;
generating corresponding control data according to the monitoring data;
carrying out SM1 encryption operation on the control data based on the session key K to obtain encrypted control data;
and sending the encrypted control data to the power distribution terminal.
41. The apparatus of claim 33, wherein the secure communication means is adapted to communicate with the power distribution service, and wherein after each power distribution service is completed, the connection between the power distribution terminal and the power distribution master station is disconnected, and the currently used session key is deleted and not reused.
42. The apparatus of claim 41, wherein the power distribution master station and the power distribution terminal perform authentication and key agreement again each time power distribution service communication is required or connection time-out occurs.
43. A chip, characterized in that,
the chip comprising a secure communication device according to any of claims 22-42.
44. An electronic device comprising a memory and a processor; wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method steps of any of claims 1-21.
45. A computer-readable storage medium having stored thereon computer instructions, characterized in that the computer instructions, when executed by a processor, implement the method steps of any of claims 1-21.
CN202211022575.4A 2022-08-25 2022-08-25 Secure communication method, device, chip, electronic equipment and readable storage medium Pending CN115102700A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211022575.4A CN115102700A (en) 2022-08-25 2022-08-25 Secure communication method, device, chip, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211022575.4A CN115102700A (en) 2022-08-25 2022-08-25 Secure communication method, device, chip, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN115102700A true CN115102700A (en) 2022-09-23

Family

ID=83300126

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211022575.4A Pending CN115102700A (en) 2022-08-25 2022-08-25 Secure communication method, device, chip, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN115102700A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102710624A (en) * 2012-05-24 2012-10-03 广东电网公司电力科学研究院 Customizable network identity authentication method based on SM2 algorithm
CN103178953A (en) * 2013-02-27 2013-06-26 中国电力科学研究院 Secure chip key issuing system and secure chip key issuing method
CN105049206A (en) * 2015-05-22 2015-11-11 哈尔滨工程大学 Method employing SM2 elliptical curve algorithm to achieve encryption in OpenSSL
US20190052458A1 (en) * 2016-02-23 2019-02-14 nChain Holdings Limited Determining a common secret for the secure exchange of information and hierarchical, deterministic cryptographic keys
CN112202568A (en) * 2020-10-09 2021-01-08 天津大学 Software and hardware collaborative design SM9 digital signature communication method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102710624A (en) * 2012-05-24 2012-10-03 广东电网公司电力科学研究院 Customizable network identity authentication method based on SM2 algorithm
CN103178953A (en) * 2013-02-27 2013-06-26 中国电力科学研究院 Secure chip key issuing system and secure chip key issuing method
CN105049206A (en) * 2015-05-22 2015-11-11 哈尔滨工程大学 Method employing SM2 elliptical curve algorithm to achieve encryption in OpenSSL
US20190052458A1 (en) * 2016-02-23 2019-02-14 nChain Holdings Limited Determining a common secret for the secure exchange of information and hierarchical, deterministic cryptographic keys
CN112202568A (en) * 2020-10-09 2021-01-08 天津大学 Software and hardware collaborative design SM9 digital signature communication method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LI WEI 等: "Design and Implementation of an SM2-Based Security Authentication Scheme With the Key Agreement for Smart Grid Communications", 《IEEE ACCESS》 *

Similar Documents

Publication Publication Date Title
CN109257327B (en) Communication message safety interaction method and device for power distribution automation system
CN111028397B (en) Authentication method and device, and vehicle control method and device
CN110784322B (en) Method, system, equipment and medium for connecting gateway equipment and cloud platform
CN103338215A (en) Method for establishing TLS (Transport Layer Security) channel based on state secret algorithm
CN101304310B (en) Method for reinforcing network SSL service
CN110808991B (en) Method, system, electronic device and storage medium for secure communication connection
CN110690966B (en) Method, system, equipment and storage medium for connecting terminal and service server
CN109150526A (en) Cryptographic key negotiation method, equipment, terminal, storage medium and system
CN114826656A (en) Trusted data link transmission method and system
CN111181723A (en) Method and device for offline security authentication between Internet of things devices
CN110635901A (en) Local Bluetooth dynamic authentication method and system for Internet of things equipment
CN111147257A (en) Identity authentication and information confidentiality method, monitoring center and remote terminal unit
CN105099699A (en) Safe and high-efficiency communication method based on equipment of Internet of things and system
CN109922022A (en) Internet of Things communication means, platform, terminal and system
CN111435389A (en) Power distribution terminal operation and maintenance tool safety protection system
CN103281324A (en) Safety communication method for Android client side
CN112020037A (en) Domestic communication encryption method suitable for rail transit
CN111740985A (en) TCP long connection security verification encryption method
CN208707655U (en) A kind of power distribution automation key agreement system
CN112787990B (en) Power terminal trusted access authentication method and system
CN111274570A (en) Encryption authentication method and device, server, readable storage medium and air conditioner
CN115102700A (en) Secure communication method, device, chip, electronic equipment and readable storage medium
CN114650173A (en) Encryption communication method and system
CN105471916B (en) Take precautions against the method that the latent channel key of Secure Socket Layer is restored
CN113905359B (en) Bluetooth safety communication method, device, equipment and medium for bank peripheral equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220923