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

  1.  
  2.  
  3.  
  4.  
  5.  
  6. Network Working Group                                     Jeffrey Altman
  7. Internet-Draft                                       Columbia University
  8. draft-altman-telnet-enc-des3-cfb-02.txt                    February 1999
  9.  
  10.  
  11.              Telnet Encryption: DES3 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 Triple-DES encryption algorithm
  40.    in cipher feedback mode with the telnet encryption option.
  41.  
  42. 1.  Command Names and Codes
  43.  
  44.    Encryption Type
  45.  
  46.       DES3_CFB64       3
  47.  
  48.    Suboption Commands
  49.  
  50.       CFB64_IV         1
  51.       CFB64_IV_OK      2
  52.       CFB64_IV_BAD     3
  53.  
  54.  
  55. 2.  Command Meanings
  56.  
  57.    IAC SB ENCRYPT IS DES3_CFB64 CFB64_IV <initial vector> IAC SE
  58.  
  59.       The sender of this command generates a random 8 byte initial vec-
  60.       tor, and sends it to the other side of the connection using the
  61.       CFB64_IV command.  The initial vector is sent in clear text.  Only
  62.       the side of the connection that is WILL ENCRYPT may send the
  63.       CFB64_IV command.
  64.  
  65.    IAC SB ENCRYPT REPLY DES3_CFB64 CFB64_IV_OK IAC SE
  66.    IAC SB ENCRYPT REPLY DES3_CFB64 CFB64_IV_BAD IAC SE
  67.  
  68.       The sender of these commands either accepts or rejects the initial
  69.       vector received in a CFB64_IV command.  Only the side of the con-
  70.       nection that is DO ENCRYPT may send the CFB64_IV_OK and
  71.       CFB64_IV_BAD commands.  The CFB64_IV_OK command MUST be sent for
  72.       backwards compatibility with existing implementations; there real-
  73.       ly isn't any reason why a sender would need to send the
  74.       CFB64_IV_BAD command except in the case of a protocol violation
  75.       where the IV sent was not of the correct length (i.e., 8 bytes).
  76.  
  77. 3.  Implementation Rules
  78.  
  79.    Once a CFB64_IV_OK command has been received, the WILL ENCRYPT side
  80.    of the connection should do keyid negotiation using the ENC_KEYID
  81.    command.  Once the keyid negotiation has successfully identified a
  82.    common keyid, then START and END commands may be sent by the side of
  83.    the connection that is WILL ENCRYPT.  Data will be encrypted using
  84.    the DES3 64 bit Cipher Feedback algorithm.
  85.  
  86.    If encryption (decryption) is turned off and back on again, and the
  87.    same keyid is used when re-starting the encryption (decryption), the
  88.    intervening clear text must not change the state of the encryption
  89.    (decryption) machine.
  90.  
  91.    If a START command is sent (received) with a different keyid, the en-
  92.    cryption (decryption) machine must be re-initialized immediately fol-
  93.    lowing the end of the START command with the new key and the initial
  94.    vector sent (received) in the last CFB64_IV command.
  95.  
  96.    If a new CFB64_IV command is sent (received), and encryption (decryp-
  97.    tion) is enabled, the encryption (decryption) machine must be re-ini
  98.    tialized immediately following the end of the CFB64_IV command with 
  99.    the new initial vector, and the keyid sent (received) in the last
  100.    START command.
  101.  
  102.    If encryption (decryption) is not enabled when a CFB64_IV command is
  103.    sent (received), the encryption (decryption) machine must be re-ini
  104.    tialized after the next START command, with the keyid sent (received)
  105.    in that START command, and the initial vector sent (received) in this
  106.    CFB64_IV command.
  107.  
  108. 4.  Algorithm
  109.  
  110.    DES3 64 bit Cipher Feedback
  111.      
  112.                  key1       key2       key3
  113.                   |          |          |
  114.                   v          v          v
  115.               +-------+  +-------+  +-------+  
  116.            +->| DES-e |->| DES-d |->| DES-e |-- +
  117.            |  +-------+  +-------+  +-------+   |
  118.            |                                    v
  119.    INPUT --(-------------------------------->(+)+---> DATA
  120.            |                                    |
  121.            +------------------------------------+
  122.          
  123.  
  124.    Given:
  125.    iV: Initial vector, 64 bits (8 bytes) long.
  126.    Dn: the nth chunk of 64 bits (8 bytes) of data to encrypt (decrypt).
  127.    On: the nth chunk of 64 bits (8 bytes) of encrypted (decrypted) output.
  128.  
  129.    V0 = DES-e(DES-d(DES-e(iV, key1),key2),key3)
  130.    On = Dn ^ Vn
  131.    V(n+1) = DES-e(DES-d(DES-e(On, key1),key2),key3)
  132.  
  133. 5.  Integration with the AUTHENTICATION telnet option
  134.  
  135.    As noted in the telnet ENCRYPTION option specifications, a keyid val-
  136.    ue of zero indicates the default encryption key, as might be derived
  137.    from the telnet AUTHENTICATION option.  If the default encryption key
  138.    negotiated as a result of the telnet AUTHENTICATION option contains
  139.    less than 16 bytes, then the DES3_CFB64 option must not be offered or
  140.    used as a valid telnet encryption option.  
  141.  
  142.    The following rules are to be followed for creating three DES encryp-
  143.    tion keys based upon the available encrypt key data:
  144.  
  145.      keys_to_use = bytes of key data / DES block size (8 bytes)
  146.  
  147.    where the keys are labeled "key1" through "key6" with "key1" being
  148.    the first 8 bytes; "key2" the second 8 bytes; ... and "key6" being
  149.    sixth 8 bytes (if available).
  150.     
  151.    When two keys are available:
  152.    
  153.    . data sent from the server is encrypted with key1, decrypted with 
  154.      key2, and encrypted with key1;
  155.  
  156.    . data sent from the client is encrypted with key2, decrypted with
  157.      key1, and encrypted with key2
  158.  
  159.   When three keys are available:
  160.     
  161.    . data sent from the server is encrypted with key1, decrypted with 
  162.      key2, and encrypted with key3;
  163.  
  164.    . data sent from the client is encrypted with key2, decrypted with
  165.      key3, and encrypted with key1
  166.  
  167.   When four keys are available:
  168.     
  169.    . data sent from the server is encrypted with key1, decrypted with 
  170.      key2, and encrypted with key3;
  171.  
  172.    . data sent from the client is encrypted with key2, decrypted with
  173.      key4, and encrypted with key1
  174.  
  175.   When five keys are available:
  176.     
  177.    . data sent from the server is encrypted with key1, decrypted with 
  178.      key2, and encrypted with key3;
  179.  
  180.    . data sent from the client is encrypted with key2, decrypted with
  181.      key4, and encrypted with key5
  182.  
  183.   When six keys are available:
  184.     
  185.    . data sent from the server is encrypted with key1, decrypted with 
  186.      key2, and encrypted with key3;
  187.  
  188.    . data sent from the client is encrypted with key4, decrypted with
  189.      key5, and encrypted with key6
  190.  
  191.    In all cases, the keys used by DES3_CFB64 must have their parity 
  192.    corrected after they are determined using the above algorithm.
  193.  
  194.    Note that the above algorithm assumes that it is safe to use a non-
  195.    DES key (or part of a non-DES key) as a DES key.  This is not neces-
  196.    sarily true of all cipher systems, but we specify this behaviour as
  197.    the default since it is true for most authentication systems in popu-
  198.    lar use today, and for compatibility with existing implementations.
  199.    New telnet AUTHENTICATION mechanisms may specify althernative methods
  200.    for determining the keys to be used for this cipher suite in their
  201.    specification, if the session key negotiated by that authentication
  202.    mechanism is not a DES key and and where this algorithm may not be
  203.    safely used.
  204.  
  205. 6.  Security considerations
  206.  
  207.    Encryption using Cipher Feedback does not ensure data integrity; the
  208.    active attacker has a limited ability to modify text, if he can
  209.    predict the clear-text that was being transmitted.  The limitations
  210.    faced by the attacker (that only 8 bytes can be modified at a time,
  211.    and the following 8-byte block of data will be corrupted, thus making
  212.    detection likely) are significant, but it is possible that an active
  213.    attacker still might be able to exploit this weakness.
  214.  
  215.    The tradeoff here is that adding a message authentication code (MAC)
  216.    will significantly increase the number of bytes needed to send a sin-
  217.    gle character in the telnet protocol, which will impact performance
  218.    on slow (i.e. dialup) links.
  219.  
  220. 7.  Acknowledgments
  221.  
  222.    This document was based on the "Telnet Encryption: DES 64 bit Cipher
  223.    Feedback" draft originally written by Dave Borman of Cray Research
  224.    with the assistance of the IETF Telnet Working Group.
  225.  
  226. 8.  References
  227.  
  228.    [FIPS-46]   US National Bureau of Standards, "Data Encryption
  229.                Standard", Federal Information Processing Standard (FIPS)
  230.                Publication 46, January 1977.
  231.  
  232. Author's Address
  233.  
  234.    Jeffrey Altman, Editor
  235.    Columbia University
  236.    612 West 115th Street Room 716
  237.    New York NY 10025 USA
  238.  
  239.    Phone: +1 (212) 854-1344
  240.  
  241.    EMail: jaltman@columbia.edu
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.                                                                 [Page 3]
  260.