RFC 2949

Telnet Encryption: CAST-128 64 bit Output Feedback

๐Ÿ“… published September 2000, from ietf

RFC 2949: Telnet Encryption, CAST-128 64 bit Output Feedback โœจ

Author: Jeffrey Altman (J. Altman) of Columbia University ๐ŸŽ“ Category: Standards Track ๐ŸŒŸ Date: September 2000 ๐Ÿ“… Obsoletes/Updates: The title block doesn't list anything it obsoletes or updates ๐Ÿฆ‹

This is the spec for using CAST-128 in output feedback (OFB) mode with the telnet encryption option, which is basically how telnet sessions get scrambled ๐Ÿ”

Status of this Memo ๐Ÿ“

This doc is an Internet standards track protocol for the Internet community, and it's asking for discussion and suggestions for improvements ๐Ÿ’ฌ For the current standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1) ๐Ÿ“š Distribution of this memo is unlimited ๐ŸŒ

Copyright (C) The Internet Society (2000). All Rights Reserved. ๐Ÿ’œ

Abstract ๐ŸŒธ

Okay so this doc explains how to use the CAST-128 encryption algorithm in output feedback mode with the telnet encryption option ๐ŸŽ€ There are two key sizes defined: 40 bit and 128 bit ๐Ÿ”‘

1. Command Names and Codes ๐Ÿ“

Here are the encryption types and suboption commands, all lined up cute ๐Ÿ’…

Encryption Type

   CAST5_40_OFB64   9
   CAST128_OFB64   11

Suboption Commands

   OFB64_IV         1
   OFB64_IV_OK      2
   OFB64_IV_BAD     3

2. Command Meanings ๐Ÿฆ‹

Here's the vibe for each command. The side that does the sending is the one who generates a random 8 byte initial vector โœจ It then sends that IV to the other side using the OFB64_IV command. The IV goes over in clear text, no hiding it ๐Ÿ‘€ Only the side that is WILL ENCRYPT is allowed to send OFB64_IV โœ…

IAC SB ENCRYPT IS CAST5_40_OFB64 OFB64_IV <initial vector> IAC SE
IAC SB ENCRYPT IS CAST128_OFB64 OFB64_IV <initial vector> IAC SE
IAC SB ENCRYPT REPLY CAST5_40_OFB64 OFB64_IV_OK IAC SE
IAC SB ENCRYPT REPLY CAST128_OFB64 OFB64_IV_OK IAC SE
IAC SB ENCRYPT REPLY CAST5_40_OFB64 OFB64_IV_BAD IAC SE
IAC SB ENCRYPT REPLY CAST128_OFB64 OFB64_IV_BAD IAC SE

