home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / e / id-d3o-02.txt < prev    next >
Text File  |  2020-01-01  |  10KB  |  261 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 Output 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 output feedback mode with the telnet encryption option.
  41.  
  42. 1.  Command Names and Codes
  43.  
  44.    Encryption Type
  45.  
  46.       DES3_OFB64       3
  47.  
  48.    Suboption Commands
  49.  
  50.       OFB64_IV         1
  51.       OFB64_IV_OK      2
  52.       OFB64_IV_BAD     3
  53.  
  54.  
  55. 2.  Command Meanings
  56.  
  57.    IAC SB ENCRYPT IS DES3_OFB64 OFB64_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.       OFB64_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.       OFB64_IV command.
  64.  
  65.    IAC SB ENCRYPT REPLY DES3_OFB64 OFB64_IV_OK IAC SE
  66.    IAC SB ENCRYPT REPLY DES3_OFB64 OFB64_IV_BAD IAC SE
  67.  
  68.       The sender of these commands either accepts or rejects the initial
  69.       vector received in a OFB64_IV command.  Only the side of the con-
  70.       nection that is DO ENCRYPT may send the OFB64_IV_OK and
  71.       OFB64_IV_BAD commands.  The OFB64_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.       OFB64_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 OFB64_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 OFB64_IV command.
  95.  
  96.    If a new OFB64_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 OFB64_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 OFB64_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.    OFB64_IV command.
  107.  
  108. 4.  Algorithm
  109.  
  110.     DES3 64 bit Output Feedback                                                    
  111.                                                                                   
  112.                                                                                   
  113.                    key1       key2       key3                                     
  114.                     |          |          |                                       
  115.                     v          v          v                                       
  116.                 +-------+  +-------+  +-------+                                   
  117.              +->| DES-e |->| DES-d |->| DES-e |-- +                               
  118.              |  +-------+  +-------+  +-------+   |                               
  119.              +------------------------------------+                               
  120.                                                 v                               
  121.      INPUT ------------------------------------->(+) ----> DATA                   
  122.                                                                                   
  123.     Given:                                                                        
  124.        iV: Initial vector, 64 bits (8 bytes) long.                              
  125.        Dn: the nth chunk of 64 bits (8 bytes) of data to encrypt (decrypt).     
  126.        On: the nth chunk of 64 bits (8 bytes) of encrypted (decrypted) output.  
  127.                                                                                   
  128.        V0 = DES-e(DES-d(DES-e(iV, key1),key2),key3)                             
  129.        V(n+1) = DES-e(DES-d(DES-e(Vn, key1),key2),key3)                         
  130.        On = Dn ^ Vn                                                             
  131.  
  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_OFB64 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_OFB64 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 Output Feedback does not ensure data integrity; an
  208.    active attacker may be able to substitute text, if he can predict the
  209.    clear-text that was being transmitted.
  210.  
  211.    The tradeoff here is that adding a message authentication code (MAC)
  212.    will significantly increase the number of bytes needed to send a sin-
  213.    gle character in the telnet protocol, which will impact performance
  214.    on slow (i.e. dialup) links.
  215.  
  216.    This option was originally drafted back when CPU speeds where not
  217.    necessarily fast enough to do allow use of CFB.  Since then, CPU's
  218.    have gotten much faster.  Given the inherent weaknesses in Output
  219.    Feedback mode, perhaps it should be deprecated in favor of CFB modes?
  220.  
  221. 7. Acknowledgments
  222.  
  223.    This document was based on the "Telnet Encryption: DES 64 bit Output
  224.    Feedback" draft originally written by Dave Borman of Cray Research
  225.    with the assistance of the IETF Telnet Working Group.
  226.  
  227. 8. References
  228.  
  229.    [FIPS-46]   US National Bureau of Standards, "Data Encryption
  230.                Standard", Federal Information Processing Standard (FIPS)
  231.                Publication 46, January 1977.
  232.  
  233. Author's Address
  234.  
  235.    Jeffrey Altman, Editor
  236.    Columbia University
  237.    612 West 115th Street Room 716
  238.    New York NY 10025 USA
  239.  
  240.    Phone: +1 (212) 854-1344
  241.  
  242.    EMail: jaltman@columbia.edu
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.                                                                 [Page 3]
  261.