Network Working Group                    Internet Engineering Task Force
Internet-Draft                                      Telnet Working Group
                                                       D. Borman, Editor
                                                     Cray Research, Inc.
                                                              April 1993
Page 1

Telnet Authentication and Encryption Option

Status of this Memo

This document is an Internet Draft. Internet Drafts are working documents of the Internet Engineering Task Force (IETF), its Areas, and its Working Groups. Note that other groups may also distribute working documents as Internet Drafts.

Internet Drafts are draft documents valid for a maximum of six months. Internet Drafts may be updated, replaced, or obsoleted by other documents at any time. It is not appropriate to use Internet Drafts as reference material or to cite them other than as a "working draft" or "work in progress."

Please check the 1id-abstracts.txt listing contained in the internet-drafts Shadow Directories on nic.ddn.mil, nnsc.nsf.net, nic.nordu.net, ftp.nisc.sri.com, or munnari.oz.au to learn the current status of any Internet Draft.

1. Command Names and Codes

   AUTH_ENCRYPT            37
       Authentication Commands
       IS                       0
       SEND                     1
       REPLY                    2
       NAME                     3
       END_ENCRYPT              4
       REQUEST_END_ENCRYPT      5

Authentication Types

       NULL                     0
       KERBEROS_V4              1
       KERBEROS_V5              2
       SPX                      3
       RSA                      6
       LOKI                    10

Modifiers


Page 2

       AUTH_WHO_MASK        1
       AUTH_CLIENT_TO_SERVER    0
       AUTH_SERVER_TO_CLIENT    1

       AUTH_HOW_MASK        2
       AUTH_HOW_ONE_WAY         0
       AUTH_HOW_MUTUAL          2

       ENCRYPT_MASK         4
       ENCRYPT_OFF              0
       ENCRYPT_ON               4

       INI_CRED_FWD_MASK    8
       INI_CRED_FWD_OFF         0
       INI_CRED_FWD_ON          8

2. Command Meanings

This document makes reference to a "server" and a "client". For the purposes of this document, the "server" is the side of the connection that did the passive TCP open (TCP LISTEN state), and the "client" is the side of the connection that did the active open.

IAC WILL AUTH_ENCRYPT

The client side of the connection sends this command to indicate that it is willing to send and receive authentication information.

IAC DO AUTH_ENCRYPT

The servers side of the connection sends this command to indicate that it is willing to send and receive authentication information.

IAC WONT AUTH_ENCRYPT

The client side of the connection sends this command to indicate that it refuses to send or receive authentication information; the server side sends this command if it receives a DO AUTH_ENCRYPT command.

IAC DONT AUTH_ENCRYPT

The server side of the connection sends this command to indicate that it refuses to send or receive authentication information; the client side sends this command if it receives a WILL AUTH_ENCRYPT command.

IAC SB AUTH_ENCRYPT SEND authentication-type-pair-list IAC SE

The sender of this command (the server) requests that the remote


Page 3

side send authentication information for one of the authentication types listed in "authentication-type-pair-list". The
"authentication-type-pair-list" is an ordered list of
"authentication-type" pairs. Only the server side (DO AUTH_ENCRYPT) is allowed to send this.

IAC SB AUTH_ENCRYPT IS authentication-type-pair <auth data> IAC SE

The sender of this command (the client) is sending the authentica- tion information for authentication type "authentication-type- pair". Only the client side (WILL AUTH_ENCRYPT) is allowed to send this.

IAC SB AUTH_ENCRYPT REPLY authentication-type-pair <auth data> IAC SE

The sender of this command (the server) is sending a reply to the the authentication information received in a previous IS command. Only the server side (DO AUTH_ENCRYPT) is allowed to send this.

IAC SB AUTH_ENCRYPT NAME remote-user IAC SE

This optional command is sent to specify the account name on the remote host that the user wishes to be authorized to use. Note that authentication may succeed, and the authorization to use a particular account may still fail. Some authentication mechanisms may ignore this command.

IAC SB AUTH_ENCRYPT END_ENCRYPT IAC SE

The sender of this command is stating that at this point in the data stream, all following data will no longer be encrypted.

IAC SB AUTH_ENCRYPT REQUEST_END_ENCRYPT IAC SE

The sender of this command requests that the remote side stop en- cryption of the telnet data stream. This command is advisory only. See the "Implementation Rules" section for more details.

The "authentication-type-pair" is two octets, the first is the au- thentication type, and the second is a modifier to the type. There are currently three one bit fields defined in the modifier. Two of these are processed as a pair, the AUTH_WHO_MASK bit and the AUTH_HOW_MASK bit. There are four possible combinations of these two bits:

