Dnp3 Specification: Volume 2, Supplement 1 Secure Authentication
Dnp3 Specification: Volume 2, Supplement 1 Secure Authentication
Volume 2, Supplement 1
SECURE AUTHENTICATION
Version 1.00
3 February 2007
DISCLAIMER STATEMENT
DNP Users Group documents and publications are not consensus documents. Information contained in
this and other works has been obtained from sources believed to be reliable, and reviewed by credible
members of the DNP Users Group and/or the DNP Users Group Technical Committee. Neither the DNP
Users Group nor any authors/developers of DNP documentation guarantee, and each such person
expressly disclaims responsibility for ensuring, the accuracy or completeness of any information
published herein, and neither the DNP Users Group nor its authors/developers shall be responsible for any
errors, omissions, or damages arising out of use of this document.
Likewise, while the author/developer and publisher believe that the information and guidance given in
this work serves as an enhancement to users, all parties must rely upon their own skill and judgment when
making use of it. Neither the author nor the publisher assumes any liability to anyone for any loss or
damage caused by any error or omission in the work, whether such error or omission is the result of
negligence or any other cause. Any and all such liability is disclaimed.
This statement was developed by the DNP Users Group Technical Committee and represents the
considered judgment of a group of software developers with expertise in the subject field. The DNP Users
Group is a global forum for users and implementers of the protocol and promotes implementers and
developer information and interaction exchange. This work is published with the understanding that the
DNP Users Group and its authors/developers are supplying information through this publication, not
attempting to render engineering or other professional services. If such services are required, the
assistance of an appropriate professional should be sought. The DNP Users Group is not responsible for
any statements and/or opinions advanced in this publication.
TRADEMARK NOTICES
DNP is a trademark of the DNP Users Group. Any brand and product names mentioned in this document
are trademarks or registered trademarks of their respective companies.
Copyright © 1991 – 2007 DNP Users Group. All rights reserved
1.1 Purpose
The purpose of this specification is to define a protocol mechanism that:
• A DNP3 outstation can use to unambiguously determine it is communicating with a user who is
authorized to access the services of the outstation.
• A DNP3 master can use to unambiguously determine that it is communicating with the correct
outstation.
1.2 References
This specification is fundamentally based on IEC 62351-5 and is intended to be compliant with that
specification as well as selected portions of ISO/IEC 9798-4. If there are disagreements between this
specification and those references, this specification shall be considered to be correct.
Number Title
IEC 62351-3 Data and Communications Security– Part 3: Communication Network and System
Security - Profiles Including TCP/IP
IEC 62351-5 Data and Communications Security – Part 5: Security for IEC 60870-5 and
derivatives
FIPS 186-2 Digital Signature Standard (DSS), USA NIST, February 2000 including Change
Notice #1, October 2001. Only the random number generation algorithms in the
appendix are used.
This specification addresses authentication only, not encryption or other security measures. It does not rule out the
possibility of such measures being added to DNP3 later or through the use of external measures such as “bump in
the wire” link encryptors.
This specification describes authentication at the application layer. Application layer authentication is necessary
because:
• DNP3 must be used over a variety of different physical networks and may be “bridged” from one to the
other, as in the case of a TCP/IP terminal server or IP radio. Only authentication at the application layer
will ensure end-to-end security.
• Application layer authentication permits the possibility of protection against “rogue applications” that may
be co-resident with the DNP3 application and attempt to use the DNP3 link without authorization.
• Application layer authentication permits the possibility of authenticating individual users, as discussed in
section 1.4.9.
1.4.3 Bi-directional
This specification describes a mechanism that can be used in either transmission direction, master-to-outstation
(controlling direction) or outstation-to-master (monitoring direction).
1.4.4 Challenge-Response
The mechanism described in this specification is based on the concept of challenge and response. This principle has
been applied for the following reasons:
• It places the responsibility for security on the device that requires authentication, which is more practical in a
diverse network such as those found in the utility industry.
• It permits some communication to be left unsecured if desired, reducing bandwidth and processing
requirements.
This specification permits pre-shared keys to be used by default. This principle recognizes the fact that many
utilities may choose not to manage security credentials in a more sophisticated manner but nevertheless require
some level of protection.
This specification does not prevent the use of public-key cryptography mechanisms to be used to change or
distribute the pre-shared keys described here. Future specifications may standardize such methods, but they are
currently out of the scope of this specification.
This specification recommends that the following conditions be satisfied when a secure device (one implementing
this authentication mechanism) communicates with a non-secure device:
• The secure device must be able to detect that the non-secure device does not support the authentication
mechanism.
• The non-secure device must continue to operate normally after being contacted by the secure device. In other
words, the authentication message cannot cause the non-secure device to fail.
• The two devices must be able to continue to exchange information that is not considered critical.
However, the mechanism’s ability to meet these conditions is largely dependent on the quality of the implementation
on any particular device. This specification therefore recommends that secure devices avoid sending security
messages if it is not known whether the remote device supports security.
1.4.7 Upgradeable
This specification permits system administrators to change algorithms, key lengths, and other security parameters to
deal with future requirements. In keeping with the principle of backward tolerance, it also permits one end of a link
to be upgraded at a time.
This specification follows the security principle of perfect forward secrecy, as defined in IEC 62351 Part 2. If a
session key is compromised, this mechanism only puts data from that particular session at risk, and does not permit
an attacker to authenticate data in future sessions.
This specification assumes that there may be multiple users of the system located at the site of the master. It
provides a method to authenticate each of the users separately from each other and from the master itself.
The intent of this principle is to permit the outstation to conclusively identify the individual user (not just the device)
that transmits any protocol message. This information can be used in audit logs for non-repudiation purposes,
although such use is out of the scope of this specification.
This specification allows for the possibility that outstations may limit access to certain functions, either based on the
individual identities of users, or based on the “roles” the users perform. However, it does not specify a mechanism
for defining such user-based or role-based access control.
ASDU Application Service Data Unit. The data presented by the application layer to lower layers
for transmission. Equivalent to a DNP3 application layer fragment.
The following terms are inherited from the IEC 60870-5 specifications:
The following terms are described here because they are specific to this authentication mechanism:
Challenger A station that issues authentication challenges. May be either a master or outstation.
Responder A station that responds or reacts to authentication challenges. May be either a master or
outstation.
Message A block of data that is part of the authentication mechanism. It will be expressed by some
combination of DNP3 objects, function codes, qualifiers, etc.
The device (either master or outstation) that receives the challenge must respond before communications can
continue.
The responder performs the HMAC algorithm specified in the challenge message to produce the response. A shared
Session Key known to both devices is an integral part of the computation. The following types of information are
included in the computation:
• A number specifying the user on the Master side is included.
• The challenge data is included, to protect against replay attacks.
• If the challenger is protecting a specific critical ASDU, data from that ASDU is also included in the
computation. This protects against modification of the ASDU by an attacker.
The response includes the resulting HMAC value.
2.1.4 Authenticating
Upon receiving the response, the challenger performs the same calculation on the same data used by the responder.
If the results match, the challenger permits communications to continue. If the challenger was protecting a particular
ASDU, it processes the ASDU.
If the authentication fails, the challenger shall not perform the requested operation. The challenger may then choose
to transmit an error message. To help protect against denial-of-service attacks and attackers learning from repeated
challenges, the challenger shall cease to transmit error messages after a configurable number of failures.
To reduce bandwidth usage, a responder attempting a critical operation may optionally “anticipate” the challenge
and send the HMAC Value in the same ASDU being protected. This eliminates the challenge and response
messages. Aggressive mode provides a lower level of security, because not as much data is changing in each
message.
For this reason, aggressive mode is optional in IEC 62351-5. However, the value of aggressive mode is considered
high enough for DNP3 that all DNP3 implementations of this authentication mechanism are required to support it.
Per IEC 62351-5, however, all DNP3 implementations are also required to permit it to be disabled by configuration,
so that individual projects can use only challenge and response if they choose.
Aggressive mode is a “unilateral, one-pass authentication” mechanism as described in ISO/IEC 9798-4. However, it
is somewhat more secure against replay attacks than the mechanism described there, because the Aggressive Mode
Request includes information from the most recently received challenge in addition to the sequence number required
by ISO/IEC 9798-4.
Table 1 summarizes how cryptographic keys are used and updated in this authentication mechanism.
Table 1 – Summary of Keys Used
This section contains diagrams illustrating examples of how the authentication mechanism shall behave. This section
is informative only. Refer to section 3 for a formal description of the mechanism. Bold arrows in these diagrams
represent authentication-specific messages.
Figure 1and Figure 2 illustrate the challenge and response to a Critical ASDU.
Figure 3 and Figure 4 illustrate a periodic challenge not related to a Critical ASDU.
Figure 5 and Figure 6 illustrate authentication of a Critical ASDU using Aggressive Mode.
Responder Challenger
Non-Critical ASDU
Authenticate
Figure 7 and Figure 8 illustrate how the master initializes and changes the Session Keys on startup, periodically, and
after a link failure.
Rx Valid
Rx Invalid Rx Critical Rx Aggressive
Key Status Response /
Key Status <> OK, OR Response / ASDU OR Mode Request /
Timeout / Tx normal
Response Timeout / Tx Error & Challenge
Tx Key protocol Treat like
Tx Key Status Req Increment Timeout / challenge and
Status Req Wait for Error Count Tx Challenge immediate
Key
response
Status
Response Timeout /
Tx Key Tx Key Change
Status Req
Security
Wait for Key
Idle
Change Rx Non-
Init Confirmation Critical
Rx Key Status / ASDU /
Tx Key Change Tx normal
Rx Key Status = OK / protocol
Mark next ASDU critical Rx Challenge /
Tx Response
DNP3 masters shall implement the authentication mechanism using the function codes and objects described in
Table 2. The first column of the table shows how these function codes and objects correspond to the IEC 62351-5
specification and the state machines in section 3.2.
Table 2 – DNP3 Master Messages with Correlation to IEC 62351-5
IEC 62351-5 Description DNP3 Function DNP3 object
Message Code(s)
Challenge Requires authentication of the 0x20 Authentication Group 120, Variation 1 (g120v1)
Message previous DNP3 Response or Request Authentication Challenge object
Unsolicited Response
Response Provides authentication of the 0x21 Authentication Group 120, Variation 2 (g120v2)
Message previous DNP3 Request as required Reply Authentication Reply object
by the outstation
Aggressive Provides authentication for the Whatever function Group 120, Variation 3 (g120v3)
Mode Request current DNP3 Request code is in the DNP3 Authentication Aggressive Mode
Message Request. Request object
Key Status Requests from the outstation the 0x01 Read Group 120, Variation 4 (g120v4)
Request current status of the Session Keys. Session Key Status Request object
Message
Key Change Changes the symmetric Session 0x02 Write Group 120, Variation 6 (g120v6)
Message Keys subsequently used by master Session Key object
and outstation for authentication.
Error Message Indicates the authentication Ox22 Authentication Group 120, Variation 7 (g120v7)
provided in the previous DNP3 Error Authentication Error object
Response was incorrect
The function codes specific to the authentication mechanism are defined in the following sections:
3.1.1.4 Use of the Write (0x02) Function Code to Change Session Keys
The master shall use the Write function code to change the Session Keys using the Session Key object. The DNP3
response shall include a Session Key Status object. Rules are applied as in section 3.2.
3.1.1.5 Use of the Read (0x01) Function Code to Request Key Status
The master shall use the Read function code to read the current status of the Session Keys as understood by the
outstation. The DNP3 request message contains only the Session Key Status Request object. The outstation
transmits a response containing a Session Key Status object. Rules are applied as in section 3.2.
DNP3 outstations shall implement the authentication mechanism using the function codes, objects, and Internal
Indications described in Table 3. The first column shows how they correspond to the IEC 62351-5 specification and
the state machines in section 3.2 Note that the Challenge Message has the Parameter Error internal indication bit set.
The outstation sets this bit so that a non-secure device receiving the message will receive notice that the previous
Request sent by the master was not accepted.
The function codes specific to the authentication mechanism are defined in the following sections:
Figure 11 illustrates several of the messages described in the preceding sections as part of a typical
initialization sequence, immediately following initialization of the session keys by the master. The
outstation generates an unsolicited response to notify the master that it has restarted. The master
authenticates this message before supplying a confirmation. The confirmation is not authenticated, but the
outstation requires authentication of the Write operation.
Master Outstation
0x81Unsolicited Response
(no data – RESTART IIN set)
0x81 Response
g120v2 Authentication Reply Object
Authenticate
0x00 Confirm
Process
0x02 Write Confirm
g80v1 Internal Indication (clear RESTART)
Authenticate
Clear
RESTART IIN
Figure 13 illustrates how a master an outstation would perform a Select-Operate sequence using
Aggressive Mode.
Master Outstation
0x03 Select
g12v1 Control Relay Output Block
g120v3 Aggressive Mode Request
Authenticate
0x81 Response
g12v1 Control Relay Output Block
Process
Select
0x04 Operate
g12v1 Control Relay Output Block
g120v3 Aggressive Mode Request
Rx Key Status <> OK The outstation has transmitted a Key Status Transmit a Key Change Wait for Key Transmit a Key Status Request message. Wait for Key
message with the Key Status set to a value message. Start the Change Start the Response Timer. Status.
other than <1> OK. Response Timer. Confirmation
Rx Key Status = OK The outstation has transmitted a Key Status Transmit a Key Change Wait for Key Set internal flag indicating that the next Security Idle
message with the Key Status set to <1> message. Start the Change ASDU to be received will be considered
OK. Response Timer. Confirmation Critical.
Start the Key Change timer and reset the
Key Change counter.
Key Change Timeout Either the Key Change Timer has expired Transmit a Key Status Wait for Key Status Transmit a Key Status Request message. Wait for Key Status
OR on the master, or the number of transmitted Request message. Start Start the Response Timer.
or received protocol messages has the Response Timer.
Response Timeout exceeded the Message Count Threshold, or
the Response Timer has expired.
Rx Challenge message The master has transmitted a Challenge If the Maximum Error Wait for Key Status If the Maximum Error Count has not been Wait for Key
message or Aggressive Mode Request Count has not been exceeded, transmit an Error Message with Change
message even though the Session Keys exceeded, transmit an reason <1> Authentication failed Confirmation
are not yet valid. Error Message with reason
<1> Authentication Failed
Expected The controlled station has not Set Key Status = NOT INIT Wait for Key Change
Session Key received a valid Key Change Invalidate current session keys.
Timeout message within twice the
interval or count configured at
the controlling station.
Each DNP3 authentication Challenge, Response or Error message shall have the same DNP3 application
sequence number as the critical DNP3 fragment that was challenged.
Figure 15 illustrates how this rule would be applied for a Select/Operate control sequence using challenge
and response. DNP3 application sequence numbers are shown in parentheses. Figure 16 illustrates that
when Aggressive Mode is used, the sequence numbering is identical to normal non-authenticated DNP3.
When a device initiates a periodic challenge, it shall increment the DNP3 application sequence number
according to the normal rules of DNP3. Unless it is challenging a critical DNP3 function, the device shall
not interrupt a DNP3 exchange, even if the Challenge Timer expires in the middle of a non-critical DNP3
exchange. Figure 17 illustrates this rule.
(8) Select
Authenticate
(9) Operate
Authenticate
Master Outstation
Master Outstation
Challenge (5) Event poll
Timer
Expires
(5) Event Poll response
Authenticate
Each device shall implement the HMAC algorithms listed in this section.
4.1.1.1 HMAC-SHA1
Each device shall permit the use of HMAC-SHA1, as described in the references in section 1.2 to calculate the
HMAC Value. The HMAC Value shall be the 160 bits (20 octets) output of the HMAC algorithm, truncated to
either the leftmost 4 octets or the leftmost 8 octets. If this specification is used over TCP/IP, the truncated value shall
be 8 octets. If it is used over serial links, the truncated value shall be 4 octets.
This shall be the default HMAC algorithm.
Each device shall implement key wrap algorithms as described in this section.
Each device shall fix the following parameters to comply with this specification:
Each device shall permit changes to the parameters described in this section. Changes to these parameters shall be
permanently retained over restarts of the device.
Each device may implement additional HMAC algorithms in addition to those listed as mandatory. If the device
receives an Error message with the Error Code <5> HMAC algorithm Not Permitted, it shall change to use a
mandatory HMAC algorithm in its next Challenge. A device may be configured to reject particular mandatory
HMAC algorithms, but it must also support configuration to support all the mandatory HMAC algorithms.
4.2.1.1 HMAC-SHA256
It is recommended that devices permit the use of HMAC-SHA256, as described in the references in section 1.2, to
calculate the HMAC Value. The HMAC Value shall be the 256 bits (32 octets) output of the HMAC algorithm,
truncated to either the leftmost 8 octets or the leftmost 16 octets. When this authentication mechanism is used over
TCP/IP, the truncated value shall be 16 octets. On serial implementations, it shall be 8 octets.
Each device may implement additional Key Wrap algorithms in addition to those listed as mandatory. If the device
receives an Error message with the Error Code <6> Encryption Algorithm Not Permitted, it shall change to use a
mandatory Encryption Algorithm in its next Challenge. A device may be configured to reject particular mandatory
encryption algorithms, but it must also support configuration to support all the mandatory encryption algorithms.
Figure 18 illustrates an example of a typical system making use of a DNP3 data concentrator. A data
concentrator does not pass DNP3 messages through itself intact, as a router or bridge does. Instead, a data
concentrator terminates multiple connections of DNP3 or other protocols and stores the data from each
direction in an internal run-time database. This permits the concentrator to filter the data, process it within
internal software applications, or convert it into other protocols.
When a data concentrator makes use of DNP3 secure authentication, it shall follow the general rule that
whenever it can distinguish the particular user who initiated an operation, it shall identify that user to
downstream outstations. This rule is intended to deter repudiation by permitting concentrators or
outstations to log which user initiated critical DNP3 operations. The following rules shall apply as
clarifications of that rule:
1. The data concentrator shall identify each user having a DNP3 User Number (USR) on the
upstream side with a separate DNP3 User Number on the downstream side. For instance, in
Figure 18, Alice and Bob have User Numbers on both the upstream DNP3 link used by process
“A” and the downstream DNP3 links used by process “C”.
2. If an upstream protocol cannot distinguish individual users, the data concentrator shall identify
each upstream protocol connection with a separate User Number on the downstream side. For
instance, process “B” cannot distinguish whether protocol commands are initiated by Charlie or
Donald. Therefore the data concentrator uses a single User Number on the downstream DNP3
link used by process “C” to represent all users on Master 2.
3. The data concentrator shall identify local users and applications with separate User Numbers on
the downstream side. For instance, local application “E” has its own User Number on the
downstream DNP3 link. If the data concentrator had a local user interface capable of
distinguishing different local users, it would identify each of these local users with a different
User Number on the downstream DNP3 link.
4. User Numbers shall be unique within an outstation. User Numbers need not be sequential, but
each User Number must uniquely identify a user of an outstation, and a unique Update Key and a
set of Session Keys to be associated with that user. Note, however, that because the maximum
User Number is 255 and 0 is reserved, an outstation may only have 255 users that access it
through a given data concentrator. If more than 255 users of one outstation are required, use of
multiple DNP3 addresses and logical devices by the outstation is recommended. In addition, the
data concentrator is an outstation with respect to an upstream master, and it has the same 255-
user limitation with the master.
5. The User Number used to identify a user on any given link may be different than that used on any
other link. For instance, Alice’s User Number on the upstream DNP3 link is 7, but her User
Number on the link between the data concentrator and Outstation 3 is 22. She may have a
different User Number on the link with Outstation 1.
6. If no points are mapped between an upstream or local user and a downstream outstation, the
data concentrator need not map User Numbers either. The Figure 18 illustrates that all the users
identified in the diagram have the potential to make use of Outstation 3. However, not all users
may have the potential to access Outstation 1, for instance, and therefore Outstation 1 may not
have any User Numbers to distinguish them.
7. When upstream or local users initiate critical DNP3 requests that are passed through to
downstream outstations, the data concentrator shall correctly identify the user making the
request. If Alice initiates a binary output operation on a point that is mapped to Outstation 3, the
data concentrator first authenticates the request with Master 1 using Alice’s upstream User
Number (7). Next, the data concentrator issues the corresponding binary output operation to
Outstation 3, and it uses Alice’s downstream User Number (22) when Oustation 3 requests the
data concentrator to authenticate that request. Similarly, if the local automation process initiates a
Freeze and Clear on several counters and Outstation 3 considers it a critical operation, the data
concentrator shall authenticate the request with Outstation 3 specifying User Number 112.
• A list of any and all encryption algorithms supported by the device addition to the mandatory algorithms
identified in IEC 62351-5.