Safe data acquisition method and system based on IEC104 protocol
By introducing password signature and AES256 encryption technology in the IEC104 protocol layer, the lack of identity authentication and data security in the protocol is solved, and secure data transmission between power Internet of Things devices is realized, ensuring the credibility and security of communication.
Patent Information
- Application Number
- CN202411221457.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-11-26
AI Technical Summary
The IEC104 protocol lacks identity authentication and data security mechanisms, and cannot effectively ensure the trustworthiness and data security of both communication parties in modern networks.
Device identity authentication is performed by introducing cryptographic signature technology in the IEC104 protocol layer, and data transmission is protected using AES256 symmetric encryption technology to ensure data security during communication. Specific steps include the elliptic curve digital signature verification and encryption decryption process between the gateway device and the terminal device to ensure the security of data transmission.
It effectively solves the identity authentication and data security issues in the IEC104 protocol, ensures that the data transmission between power IoT devices is trustworthy and secure, and enhances the security of communication.
Smart Images

Figure CN119030778A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of new energy technology, and in particular to a safe IEC104 protocol-based data acquisition method and system. Background Art
[0002] The full name of IEC104 protocol is IEC60870-5-104 protocol, which is a power automation communication protocol developed by the International Electrotechnical Commission. The two parties in the protocol communication adopt a balanced transmission mode, and both parties can independently initiate communication sessions to send and receive data. Due to the increasing demand for data security in modern networks, the IEC104 protocol was not designed with identity authentication and data security requirements in mind. It is necessary to use modern cryptography technology to expand the IEC104 protocol to ensure the identity trust and data security of both parties in communication from the protocol layer. Summary of the invention
[0003] In view of the defects in the prior art, the object of the present invention is to provide a safe data acquisition method and system based on the IEC104 protocol.
[0004] A safe IEC104 protocol-based data acquisition method provided by the present invention includes:
[0005] Step S1: instruct the gateway device to generate and send an extended STARTDT request frame of the IEC104 protocol;
[0006] Step S2: The terminal device receives the STARTDT request frame from the gateway device, verifies the gateway device, constructs an authentication reply message, and sends an extended STARTDT confirmation frame message to the gateway device;
[0007] Step S3: After receiving the STARTDT confirmation frame from the terminal device, the gateway device verifies the correctness of the authentication reply information;
[0008] Step S4: Instruct the terminal device to prepare data, construct a data I frame, and use the secret key to perform AES256 encryption on the ASDU and send it to the gateway device;
[0009] Step S5: Instruct the gateway device to receive the data I frame from the terminal device, and use the decryption key to decrypt the ASDU part of the received data frame to obtain the required data.
[0010] Preferably, in step S1:
[0011] Obtain the public key PK of the terminal device through an offline or online secure channel;
[0012] Generate and send the extended STARTDT request frame of the IEC104 protocol: the extended STARTDT request frame includes an 8-byte current UTC time stamp and a 16-byte random number, as well as an elliptic curve digital signature of timestamp_gw and nonce_gw using the private key SKgw of the gateway device;
[0013] Specifically includes: 8 bytes of time stamp, 16 bytes of random number, 65 bytes of signature data and 33 bytes of public key;
[0014] Among them, the 8-byte time stamp is UTC, marked as timestamp_gw, in milliseconds, and is used for timeliness judgment;
[0015] The 16-byte random number is marked as nonce_gw;
[0016] 65 bytes of signature data are digitally signed using the elliptic curve algorithm;
[0017] The 33-byte public key is used to verify the elliptic curve public key of the digital signature.
[0018] Preferably, in step S2:
[0019] Obtain the public key PKgw of the gateway device through an offline or online secure channel;
[0020] Receive the STARTDT request frame from the gateway device and verify the gateway device: Use the public key PKgw of the gateway device to verify the signature of the received random number nonce_gw using the elliptic curve digital signature verification algorithm to confirm that the timestamp timestamp_gw has not timed out;
[0021] After verification, the authentication reply information is constructed, including the current timestamp_rtu and nonce_gw of the terminal device, the 16-byte random number nonce_rtu generated by the terminal device, and the signature generated by the elliptic curve digital signature algorithm on timestamp_rtu, nonce_gw and nonce_rtu using the terminal device private key SKrtu;
[0022] Send an extended STARTDT confirmation frame message and a constructed authentication reply message to the gateway device;
[0023] STARTDT confirmation frame extension:
[0024] The extended STARTDT confirmation frame adds content to prove the identity of the confirmer after the original message: 8 bytes of time stamp, 16 bytes of random number, 65 bytes of signature data and 33 bytes of public key;
[0025] Among them, the 8-byte time stamp UTC standard time is accurate to milliseconds and is used for timeliness judgment;
[0026] 65 bytes of signature data are digitally signed using the elliptic curve algorithm;
[0027] The 33-byte public key is used to verify the elliptic curve public key of the digital signature.
[0028] Preferably, in step S3:
[0029] After receiving the STARTDT confirmation frame from the terminal device, verify the correctness of the authentication reply information: use the public key PKrtu of the terminal device to verify the timestamp_rtu, nonce_gw and the signature of nonce_rtu using the elliptic curve digital signature verification algorithm, check the timestamp, and compare the received nonce_gw with the sent nonce_gw for consistency;
[0030] If the signature verification is passed and the sent and received nonce_gw are confirmed to be consistent and the time stamp has not timed out, the authentication is considered to be successful and the IEC104 data communication process begins. Otherwise, the subsequent data transmission process will not be started if it fails.
[0031] Preferably, in step S4:
[0032] IEC104 protocol information I frame message encryption adjustment: After the adjustment, all sensitive data, i.e., ASDU part, is encrypted;
[0033] Concatenate nonce_gw and nonce_rtu together to construct the secret key enc_key of nonce_gw+nonce_rtu; a total of 32 bytes, 256 bits;
[0034] Prepare data, construct data I frame, and use the secret key enc_key to encrypt ASDU with AES256, and send it to the gateway device; repeat until all required data has been sent;
[0035] If a general call is received from the gateway device, the general call is sent here to complete the transmission.
[0036] Preferably, in step S5:
[0037] Concatenate nonce_gw and nonce_rtu together to construct the decryption key dec_key of nonce_gw+nonce_rtu, a total of 32 bytes and 256 bits;
[0038] If the terminal device is not configured with periodic upload or change upload, a general call command is sent to the terminal device to request terminal data;
[0039] Receive the data I frame of the terminal device, use dec_key to decrypt the ASDU part of the received data frame using the AES256 algorithm to obtain the required data; repeat until all the required data is received.
[0040] A safe IEC104 protocol-based data acquisition system provided by the present invention includes:
[0041] Module M1: instructs the gateway device to generate and send an extended STARTDT request frame of the IEC104 protocol;
[0042] Module M2: enables the terminal device to receive the STARTDT request frame from the gateway device, authenticate the gateway device, construct an authentication reply message, and send an extended STARTDT confirmation frame message to the gateway device;
[0043] Module M3: After the gateway device receives the STARTDT confirmation frame from the terminal device, it verifies the correctness of the authentication reply information;
[0044] Module M4: Instructs the terminal device to prepare data, construct a data I frame, and use the secret key to perform AES256 encryption on the ASDU and send it to the gateway device;
[0045] Module M5: Instructs the gateway device to receive the data I frame from the terminal device, and uses the decryption key to decrypt the ASDU part of the received data frame to obtain the required data.
[0046] Preferably, in the module M1:
[0047] Obtain the public key PK of the terminal device through an offline or online secure channel;
[0048] Generate and send the extended STARTDT request frame of the IEC104 protocol: the extended STARTDT request frame includes an 8-byte current UTC time stamp and a 16-byte random number, as well as an elliptic curve digital signature of timestamp_gw and nonce_gw using the private key SKgw of the gateway device;
[0049] Specifically includes: 8 bytes of time stamp, 16 bytes of random number, 65 bytes of signature data and 33 bytes of public key;
[0050] Among them, the 8-byte time stamp is UTC, marked as timestamp_gw, in milliseconds, and is used for timeliness judgment;
[0051] The 16-byte random number is marked as nonce_gw;
[0052] 65 bytes of signature data are digitally signed using the elliptic curve algorithm;
[0053] The 33-byte public key is used to verify the elliptic curve public key of the digital signature;
[0054] In the module M2:
[0055] Obtain the public key PKgw of the gateway device through an offline or online secure channel;
[0056] Receive the STARTDT request frame from the gateway device and verify the gateway device: Use the public key PKgw of the gateway device to verify the signature of the received random number nonce_gw using the elliptic curve digital signature verification algorithm to confirm that the timestamp timestamp_gw has not timed out;
[0057] After verification, the authentication reply information is constructed, including the current timestamp_rtu and nonce_gw of the terminal device, the 16-byte random number nonce_rtu generated by the terminal device, and the signature generated by the elliptic curve digital signature algorithm on timestamp_rtu, nonce_gw and nonce_rtu using the terminal device private key SKrtu;
[0058] Send an extended STARTDT confirmation frame message and a constructed authentication reply message to the gateway device;
[0059] STARTDT confirmation frame extension:
[0060] The extended STARTDT confirmation frame adds content to prove the identity of the confirmer after the original message: 8 bytes of time stamp, 16 bytes of random number, 65 bytes of signature data and 33 bytes of public key;
[0061] Among them, the 8-byte time stamp UTC standard time is accurate to milliseconds and is used for timeliness judgment;
[0062] 65 bytes of signature data are digitally signed using the elliptic curve algorithm;
[0063] The 33-byte public key is used to verify the elliptic curve public key of the digital signature.
[0064] Preferably, in the module M3:
[0065] After receiving the STARTDT confirmation frame from the terminal device, verify the correctness of the authentication reply information: use the public key PKrtu of the terminal device to verify the timestamp_rtu, nonce_gw and the signature of nonce_rtu using the elliptic curve digital signature verification algorithm, check the timestamp, and compare the received nonce_gw with the sent nonce_gw for consistency;
[0066] If the signature verification is passed and the sent and received nonce_gw are confirmed to be consistent and the time stamp has not timed out, the authentication is considered to be passed and the IEC104 data communication process begins. Otherwise, the subsequent data transmission process will not be started if it fails.
[0067] In the module M4:
[0068] IEC104 protocol information I frame message encryption adjustment: After the adjustment, all sensitive data, namely the ASDU part, is encrypted; nonce_gw and nonce_rtu are concatenated together to construct the secret key enc_key of nonce_gw+nonce_rtu; a total of 32 bytes, 256 bits;
[0069] Prepare data, construct data I frame, and use the secret key enc_key to encrypt ASDU with AES256, and send it to the gateway device; repeat until all required data has been sent;
[0070] If a general call is received from the gateway device, the general call is sent here to complete the transmission.
[0071] Preferably, in the module M5:
[0072] Concatenate nonce_gw and nonce_rtu together to construct the decryption key dec_key of nonce_gw+nonce_rtu, a total of 32 bytes and 256 bits;
[0073] If the terminal device is not configured with periodic upload or change upload, a general call command is sent to the terminal device to request terminal data;
[0074] Receive the data I frame of the terminal device, use dec_key to decrypt the ASDU part of the received data frame using the AES256 algorithm to obtain the required data; repeat until all the required data is received.
[0075] Compared with the prior art, the present invention has the following beneficial effects:
[0076] The present invention adopts cryptographic signature technology to solve the problem of identity authentication of power Internet of Things devices at the IEC104 protocol layer; and adopts cryptographic symmetric encryption technology to solve the problem of power Internet of Things communication data security at the IEC104 protocol layer to ensure data credibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0078] Figure 1 This is a schematic diagram of the whole process interaction. DETAILED DESCRIPTION
[0079] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0080] Embodiment 1:
[0081] This method transforms the IEC104 protocol, adds security authentication and data encryption and decryption processes, and ensures the security of data transmission between the master station and the slave station through security authentication and symmetric encryption, thereby ensuring that the data acquisition system collects data safely and reliably through the IEC104 protocol.
[0082] A safe IEC104 protocol-based data acquisition method provided by the present invention includes:
[0083] Step S1: instruct the gateway device to generate and send an extended STARTDT request frame of the IEC104 protocol;
[0084] Specifically, in step S1:
[0085] Obtain the public key PK of the terminal device through an offline or online secure channel;
[0086] Generate and send the extended STARTDT request frame of the IEC104 protocol: the extended STARTDT request frame includes an 8-byte current UTC time stamp and a 16-byte random number, as well as an elliptic curve digital signature of timestamp_gw and nonce_gw using the private key SKgw of the gateway device;
[0087] Specifically includes: 8 bytes of time stamp, 16 bytes of random number, 65 bytes of signature data and 33 bytes of public key;
[0088] Among them, the 8-byte time stamp is UTC, marked as timestamp_gw, in milliseconds, and is used for timeliness judgment;
[0089] The 16-byte random number is marked as nonce_gw;
[0090] 65 bytes of signature data are digitally signed using the elliptic curve algorithm;
[0091] The 33-byte public key is used to verify the elliptic curve public key of the digital signature.
[0092] Step S2: The terminal device receives the STARTDT request frame from the gateway device, verifies the gateway device, constructs an authentication reply message, and sends an extended STARTDT confirmation frame message to the gateway device;
[0093] Specifically, in step S2:
[0094] Obtain the public key PKgw of the gateway device through an offline or online secure channel;
[0095] Receive the STARTDT request frame from the gateway device and verify the gateway device: Use the public key PKgw of the gateway device to verify the signature of the received random number nonce_gw using the elliptic curve digital signature verification algorithm to confirm that the timestamp timestamp_gw has not timed out;
[0096] After verification, the authentication reply information is constructed, including the current timestamp_rtu and nonce_gw of the terminal device, the 16-byte random number nonce_rtu generated by the terminal device, and the signature generated by the elliptic curve digital signature algorithm on timestamp_rtu, nonce_gw and nonce_rtu using the terminal device private key SKrtu;
[0097] Send an extended STARTDT confirmation frame message and a constructed authentication reply message to the gateway device;
[0098] STARTDT confirmation frame extension:
[0099] The extended STARTDT confirmation frame adds content to prove the identity of the confirmer after the original message: 8 bytes of time stamp, 16 bytes of random number, 65 bytes of signature data and 33 bytes of public key;
[0100] Among them, the 8-byte time stamp UTC standard time is accurate to milliseconds and is used for timeliness judgment;
[0101] 65 bytes of signature data are digitally signed using the elliptic curve algorithm;
[0102] The 33-byte public key is used to verify the elliptic curve public key of the digital signature.
[0103] Step S3: After receiving the STARTDT confirmation frame from the terminal device, the gateway device verifies the correctness of the authentication reply information;
[0104] Specifically, in step S3:
[0105] After receiving the STARTDT confirmation frame from the terminal device, verify the correctness of the authentication reply information: use the public key PKrtu of the terminal device to verify the timestamp_rtu, nonce_gw and the signature of nonce_rtu using the elliptic curve digital signature verification algorithm, check the timestamp, and compare the received nonce_gw with the sent nonce_gw for consistency;
[0106] If the signature verification is passed and the sent and received nonce_gw are confirmed to be consistent and the time stamp has not timed out, the authentication is considered to be successful and the IEC104 data communication process begins. Otherwise, the subsequent data transmission process will not be started if it fails.
[0107] Step S4: Instruct the terminal device to prepare data, construct a data I frame, and use the secret key to perform AES256 encryption on the ASDU and send it to the gateway device;
[0108] Specifically, in step S4:
[0109] IEC104 protocol information I frame message encryption adjustment: After the adjustment, all sensitive data, i.e., ASDU part, is encrypted;
[0110] Concatenate nonce_gw and nonce_rtu together to construct the secret key enc_key of nonce_gw+nonce_rtu; a total of 32 bytes, 256 bits;
[0111] Prepare data, construct data I frame, and use the secret key enc_key to encrypt ASDU with AES256, and send it to the gateway device; repeat until all required data has been sent;
[0112] If a general call is received from the gateway device, the general call is sent here to complete the transmission.
[0113] Step S5: Instruct the gateway device to receive the data I frame from the terminal device, and use the decryption key to decrypt the ASDU part of the received data frame to obtain the required data.
[0114] Specifically, in step S5:
[0115] Concatenate nonce_gw and nonce_rtu together to construct the decryption key dec_key of nonce_gw+nonce_rtu, a total of 32 bytes and 256 bits;
[0116] If the terminal device is not configured with periodic upload or change upload, a general call command is sent to the terminal device to request terminal data;
[0117] Receive the data I frame of the terminal device, use dec_key to decrypt the ASDU part of the received data frame using the AES256 algorithm to obtain the required data; repeat until all the required data is received.
[0118] Embodiment 2:
[0119] Embodiment 2 is a preferred example of Embodiment 1, and is used to illustrate the present invention in more detail.
[0120] The present invention also provides a secure data acquisition system based on the IEC104 protocol. The secure data acquisition system based on the IEC104 protocol can be implemented by executing the process steps of the secure data acquisition method based on the IEC104 protocol, that is, those skilled in the art can understand the secure data acquisition method based on the IEC104 protocol as a preferred implementation of the secure data acquisition system based on the IEC104 protocol.
[0121] A safe IEC104 protocol-based data acquisition system provided by the present invention includes:
[0122] Module M1: instructs the gateway device to generate and send an extended STARTDT request frame of the IEC104 protocol;
[0123] Specifically, in the module M1:
[0124] Obtain the public key PK of the terminal device through an offline or online secure channel;
[0125] Generate and send the extended STARTDT request frame of the IEC104 protocol: the extended STARTDT request frame includes an 8-byte current UTC time stamp and a 16-byte random number, as well as an elliptic curve digital signature of timestamp_gw and nonce_gw using the private key SKgw of the gateway device;
[0126] Specifically includes: 8 bytes of time stamp, 16 bytes of random number, 65 bytes of signature data and 33 bytes of public key;
[0127] Among them, the 8-byte time stamp is UTC, marked as timestamp_gw, in milliseconds, and is used for timeliness judgment;
[0128] The 16-byte random number is marked as nonce_gw;
[0129] 65 bytes of signature data are digitally signed using the elliptic curve algorithm;
[0130] The 33-byte public key is used to verify the elliptic curve public key of the digital signature;
[0131] Module M2: enables the terminal device to receive the STARTDT request frame from the gateway device, authenticate the gateway device, construct an authentication reply message, and send an extended STARTDT confirmation frame message to the gateway device;
[0132] In the module M2:
[0133] Obtain the public key PKgw of the gateway device through an offline or online secure channel;
[0134] Receive the STARTDT request frame from the gateway device and verify the gateway device: Use the public key PKgw of the gateway device to verify the signature of the received random number nonce_gw using the elliptic curve digital signature verification algorithm to confirm that the timestamp timestamp_gw has not timed out;
[0135] After verification, the authentication reply information is constructed, including the current timestamp_rtu and nonce_gw of the terminal device, the 16-byte random number nonce_rtu generated by the terminal device, and the signature generated by the elliptic curve digital signature algorithm on timestamp_rtu, nonce_gw and nonce_rtu using the terminal device private key SKrtu;
[0136] Send an extended STARTDT confirmation frame message and a constructed authentication reply message to the gateway device;
[0137] STARTDT confirmation frame extension:
[0138] The extended STARTDT confirmation frame adds content to prove the identity of the confirmer after the original message: 8 bytes of time stamp, 16 bytes of random number, 65 bytes of signature data and 33 bytes of public key;
[0139] Among them, the 8-byte time stamp UTC standard time is accurate to milliseconds and is used for timeliness judgment;
[0140] 65 bytes of signature data are digitally signed using the elliptic curve algorithm;
[0141] The 33-byte public key is used to verify the elliptic curve public key of the digital signature.
[0142] Module M3: After the gateway device receives the STARTDT confirmation frame from the terminal device, it verifies the correctness of the authentication reply information;
[0143] Specifically, in the module M3:
[0144] After receiving the STARTDT confirmation frame from the terminal device, verify the correctness of the authentication reply information: use the public key PKrtu of the terminal device to verify the timestamp_rtu, nonce_gw and the signature of nonce_rtu using the elliptic curve digital signature verification algorithm, check the timestamp, and compare the received nonce_gw with the sent nonce_gw for consistency;
[0145] If the signature verification is passed and the sent and received nonce_gw are confirmed to be consistent and the time stamp has not timed out, the authentication is considered to be passed and the IEC104 data communication process begins. Otherwise, the subsequent data transmission process will not be started if it fails.
[0146] Module M4: Instructs the terminal device to prepare data, construct a data I frame, and use the secret key to perform AES256 encryption on the ASDU and send it to the gateway device;
[0147] In the module M4:
[0148] IEC104 protocol information I frame message encryption adjustment: After the adjustment, all sensitive data, i.e., ASDU part, is encrypted;
[0149] Concatenate nonce_gw and nonce_rtu together to construct the secret key enc_key of nonce_gw+nonce_rtu; a total of 32 bytes, 256 bits;
[0150] Prepare data, construct data I frame, and use the secret key enc_key to encrypt ASDU with AES256, and send it to the gateway device; repeat until all required data has been sent;
[0151] If a general call is received from the gateway device, the general call is sent here to complete the transmission.
[0152] Module M5: Instructs the gateway device to receive the data I frame from the terminal device, and uses the decryption key to decrypt the ASDU part of the received data frame to obtain the required data.
[0153] Specifically, in the module M5:
[0154] Concatenate nonce_gw and nonce_rtu together to construct the decryption key dec_key of nonce_gw+nonce_rtu, a total of 32 bytes and 256 bits;
[0155] If the terminal device is not configured with periodic upload or change upload, a general call command is sent to the terminal device to request terminal data;
[0156] Receive the data I frame of the terminal device, use dec_key to decrypt the ASDU part of the received data frame using the AES256 algorithm to obtain the required data; repeat until all the required data is received.
[0157] Embodiment 3:
[0158] Embodiment 3 is a preferred example of Embodiment 1, and is used to illustrate the present invention in more detail.
[0159] The U frame in the IEC104 protocol does not carry additional data, so it needs to be extended. The extension of the IEC104 protocol STARTDT request and confirmation frame content <The following data contents are all in hexadecimal> and the length parsing is adjusted as follows:
[0160] 1) STARTDT request frame extension
[0161] A. Before extension: 68 (start character) 04 (length 4 bytes) 07 00 00 00 (control field)
[0162] B. After expansion: 68 (start character) 7E (length 126 bytes) 07 00 00 00 (control field) XX..XX (8-byte time stamp) XX..XX (16-byte request random number) XX..XX (65-byte signature) XX..XX (33-byte public key)
[0163] The extended STARTDT frame adds content to prove the identity of the requester after the original message: 8 bytes of time stamp (UTC standard time accurate to milliseconds, used for timeliness judgment), 16 bytes of random number, 65 bytes of signature data (digital signature generated by elliptic curve algorithm) and 33 bytes of public key (elliptic curve public key used to verify digital signature)
[0164] 2) STARTDT confirmation frame extension
[0165] A. Before extension: 68 (start character) 04 (length 4 bytes) 08 00 00 00 (control field)
[0166] B. After expansion: 68 (starter) 8E (length 132 bytes) 08 00 00 00 (control field) XX..XX (8-byte time stamp) XX..XX (16-byte request random number) XX..XX (16-byte response random number) XX..XX (65-byte signature) XX..XX (33-byte public key)
[0167] The extended STARTDT confirmation frame adds content to prove the identity of the confirmer after the original message: 8 bytes of time stamp (UTC standard time accurate to milliseconds, used for timeliness judgment), 16 bytes of random number, 65 bytes of signature data (digital signature generated by elliptic curve algorithm) and 33 bytes of public key (elliptic curve public key used to verify digital signature)
[0168] IEC104 protocol information I frame message encryption adjustment:
[0169] A. Before adjustment: 68 (start character) LL (length LL bytes, 4-byte control field + ASDU length, maximum 253) XX..XX (LL bytes of content, content is not encrypted)
[0170] B. After adjustment: 68 (starter) LL (length LL bytes, 4-byte control field + ASDU plain text length, maximum 253) XX..XX (4-byte control field + encrypted ASDU content)
[0171] After the adjustment, all sensitive data, namely the ASDU part, will be encrypted. Compared with before the adjustment, third parties will not be able to directly parse sensitive data from the message.
[0172] Length LL Description: The adjusted LL value is the plaintext ASDU length plus the control field length 4, but the subsequent ASDU content is actually encrypted. The ciphertext length can actually be calculated based on the encryption algorithm.
[0173] The method includes the following roles or functional modules:
[0174] 1) Gateway device
[0175] A. The private key SKgw of the gateway device;
[0176] B. The public key PKgw of the gateway device;
[0177] C. Obtain the public key PK of the terminal device through an offline or online secure channel;
[0178] D. Generate and send an extended STARTDT request frame of the IEC104 protocol: the extended STARTDT request frame includes an 8-byte current UTC time stamp (marked as timestamp_gw, in milliseconds) and a 16-byte random number (marked as nonce_gw), as well as an elliptic curve digital signature of timestamp_gw and nonce_gw using the private key SKgw of the gateway device;
[0179] E. After receiving the STARTDT confirmation frame from the terminal device, verify the correctness of the authentication reply information: Use the public key PKrtu of the terminal device to verify the timestamp_rtu, nonce_gw and the signature of nonce_rtu using the elliptic curve digital signature verification algorithm, check the timestamp, and compare the received nonce_gw with the sent nonce_gw for consistency;
[0180] F. If the signature verification is passed and the nonce_gw sent and received are confirmed to be consistent and the time stamp has not timed out, the authentication is considered to be passed and the IEC104 data communication process begins. Otherwise, the subsequent data transmission process will not be started if it fails.
[0181] G. Concatenate nonce_gw and nonce_rtu together to construct a decryption key dec_key of nonce_gw+nonce_rtu, a total of 32 bytes and 256 bits;
[0182] H. Send a general call command to the terminal device to request terminal data (this item is optional and is not required if the terminal device is configured to send periodic data or change data);
[0183] I. Receive the data I frame of the terminal device, and use dec_key to decrypt the ASDU part of the received data frame using the AES256 algorithm to obtain the required data;
[0184] J. Repeat process I to receive all required data;
[0185] 2) Terminal equipment:
[0186] A. The private key SKrtu of the terminal device;
[0187] B. The public key PKrtu of the gateway device;
[0188] C. Obtain the public key PKgw of the gateway device through an offline or online secure channel;
[0189] D. Receive the STARTDT request frame from the gateway device and verify the gateway device: Use the PKgw held to verify the signature of the received nonce_gw using the elliptic curve digital signature verification algorithm to confirm that the timestamp_gw has not timed out;
[0190] E. After the above step D is verified, the authentication reply information is constructed: including the current timestamp_rtu and nonce_gw of the terminal device, the 16-byte random number nonce_rtu generated by the terminal device, and the signature generated by the elliptic curve digital signature algorithm on timestamp_rtu, nonce_gw and nonce_rtu using the terminal device private key SKrtu;
[0191] F. Send an extended STARTDT confirmation frame message to the gateway device, with the authentication reply message constructed in step E above;
[0192] G. Like the gateway device, concatenate nonce_gw and nonce_rtu together to construct a nonce_gw+nonce_rtu secret key enc_key, a total of 32 bytes and 256 bits;
[0193] H. Prepare data, construct data I frame, and use secret key enc_key to encrypt ASDU with AES256 and send it to the gateway device;
[0194] I. Repeat the processing logic of H above until all required data is sent;
[0195] J. If a general call is received from the gateway device, the general call is sent here to complete the transmission.
[0196] The above process is based on the original IEC104 protocol, with two new aspects. On the one hand, the identity authentication of the terminal and the gateway is added when establishing 104 communication (using the private key signature public key verification technology in known cryptography); on the other hand, the data is symmetric encrypted with AES256 using the negotiated key during data transmission, that is, the data sender encrypts with the key, and the data receiver decrypts with the same key. The steps are as follows: Figure 1 .
[0197] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.
[0198] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A safe data acquisition method based on IEC104 protocol, characterized in that: include: Step S1: instruct the gateway device to generate and send an extended STARTDT request frame of the IEC104 protocol; Step S2: The terminal device receives the STARTDT request frame from the gateway device, verifies the gateway device, constructs an authentication reply message, and sends an extended STARTDT confirmation frame message to the gateway device; Step S3: After receiving the STARTDT confirmation frame from the terminal device, the gateway device verifies the correctness of the authentication reply information; Step S4: Instruct the terminal device to prepare data, construct a data I frame, and use the secret key to perform AES256 encryption on the ASDU and send it to the gateway device; Step S5: Instruct the gateway device to receive the data I frame from the terminal device, and use the decryption key to decrypt the ASDU part of the received data frame to obtain the required data.
2. The safe IEC104 protocol-based data acquisition method according to claim 1 is characterized in that: In step S1: Obtain the public key PK of the terminal device through an offline or online secure channel; Generate and send the extended STARTDT request frame of the IEC104 protocol: the extended STARTDT request frame includes an 8-byte current UTC time stamp and a 16-byte random number, as well as an elliptic curve digital signature of timestamp_gw and nonce_gw using the private key SKgw of the gateway device; Specifically includes: 8 bytes of time stamp, 16 bytes of random number, 65 bytes of signature data and 33 bytes of public key; Among them, the 8-byte time stamp is UTC, marked as timestamp_gw, in milliseconds, and is used for timeliness judgment; The 16-byte random number is marked as nonce_gw; 65 bytes of signature data are digitally signed using the elliptic curve algorithm; The 33-byte public key is used to verify the elliptic curve public key of the digital signature.
3. The safe IEC104 protocol-based data acquisition method according to claim 1 is characterized in that: In step S2: Obtain the public key PKgw of the gateway device through an offline or online secure channel; Receive the STARTDT request frame from the gateway device and verify the gateway device: Use the public key PKgw of the gateway device to verify the signature of the received random number nonce_gw using the elliptic curve digital signature verification algorithm to confirm that the timestamp timestamp_gw has not timed out; After verification, the authentication reply information is constructed, including the current timestamp_rtu and nonce_gw of the terminal device, the 16-byte random number nonce_rtu generated by the terminal device, and the signature generated by the elliptic curve digital signature algorithm on timestamp_rtu, nonce_gw and nonce_rtu using the terminal device private key SKrtu; Send an extended STARTDT confirmation frame message and a constructed authentication reply message to the gateway device; STARTDT confirmation frame extension: The extended STARTDT confirmation frame adds content to prove the identity of the confirmer after the original message: 8 bytes of time stamp, 16 bytes of random number, 65 bytes of signature data and 33 bytes of public key; Among them, the 8-byte time stamp UTC standard time is accurate to milliseconds and is used for timeliness judgment; 65 bytes of signature data are digitally signed using the elliptic curve algorithm; The 33-byte public key is used to verify the elliptic curve public key of the digital signature.
4. The safe IEC104 protocol-based data acquisition method according to claim 1 is characterized in that: In step S3: After receiving the STARTDT confirmation frame from the terminal device, verify the correctness of the authentication reply information: use the public key PKrtu of the terminal device to verify the timestamp_rtu, nonce_gw and the signature of nonce_rtu using the elliptic curve digital signature verification algorithm, check the timestamp, and compare the received nonce_gw with the sent nonce_gw for consistency; If the signature verification is passed and the sent and received nonce_gw are confirmed to be consistent and the time stamp has not timed out, the authentication is considered to be successful and the IEC104 data communication process begins. Otherwise, the subsequent data transmission process will not be started if it fails.
5. The safe IEC104 protocol-based data acquisition method according to claim 1 is characterized in that: In step S4: IEC104 protocol information I frame message encryption adjustment: After the adjustment, all sensitive data, i.e., ASDU part, is encrypted; Concatenate nonce_gw and nonce_rtu together to construct the secret key enc_key of nonce_gw+nonce_rtu; a total of 32 bytes, 256 bits; Prepare data, construct data I frame, and use the secret key enc_key to encrypt ASDU with AES256, and send it to the gateway device; repeat until all required data has been sent; If a general call is received from the gateway device, the general call is sent here to complete the transmission.
6. The safe IEC104 protocol-based data acquisition method according to claim 1 is characterized in that: In step S5: Concatenate nonce_gw and nonce_rtu together to construct the decryption key dec_key of nonce_gw+nonce_rtu, a total of 32 bytes and 256 bits; If the terminal device is not configured with periodic upload or change upload, a general call command is sent to the terminal device to request terminal data; Receive the data I frame of the terminal device, use dec_key to decrypt the ASDU part of the received data frame using the AES256 algorithm to obtain the required data; repeat until all the required data is received.
7. A secure data acquisition system based on IEC104 protocol, characterized in that: include: Module M1: instructs the gateway device to generate and send an extended STARTDT request frame of the IEC104 protocol; Module M2: enables the terminal device to receive the STARTDT request frame from the gateway device, authenticate the gateway device, construct an authentication reply message, and send an extended STARTDT confirmation frame message to the gateway device; Module M3: After the gateway device receives the STARTDT confirmation frame from the terminal device, it verifies the correctness of the authentication reply information; Module M4: Instructs the terminal device to prepare data, construct a data I frame, and use the secret key to perform AES256 encryption on the ASDU and send it to the gateway device; Module M5: Instructs the gateway device to receive the data I frame from the terminal device, and uses the decryption key to decrypt the ASDU part of the received data frame to obtain the required data.
8. The secure IEC104 protocol-based data acquisition system according to claim 7, characterized in that: In the module M1: Obtain the public key PK of the terminal device through an offline or online secure channel; Generate and send the extended STARTDT request frame of the IEC104 protocol: the extended STARTDT request frame includes an 8-byte current UTC time stamp and a 16-byte random number, as well as an elliptic curve digital signature of timestamp_gw and nonce_gw using the private key SKgw of the gateway device; Specifically includes: 8 bytes of time stamp, 16 bytes of random number, 65 bytes of signature data and 33 bytes of public key; Among them, the 8-byte time stamp is UTC, marked as timestamp_gw, in milliseconds, and is used for timeliness judgment; The 16-byte random number is marked as nonce_gw; 65 bytes of signature data are digitally signed using the elliptic curve algorithm; The 33-byte public key is used to verify the elliptic curve public key of the digital signature; In the module M2: Obtain the public key PKgw of the gateway device through an offline or online secure channel; Receive the STARTDT request frame from the gateway device and verify the gateway device: Use the public key PKgw of the gateway device to verify the signature of the received random number nonce_gw using the elliptic curve digital signature verification algorithm to confirm that the timestamp timestamp_gw has not timed out; After verification, the authentication reply information is constructed, including the current timestamp_rtu and nonce_gw of the terminal device, the 16-byte random number nonce_rtu generated by the terminal device, and the signature generated by the elliptic curve digital signature algorithm on timestamp_rtu, nonce_gw and nonce_rtu using the terminal device private key SKrtu; Send an extended STARTDT confirmation frame message and a constructed authentication reply message to the gateway device; STARTDT confirmation frame extension: The extended STARTDT confirmation frame adds content to prove the identity of the confirmer after the original message: 8 bytes of time stamp, 16 bytes of random number, 65 bytes of signature data and 33 bytes of public key; Among them, the 8-byte time stamp UTC standard time is accurate to milliseconds and is used for timeliness judgment; 65 bytes of signature data are digitally signed using the elliptic curve algorithm; The 33-byte public key is used to verify the elliptic curve public key of the digital signature.
9. The secure IEC104 protocol-based data acquisition system according to claim 7, characterized in that: In the module M3: After receiving the STARTDT confirmation frame from the terminal device, verify the correctness of the authentication reply information: use the public key PKrtu of the terminal device to verify the timestamp_rtu, nonce_gw and the signature of nonce_rtu using the elliptic curve digital signature verification algorithm, check the timestamp, and compare the received nonce_gw with the sent nonce_gw for consistency; If the signature verification is passed and the sent and received nonce_gw are confirmed to be consistent and the time stamp has not timed out, the authentication is considered to be passed and the IEC104 data communication process begins. Otherwise, the subsequent data transmission process will not be started if it fails. In the module M4: IEC104 protocol information I frame message encryption adjustment: After the adjustment, all sensitive data, i.e., ASDU part, is encrypted; Concatenate nonce_gw and nonce_rtu together to construct the secret key enc_key of nonce_gw+nonce_rtu; a total of 32 bytes, 256 bits; Prepare data, construct data I frame, and use the secret key enc_key to encrypt ASDU with AES256, and send it to the gateway device; repeat until all required data has been sent; If a general call is received from the gateway device, the general call is sent here to complete the transmission.
10. The secure IEC104 protocol-based data acquisition system according to claim 7, characterized in that: In the module M5: Concatenate nonce_gw and nonce_rtu together to construct the decryption key dec_key of nonce_gw+nonce_rtu, a total of 32 bytes and 256 bits; If the terminal device is not configured with periodic upload or change upload, a general call command is sent to the terminal device to request terminal data; Receive the data I frame of the terminal device, use dec_key to decrypt the ASDU part of the received data frame using the AES256 algorithm to obtain the required data; repeat until all the required data is received.