These are the replies. The sender either accepts or rejects the IV it got in an OFB64_IV command ๐Ÿ™Œ Only the side that is DO ENCRYPT can send OFB64_IV_OK and OFB64_IV_BAD ๐Ÿ’โ€โ™€๏ธ OFB64_IV_OK MUST be sent for backwards compatibility with existing implementations, bestie, no exceptions ๐Ÿซถ As for OFB64_IV_BAD, there really isn't any reason to send it except in a protocol violation where the IV wasn't the correct length (that's 8 bytes) ๐Ÿ˜ญ

3. Implementation Rules ๐Ÿ“œ

Once an OFB64_IV_OK command has been received, the WILL ENCRYPT side should do keyid negotiation using the ENC_KEYID command ๐Ÿ” After keyid negotiation successfully identifies a common keyid, the WILL ENCRYPT side may send START and END commands ๐Ÿšฆ Data then gets encrypted with the CAST128 64 bit Output Feedback algorithm ๐Ÿ”

If encryption (decryption) is turned off and then back on again, and the same keyid is used to restart it, the clear text that went through in between must not change the state of the encryption (decryption) machine ๐Ÿ™…โ€โ™€๏ธ

If a START command is sent (received) with a different keyid, the encryption (decryption) machine must be re-initialized right after the END of the START command, using the new key and the initial vector sent (received) in the last OFB64_IV command ๐Ÿ”„

If a new OFB64_IV command is sent (received) and encryption (decryption) is enabled, the machine must be re-initialized right after the end of the OFB64_IV command, using the new initial vector and the keyid sent (received) in the last START command ๐Ÿ’ซ

If encryption (decryption) is not enabled when an OFB64_IV command is sent (received), the machine must be re-initialized after the next START command, using the keyid sent (received) in that START command and the initial vector sent (received) in this OFB64_IV command ๐Ÿงš

4. Algorithm ๐Ÿงฎ

This is the CAST 64 bit Output Feedback diagram, so you can see the whole loop ๐Ÿ‘‘

CAST 64 bit Output Feedback

   key --->+------+
        +->| CAST |--+
        |  +------+  |
        +------------+
                     v
    INPUT --------->(+) ----> DATA

Here's what the letters mean. iV is the initial vector, 64 bits (8 bytes) long ๐ŸŒˆ Dn is the nth chunk of 64 bits (8 bytes) of data to encrypt (decrypt) ๐ŸŽ On is the nth chunk of 64 bits (8 bytes) of encrypted (decrypted) output ๐Ÿญ

    V0 = CAST(iV, key)
    V(n+1) = CAST(Vn, key)
    On = Dn ^ Vn

5. Integration with the AUTHENTICATION telnet option ๐Ÿ”—

As the telnet ENCRYPTION option specs note, a keyid value of zero means the default encryption key, which might be derived from the telnet AUTHENTICATION option ๐Ÿ—๏ธ If that default key negotiated through the telnet AUTHENTICATION option has less than 16 (5) bytes, then CAST128_OFB64 (CAST5_40_OFB64) must not be offered or used as a valid telnet encryption option ๐Ÿšซ

If there are less than 32 (10) bytes of key data, the first 16 (5) bytes are used as keyid 0 in each direction ๐Ÿ’• If there are at least 32 (10) bytes of key data, the first 16 (5) bytes encrypt the data the telnet client sends to the telnet server, and the second 16 (5) bytes encrypt the data the telnet server sends to the telnet client ๐Ÿฅน

Any extra key data is used as random data to be sent as an initialization vector ๐ŸŽฒ

6. Security Considerations ๐Ÿšจ

Okay bestie, this section is SERIOUS ๐Ÿ˜ญ Please read it all ๐Ÿ’€

Encryption using Output Feedback does NOT ensure data integrity ๐Ÿ’” An active attacker may be able to substitute text, if they can predict the clear text being transmitted ๐Ÿ‘ป

The tradeoff is that adding a message authentication code (MAC) would significantly increase the number of bytes needed to send a single character in telnet, which hurts performance on slow (i.e. dialup) links ๐Ÿข

This option was originally drafted back when CPU speeds weren't necessarily fast enough to allow use of CFB โณ CPUs have gotten way faster since then ๐ŸŽ๏ธ Given the inherent weaknesses in Output Feedback mode, maybe it should be deprecated in favor of CFB modes? ๐Ÿค”

Encryption modes using 40-bit keys are NOT to be considered secure ๐Ÿ™ˆ The 40 bit key mode CAST5_40_OFB64 is only listed here to document implementations that are already prevalent on the Internet but have never been documented ๐Ÿ“–

7. Acknowledgments ๐Ÿซถ

This document was based on the "Telnet Encryption: DES 64 bit Output Feedback" document originally written by Dave Borman of Cray Research, with help from the IETF Telnet Working Group ๐ŸŒท

8. References ๐Ÿ“š

[1] Adams, C., "The CAST-128 Encryption Algorithm", RFC 2144, May
    1997.

Author's Address ๐Ÿ“ฎ

Jeffrey Altman, Editor Columbia University 612 West 115th Street Room 716 New York NY 10025 USA

Phone: +1 (212) 854-1344 EMail: jaltman@columbia.edu

Copyright (C) The Internet Society (2000). All Rights Reserved. ๐Ÿ’–

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. ๐ŸŒ

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. โ™พ๏ธ

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ๐Ÿซ 

Acknowledgement ๐ŸŽ€

Funding for the RFC Editor function is currently provided by the Internet Society ๐Ÿ’…

๐Ÿ“ฆ where this page comes from