RFC 2949
Telnet Encryption: CAST-128 64 bit Output Feedback
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 Notice ยฉ๏ธ
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
Full Copyright Statement ยฉ๏ธ
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
- ietf: rfc2949 2000-09
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms