home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / e / id-cc-00.txt < prev    next >
Text File  |  2020-01-01  |  9KB  |  196 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. Network Working Group                                     Jeffrey Altman
  7. Internet-Draft                                       Columbia University
  8. draft-altman-telnet-enc-cast128-cfb-00.txt                 February 1999
  9.  
  10.  
  11.              Telnet Encryption: CAST-128 64 bit Cipher Feedback
  12.  
  13. Status of this Memo
  14.  
  15.  
  16.    This document is an Internet-Draft and is in full conformance with
  17.    all provisions of Section 10 of RFC2026.  Internet-Drafts are working
  18.    documents of the Internet Engineering Task Force (IETF), its areas,
  19.    and its working groups.  Note that other groups may also distribute
  20.    working documents as Internet-Drafts.
  21.  
  22.    Internet-Drafts are draft documents valid for a maximum of six months
  23.    and may be updated, replaced, or obsoleted by other documents at any
  24.    time.  It is inappropriate to use Internet-Drafts as reference
  25.    material or to cite them other than as "work in progress."
  26.  
  27.    The list of current Internet-Drafts can be accessed at
  28.    http://www.ietf.org/ietf/1id-abstracts.txt
  29.  
  30.    The list of Internet-Draft Shadow Directories can be accessed at
  31.    http://www.ietf.org/shadow.html.
  32.  
  33.    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  34.    "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  35.    document are to be interpreted as described in RFC 2119.
  36.  
  37. Abstract
  38.  
  39.    This document specifies how to use the CAST-128 encryption algorithm
  40.    in cipher feedback mode with the telnet encryption option.  Two key
  41.    sizes are defined: 40 bit and 128 bit.
  42.  
  43. 1.  Command Names and Codes
  44.  
  45.    Encryption Type
  46.  
  47.       CAST5_40_CFB64   8
  48.       CAST128_CFB64   10
  49.  
  50.    Suboption Commands
  51.  
  52.       CFB64_IV         1
  53.       CFB64_IV_OK      2
  54.       CFB64_IV_BAD     3
  55.  
  56.  
  57. 2.  Command Meanings
  58.  
  59.    IAC SB ENCRYPT IS CAST5_40_CFB64 CFB64_IV <initial vector> IAC SE
  60.    IAC SB ENCRYPT IS CAST128_CFB64 CFB64_IV <initial vector> IAC SE
  61.  
  62.       The sender of this command generates a random 8 byte initial vec-
  63.       tor, and sends it to the other side of the connection using the
  64.       CFB64_IV command.  The initial vector is sent in clear text.  Only
  65.       the side of the connection that is WILL ENCRYPT may send the
  66.       CFB64_IV command.
  67.  
  68.    IAC SB ENCRYPT REPLY CAST5_40_CFB64 CFB64_IV_OK IAC SE
  69.    IAC SB ENCRYPT REPLY CAST128_CFB64 CFB64_IV_OK IAC SE
  70.    IAC SB ENCRYPT REPLY CAST5_40_CFB64 CFB64_IV_BAD IAC SE
  71.    IAC SB ENCRYPT REPLY CAST128_CFB64 CFB64_IV_BAD IAC SE
  72.  
  73.       The sender of these commands either accepts or rejects the initial
  74.       vector received in a CFB64_IV command.  Only the side of the con-
  75.       nection that is DO ENCRYPT may send the CFB64_IV_OK and
  76.       CFB64_IV_BAD commands.  The CFB64_IV_OK command MUST be sent for
  77.       backwards compatibility with existing implementations; there real-
  78.       ly isn't any reason why a sender would need to send the
  79.       CFB64_IV_BAD command except in the case of a protocol violation
  80.       where the IV sent was not of the correct length (i.e., 8 bytes).
  81.  
  82. 3.  Implementation Rules
  83.  
  84.    Once a CFB64_IV_OK command has been received, the WILL ENCRYPT side
  85.    of the connection should do keyid negotiation using the ENC_KEYID
  86.    command.  Once the keyid negotiation has successfully identified a
  87.    common keyid, then START and END commands may be sent by the side of
  88.    the connection that is WILL ENCRYPT.  Data will be encrypted using
  89.    the CAST128 64 bit Cipher Feedback algorithm.
  90.  
  91.    If encryption (decryption) is turned off and back on again, and the
  92.    same keyid is used when re-starting the encryption (decryption), the
  93.    intervening clear text must not change the state of the encryption
  94.    (decryption) machine.
  95.  
  96.    If a START command is sent (received) with a different keyid, the en-
  97.    cryption (decryption) machine must be re-initialized immediately fol-
  98.    lowing the end of the START command with the new key and the initial
  99.    vector sent (received) in the last CFB64_IV command.
  100.  
  101.    If a new CFB64_IV command is sent (received), and encryption (decryp-
  102.    tion) is enabled, the encryption (decryption) machine must be re-ini
  103.    tialized immediately following the end of the CFB64_IV command with 
  104.    the new initial vector, and the keyid sent (received) in the last
  105.    START command.
  106.  
  107.    If encryption (decryption) is not enabled when a CFB64_IV command is
  108.    sent (received), the encryption (decryption) machine must be re-ini
  109.    tialized after the next START command, with the keyid sent (received)
  110.    in that START command, and the initial vector sent (received) in this
  111.    CFB64_IV command.
  112.  
  113. 4.  Algorithm
  114.  
  115.    CAST 64 bit Cipher Feedback                                                  
  116.                                                                                 
  117.        key --->+------+                                                         
  118.             +->| CAST |--+                                                      
  119.             |  +------+  |                                                      
  120.             |            v                                                      
  121.     INPUT --(---------->(+)+---> DATA                                           
  122.             |              |                                                    
  123.         +--------------+                                                    
  124.                                                                                 
  125.                                                                                 
  126.    Given:                                                                       
  127.    iV: Initial vector, 64 bits (8 bytes) long.                             
  128.    Dn: the nth chunk of 64 bits (8 bytes) of data to encrypt (decrypt).    
  129.    On: the nth chunk of 64 bits (8 bytes) of encrypted (decrypted) output. 
  130.                                                                                 
  131.    V0 = CAST(iV, key)                                                      
  132.    On = Dn ^ Vn                                                            
  133.    V(n+1) = CAST(On, key)                                                  
  134.  
  135. 5.  Integration with the AUTHENTICATION telnet option
  136.  
  137.    As noted in the telnet ENCRYPTION option specifications, a keyid val-
  138.    ue of zero indicates the default encryption key, as might be derived
  139.    from the telnet AUTHENTICATION option.  If the default encryption key
  140.    negotiated as a result of the telnet AUTHENTICATION option contains
  141.    less than 16 (5) bytes, then the CAST128_CFB64 (CAST5_40_CFB64) 
  142.    option must not be offered or used as a valid telnet encryption option.
  143.  
  144.    If there are less than 32 (10) bytes of key data, the first 16 (5) 
  145.    bytes of key data are used as keyid 0 in each direction.  If there
  146.    are at least 32 (10) bytes of key data, the first 16 (5) bytes of
  147.    key data are used to encrypt the data sent by the telnet client to
  148.    the telnet server; the second 16 (5) bytes of key data are used to
  149.    encrypt the data sent by the telnet server to the telnet client.
  150.  
  151.    Any extra key data is used as random data to be sent as an 
  152.    initialization vector.
  153.  
  154. 6.  Security considerations
  155.  
  156.    Encryption using Cipher Feedback does not ensure data integrity; the
  157.    active attacker has a limited ability to modify text, if he can
  158.    predict the clear-text that was being transmitted.  The limitations
  159.    faced by the attacker (that only 8 bytes can be modified at a time,
  160.    and the following 8-byte block of data will be corrupted, thus making
  161.    detection likely) are significant, but it is possible that an active
  162.    attacker still might be able to exploit this weakness.
  163.  
  164.    The tradeoff here is that adding a message authentication code (MAC)
  165.    will significantly increase the number of bytes needed to send a sin-
  166.    gle character in the telnet protocol, which will impact performance
  167.    on slow (i.e. dialup) links.
  168.  
  169.    Encryption modes using 40-bit keys are not to be considered secure.
  170.    The 40 bit key mode CAST5_40_CFB64 is listed here simply to document
  171.    the implementations that are already prevalent on the Internet but
  172.    have never been documented.
  173.  
  174. 7.  Acknowledgments
  175.  
  176.    This document was based on the "Telnet Encryption: DES 64 bit Cipher
  177.    Feedback" draft originally written by Dave Borman of Cray Research
  178.    with the assistance of the IETF Telnet Working Group.
  179.  
  180. 8.  References
  181.  
  182.    [1] Adams, C., "The CAST-128 Encryption Algorithm", RFC 2144, May
  183.        1997.
  184.  
  185.  
  186. Author's Address
  187.  
  188.     Jeffrey Altman, ditor
  189.     Columbia Univrsity
  190.     612 West 115th Street Room 716
  191.     New York NY 10025 USA
  192.  
  193.     Phone: +1 (212) 854-1344
  194.     
  195.     EMail: jaltman@columbia.edu     
  196.