AUTH_CLIENT_TO_SERVER
AUTH_HOW_ONE_WAY

The client will send authentication information about the local


Page 4

user to the server. If the negotiation is successful, the server will have authenticated the user on the client side of the connection.

AUTH_SERVER_TO_CLIENT
AUTH_HOW_ONE_WAY

The server will authenticate itself to the client. If the negotiation is successful, the client will know that it is con- nected to the server that it wants to be connected to.

AUTH_CLIENT_TO_SERVER
AUTH_HOW_MUTUAL

The client will send authentication information about the local user to the server, and then the server will authenticate it- self to the client. If the negotiation is successful, the server will have authenticated the user on the client side of the connection, and the client will know that it is connected to the server that it wants to be connected to.

AUTH_SERVER_TO_CLIENT
AUTH_HOW_MUTUAL

The server will authenticate itself to the client, and then the client will authenticate itself to the server. If the negotia- tion is successful, the client will know that it is connected to the server that it wants to be connected to, and the server will know that the client is who it claims to be.

The third bit field in the modifier is the ENCRYPT_MASK bit. This bit is either set to ENCRYPT_ON or ENCRYPT_OFF. Setting this bit to ENCRYPT_ON implies that once authentication completes, the data stream is to be encrypted in both directions, using the encryption method specified for the authentication type.

The fourth bit field in the modifier is the INI_CRED_FWD_MASK bit. This bit is either set to INI_CRED_FWD_ON or INI_CRED_FWD_OFF. Setting this bit to INI_CRED_FWD_ON implies that once authentica- tion completes, the client will immediately forward authentication credentials to the server. This bit is set by the client to ad- vise the server to expect forwarded credentials from the client.

The motivation for this advisory bit is that the server may wish to wait until the forwarded credentials have been sent before starting any operating system specific login procedures which may depend on these credentials. Note that credentials forwarding may not be supported by all authentication mechanisms. It is a proto- col error to set this bit if the underlying authentication mechan- ism does not support credentials forwarding.


Page 5

3. Default Specification

The default specification for this option is

WONT AUTH_ENCRYPT
DONT AUTH_ENCRYPT

meaning there will not be any exchange of authentication or encryp- tion information.

4. Motivation

One of the deficiences of the Telnet protocol is that in order to log into remote systems, users have to type their passwords, which are passed in clear text through the network. If the connections goes through untrusted networks, there is the possibility that passwords will be compromised by someone watching the packets as they go by.

The purpose of the AUTH_ENCRYPT option is to provide a framework for the passing of authentication information through the TELNET session, and a mechanism to enable encryption of the data stream as a side ef- fect of successful authentication. This means that: 1) the users password will not be sent in clear text across the network, 2) if the front end telnet process has the appropriate authentication informa- tion, it can automatically send the information, and the user will not have to type any password. 3) once authentication has succeeded, the data stream can be encrypted to provide protection against active attacks.

It is intended that the AUTH_ENCRYPT option be general enough that it can be used to pass information for any authentication and encryption system.

5. Security Implications

The ability to negotiate a common authentication mechanism between client and server is a feature of the authentication option that should be used with caution. When the negotiation is performed, no authentication has yet occurred. Therefore each system has no way of knowing whether or not it is talking to the system it intends. An in- truder could attempt to negotiate the use of an authentication system which is either weak, or already compromised by the intruder.

By linking the enabling of encryption as a side effect of successful authentication, protection is provided against an active attacker. An active attack is one where the underlying TCP stream can be modi- fied or taken over by the active attacker. If encryption were en- abled as a separate negotiation, it would provide a window of vulner- ability from when the authentication completes, up to and including the negotiation to turn on encryption. It is because of this that,


Page 6

while there is a command to end encryption, there is not a command to restart encryption. The only safe way to restart encryption once it has been turned off, is to repeat the entire authentication processes.

6. Implementation Rules

WILL and DO are used only at the beginning of the connection to ob- tain and grant permission for future negotiations.

The authentication is only negotiated in one directions; the server must send the "DO", and the client must send the "WILL". This res- triction is due to the nature of authentication; there are three pos- sible cases; server authenticates client, client authenticates server, and server and client authenticate each other. By only nego- tiating the option in one direction, and then determining which of the three cases is being used via the suboption, potential ambiguity is removed. If the server receives a "DO", it must respond with a "WONT". If the client receives a "WILL", it must respond with a "DONT".

Once the two hosts have exchanged a DO and a WILL, the server is free to request authentication information. In the request, a list of supported authentication types is sent. Only the server may send re- quests ("IAC SB AUTH_ENCRYPT SEND authentication-type-pair-list IAC SE"). Only the client may transmit authentication information via the "IAC SB AUTH_ENCRYPT IS authentication-type ... IAC SE" command. Only the server may send replys ("IAC SB AUTH_ENCRYPT REPLY authentication-type ... IAC SE"). As many IS and REPLY suboptions may be exchanged as are needed for the particular authentication scheme chosen.

When determining a match from the authentication-type-pair-list re- ceived fromt the server, the client may ignore the AUTH_ENCRYPT_MASK bit. If the AUTH_ENCRYPT_MASK bit was ENCRYPT_OFF, then the client may only respond with ENCRYPT_OFF. If the AUTH_ENCRYPT_MASK bit was on, then the client may respond with either ENCRYPT_ON or ENCRYPT_OFF. In the latter case is the client is stating that it will do authentication, but it does not want to encrypt the data stream.

If the client does not support any of the authentication types listed in the authentication-type-pair-list, a type of NULL should be used to indicate this in the IS reply. Note that if the client turns of the ENCRYPT_ON bit or responds with a type of NULL, the server may choose to close the connection.

Encryption from the server to the client begins with the first byte immediatly following the "IAC SB AUTH_ENCRYPT REPLY ... IAC SE" com- mand that signifies that the server has successfully completed the


Page 7

authentication process. Encryption from the client to the server be- gins with the first byte immediatly following the "IAC SB AUTH_ENCRYPT RESPONSE ... IAC SE" command that signifies that the client has successfully completed the authentication process. Both of these will be specified in the document for the specific authenti- cation and encryption type. All data, including TELNET options, are encrypted.

The order of the authentication types MUST be ordered to indicate a preference for different authentication types, the first type being the most preferred, and the last type the least preferred.

When using END_ENCRYPT or REQUEST_END_ENCRYPT, care must be used. The normal scenario in which one would want to turn of encryption for performance reasons is when just the output stream from the server to the client is sent in the clear (which has the bulk of the data), and the input stream from the client to the server is left encrypted (so that typed passwords are not readable). The client would send a REQUEST_END_ENCRYPT command to the server, who would then send an END_ENCRYPT command and stop encrypting the output data stream. At this point, an active attacker could insert a REQUEST_END_ENCRYPT command in the output data stream to try and get the client to stop encrypting its input stream to the server. So, a REQUEST_END_ENCRYPT command should always be honored if received within an encrypted data stream, but should probably be ignored if received over a clear-text data stream. If you wish to disable all encryption, you should first send a REQUEST_END_ENCRYPT to get the other side to stop encrypting its data, and then send the END_ENCRYPT and stop encrypting your data stream.

7. User Interface

Normally protocol specifications do not address user interface specifications. However, due to the fact that the user will probably want to be able to specify the things about authentication and en- cryption and also know whether or not things succeeded, some guidance needs to be given to implementors to provide some minimum level of user control.

The user must be able to specify whether or not authentication is to be used, and whether or not encryption is to used if the authentica- tion succeeds. There should be at least four settings, REQUIRE, PROMPT, WARN and DISABLE. Setting the authentication switch to RE- QUIRE means that if the authentication fails, then an appropriate er- ror message must be displayed and the TELNET connection must be ter- minated. Setting the authentication switch to PROMPT means that if the authentication fails, then an appropriate error message must be displayed and the user must be prompted for confirmation before con- tinuing the TELNET session. Setting the authentication switch to WARN means that if the authentication fails, then an appropriate er-


Page 8

ror message must be displayed before continuing the TELNET session. Setting the authentication switch to DISABLE means that authentica- tion will not be attempted. The encryption switch should have the same settings as the authentication switch; however its settings are only used when authentication succeeds. The default setting for both switchs should be WARN. Both of these switchs may be implemented as a single switch, though having them seperate gives more control to the user.

8. Example

The following is an example of use of the option:

       Client                           Server
                                        IAC DO AUTH_ENCRYPT
       IAC WILL AUTH_ENCRYPT
       [ The server is now free to request authentication information.
         ]
                                        IAC SB AUTH_ENCRYPT SEND
                                        KERBEROS_V4 CLIENT|MUTUAL
                                        KERBEROS_V4 CLIENT|ONE_WAY IAC
                                        SE
       [ The server has requested mutual Kerberos authentication, but is
         willing to do just one-way Kerberos authentication.  The client
         will now respond with the name of the user that it wants to log
         in as, and the Kerberos ticket.  ]
       IAC SB AUTH_ENCRYPT NAME "joe"
       IAC SE
       IAC SB AUTH_ENCRYPT IS
       KERBEROS_V4 CLIENT|MUTUAL AUTH 4
       7 1 67 82 65 89 46 67 7 9 77 0
       48 24 49 244 109 240 50 208 43
       35 25 116 104 44 167 21 201 224
       229 145 20 2 244 213 220 33 134
       148 4 251 249 233 229 152 77 2
       109 130 231 33 146 190 248 1 9
       31 95 94 15 120 224 0 225 76 205
       70 136 245 190 199 147 155 13
       IAC SE
       [ The server responds with an ACCEPT command to state that the
         authentication was successful.  ]
                                        IAC SB AUTH_ENCRYPT REPLY
                                        KERBEROS_V4 CLIENT|MUTUAL ACCEPT
                                        IAC SE
       [ Next, the client sends across a CHALLENGE to verify that it is
         really talking to the right server.  ]
       IAC SB AUTH_ENCRYPT REPLY
       KERBEROS_V4 CLIENT|MUTUAL
       CHALLENGE xx xx xx xx xx xx xx
       xx IAC SE


Page 9

[ Lastly, the server sends across a RESPONSE to prove that it really is the right server.
IAC SB AUTH_ENCRYPT REPLY KERBEROS_V4 CLIENT|MUTUAL RESPONSE yy yy yy yy yy yy yy yy IAC SE

The following is an example of use of the option with encryption:

       Client                           Server
                                        IAC DO AUTH_ENCRYPT
       IAC WILL AUTH_ENCRYPT
       [ The server is now free to request authentication information.
         ]
                                        IAC SB AUTH_ENCRYPT SEND
                                        KERBEROS_V4
                                        ENCRYPT_ON|CLIENT|MUTUAL
                                        KERBEROS_V4
                                        ENCRYPT_ON|CLIENT|ONE_WAY IAC SE
       [ The server has requested mutual Kerberos authentication, but is
         willing to do just one-way Kerberos authentication.  In both
         cases it is willing to encrypt the data stream.  The client
         will now respond with the name of the user that it wants to log
         in as, and the Kerberos ticket.  ]
       IAC SB AUTH_ENCRYPT NAME "joe"
       IAC SE
       IAC SB AUTH_ENCRYPT IS
       KERBEROS_V4
       ENCRYPT_ON|CLIENT|MUTUAL AUTH 4
       7 1 67 82 65 89 46 67 7 9 77 0
       48 24 49 244 109 240 50 208 43
       35 25 116 104 44 167 21 201 224
       229 145 20 2 244 213 220 33 134
       148 4 251 249 233 229 152 77 2
       109 130 231 33 146 190 248 1 9
       31 95 94 15 120 224 0 225 76 205
       70 136 245 190 199 147 155 13
       IAC SE
       [ The server responds with an ACCEPT command to state that the
         authentication was successful.  ]
                                        IAC SB AUTH_ENCRYPT REPLY
                                        KERBEROS_V4
                                        CLIENT|MUTUAL|ENCRYPT_ON ACCEPT
                                        IAC SE
       [ Next, the client sends across a CHALLENGE to verify that it is
         really talking to the right server.  ]
       IAC SB AUTH_ENCRYPT REPLY
       KERBEROS_V4 CLIENT|MUTUAL
       CHALLENGE xx xx xx xx xx xx xx
       xx IAC SE


Page 10

[ At this point, the client begins to encrypt the outgoing data stream, and the server, after receiving this command, begins to decrypt the incoming data stream. Lastly, the server sends across a RESPONSE to prove that it really is the right server. ]
IAC SB AUTH_ENCRYPT REPLY KERBEROS_V4 CLIENT|MUTUAL RESPONSE yy yy yy yy yy yy yy yy IAC SE
[ At this point, the server begins to encrypt its outgoing data stream, and the client, after receiving this command, begins to decrypt its incoming data stream. ]

It is expected that any implementation that supports the Telnet AUTH_ENCRYPT option will support all of this specification.

9. References

[1] Reynolds, Joyce, and Postel, Jon, "Assigned Numbers", RFC 1060, ISI, March 1990

Author's Address

David A. Borman, Editor
Cray Research, Inc.
655F Lone Oak Drive
Eagan, MN 55123

Phone: (612) 452-6650

Mailing List: telnet-ietf@CRAY.COM
EMail: dab@CRAY.COM

Chair's Address

The working group can be contacted via the current chair:

Steve Alexander
INTERACTIVE Systems Corporation
1901 North Naper Boulevard
Naperville, IL 60563-8895

Phone: (708) 505-9100 x256
EMail: stevea@isc.com