INTERNET-DRAFT Brian Tungdraft-tung-transsec-sts-00.txtdraft-tung-transsec-sts-01.txt ISI expiresSeptember 30, 1997January 31, 1998 Simple Transaction Security (STS) 0. Status of this Memo This document is an Internet-Draft. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as``work"work inprogress.''progress." To learn the current status of any Internet-Draft, please check the``1id-abstracts.txt''"1id-abstracts.txt" listing contained in the Internet-Drafts Shadow Directories on ds.internic.net (US East Coast), nic.nordu.net (Europe), ftp.isi.edu (US West Coast), or munnari.oz.au (Pacific Rim). The distribution of this memo is unlimited. It is filed asdraft-tung-transsec-sts-00.txt,draft-tung-transsec-sts-01.txt, and expiresSeptember 30, 1997.January 31, 1998. Please send comments to the authors. 1. Abstract This document describes Simple Transaction Security (STS), aset of RFC-822 style headers that specify theprotocol for specifying services and protocols used to secure an enclosed message.These headers can be used to both indicate and request particular security services, as well as to distribute per-session keys.The framework is flexible enough to allow a wide variety of protocols to besubsumed,used, at the cost of some negotiation and thetype ofoptimizations present in protocols such as S-HTTP. 2. Introduction and MotivationMuch network traffic today can be characterized as transactions. ExamplesSTS provides some ofthis include HTTP and FTP. Withtheincreased placement of sensitive information comes a correspondingly increased need for transaction security. Some recent protocols have been introduced to address this need. Protocolssame services as existing protocols, such asSSL (Secure Socket Layer) provide a security contextMOSS and S-HTTP. However, STS was developed forend-to-end communications,use inwhich all messages are encrypted under this common context. This approach, however, does not provide object-level granularity--all objects are giventhesame security measures. Other protocols, such as S-HTTP, PEM/MIME,LSAM (Large Scale Active Middleware) project, which involves a variety of protocol modifications to enhance web performance, andMOSS, address what can more properly be called transaction-level security--that is, securityboth MOSS and S-HTTP exhibit limitations that make them less than perfectly suited forindividual objects.this application. In thisapproach, each objectsection, we will describe these protocols and their limitations in some detail. 2.1. MOSS MIME Object Security Services (MOSS) ishandled underaseparate security context. These protocols are, however, specificprotocol that applies digital signature and encryption services toa given transaction protocol: S-HTTPMIME objects. As such, it isdesigned around security HTTP, andmore general than S-HTTP (see below). These services are provided through theotheruse of end-to-end cryptography between twoaround securing electronic mail. The protocol proposedparticipants at the application layer. It requires participants to have at least one public/private key pair, unlike S-HTTP, which allows the services to be specified inthis document is designedrelation toprovide transaction-level securitysymmetric keys (which may be exchanged out of band). In scenarios ina generic fashion, sowhich components are in close collaboration, the requirement thatall transaction-oriented protocols can make use of it. It does so by providing two services. First, given any object as input,keys be exchanged using public key cryptography is an extensive performance liability. MOSS places no inherent limitations on which services itproduces acan provide support for, but currently only the multipart/signed and multipart/encrypted MIMEobject as output,types have been defined. No definitions have been made for simple transport of security components whichencapsulates that input object and performs anydo not directly affect the content of the message (e.g., payment instruments or authorization tokens). 2.2. S-HTTP Secure HTTP (S-HTTP) is anumber ofmessage-oriented communications protocol for securing messages sent using HTTP. It allows applications to independently apply securityoperations on it, such as encryption,services for transaction confidentiality, data integrity, andauthentication. This frameworknon-repudiation. S-HTTP emphasizes flexibility in the choice of algorithms by supporting option negotiation for each transaction. S-HTTP is designed to operate in a generalenoughenvironment, where components are not necessarily known toallow for arbitrary user-definedsupport S-HTTP or its associated security services.Secondly,Much of the negotiation supported in S-HTTP is thus unrequired overhead in cooperative situations in which trusted components have agreed on a security context, and where theproposed protocol allows for in-band key distribution, so that short-term session keys can be established for thistransactionand, if desired, following transactions as well. A wide variety of methods mayneed only beusedsecured against external attackers (including spoofers). S-HTTP also only applies todistribute these session keys, such as RSA, Diffie-Hellman, and Kerberos.HTTP transactions. Many of the headers defined in the S-HTTP draft apply specifically to HTTP constructs. It also does not attempt to provide secure transport for security components. 3.Message SyntaxProtocol Specification An STStakes any objectmessage consists of a primary, divided into a preamble andproducesaobject with MIME type "application/sts";body, and an appendix. The preamble contains parameters relating to the securing of thisobject is ordered as follows: In-band key exchange headers (see Section 3.2) STS security headers (see Section 4) A blank line. "===Begin STS Secure Object==="message. Theinput object itself (possibly encrypted) "===End STS Secure Object===" Ifbody contains theinput object ispayload of the message, and may be encrypted or unencrypted. The appendix contains aMIME object, then relevant headers are tosignature of the message, though this signature may beincluded withincomputed using a null algorithm. In this section, we describe the"STS Secure Object" delimiters.syntax for each of these sections. 3.1.STS Header SyntaxPrimary Thestandard format for an STS headerprimary is structured as follows:X-STS-Service-Header: sense=%d; protocol-id=%s; [service-dependent arguments] where "Service" is replaced by the name of a defined--BEGIN STSservice. Currently defined servicesPRIMARY-- Version: 1.0 --BEGIN STS PREAMBLE-- ... --END STS PREAMBLE-- --BEGIN STS BODY-- ... --END STS BODY-- --END STS PRIMARY-- 3.1.1. Preamble The header fields in the preamble arePayment, Integrity, Authentication,formatted as per RFC 822, andEncryption.are limited to the following: Association-ID: Certificate: In-Band-Key: Encryption-Key: Auxiliary: ThesenseAssociation-ID field is mandatory and defines athree-digit integer.unique identifier for this association. Thefirst digit indicates the criticalityvalue ofthe header field. Ifthisdigit is 1, thefield iscritical: that is, if the receiver does not understand the field, it must reject the message and return an appropriate error message (if applicable). If it is 0, the receiver may continue to process the message, ignoring this particular field.implementation-defined. Thesecond digit is the originator digit. If it is 1, the parameterssyntax ofthis field govern this message. The third digit isthereceiver digit. If itCertificate field is1, the receiver should reply withas follows: Certificate: Key-ID=<String>; Type=<String>; Encoding=<String>; <Certificate> The Key-ID subfield defines theparameters specified in this field. At least one of these digit must be 1. In particular, both digits MAYidentifier to be1.used to refer to this key. Theprotocol-id field is a string indicating the name of the protocol supporting the service in questionType (e.g.,"DESSHA1" for a data integrity header). 3.2. In-Band Key Distribution If senderX.509) andreceiver either share a conventional key, or possess public key pairs, thenEncoding define thesender may include a key,format for thepurposescertificate. The syntax ofthis message, inthemessage itself. This keyIn-Band-Key field isexpressedas follows:X-STS-Session-Key: key-id=%s; key-life=%s; enc-key-id=%s; [sign-key-id=%s;] id-life-sig=%s; key-data=%s The key-id is a one-timeIn-Band-Key: Key-ID=<String>; Distribution-Algorithm=<String>; [Encrypting-Key-ID=<String>;] Encoding=<String> <Distributed-Key> The Key-ID subfield defines the identifierthat willto be used toidentifyrefer to thiskeykey. The Distribution-Algorithm defines the algorithm used in distributing thismessage (and optionally later ones). The key-lifekey. If key distribution is based on encryption using astring that indicateskey established elsewhere (possibly in this preamble), then thelifetime during whichoptional Encrypting-Key-ID subfield contains the keyisused tobe considered valid. A value of "0" indicates that it is valid for this message only. A string "+%d" indicates that itencrypt the distributed key. Otherwise, if the distribution isvalid forbased on a trusted third party, then thespecified number of seconds. A string "%d" indicates that itDistributed-Key isvalid untilsimply thespecified number of seconds after midnight 1/1/1970. A value of "connect" indicatescredentials supplied by thatitthird party (e.g., Kerberos ticket and authenticator). In either case, the key isvalid forencoded using thelength ofalgorithm defined in theconnection (to be determined on a protocol-by-protocol basis).Encoding subfield. Theenc-key-idsyntax of the Encryption-Key field is as follows: Encryption-Key: Key-ID=<String>; Encryption-Algorithm=<String>; Encoding=<String> The Key-ID subfield identifies the keybeing(if any) to be used to encrypt thekey; its value is a key-id string that has previously been agreed upon by the sender and receiver (either out of band or in band).body. Thesign-key-id field is only present when enc-key-id points to a public key. ThenEncryption-Algorithm subfield defines thesign-key-id refersalgorithm used to encrypt thepublic key corresponding tobody. The Encoding field defines theprivate key used to signencoding mechanism for thesession key. (When a conventional keybody of the message. This field is mandatory, even if encryption is not used. The Auxiliary field is used forthe enc-key-id, there is no need to sign the session key.)miscellaneous related payload, such as authorization or payment. Theid-life-sigsyntax for this field will be described later. 3.1.2. Body The body of the message isderivedconstructed as follows. Thefollowing string: key-id=%s; key-life=%s with leading and trailing whitespace deletedpayload isSHA1 hashed, and signed (withfirst optionally encrypted using theshared key enc-key-id if it is a symmetric key, orparameters described in thesign-key-id if thatEncryption-Key fieldis present).in the preamble. Thenthisit isBASE64encodedand placedusing the algorithm identified in theid-life-sig field. The key-dataEncoding fieldis derived fromin thefollowing ASN.1 structure: KeyDataPlain ::= SEQUENCE { key EncryptionKey, nonce INTEGER, timestamp KerberosTime } This structurepreamble. Then it isDER encoded, optionally signed, then encrypted, and finally BASE64 encoded before being inserted into the key-data field. Where applicable, these operations are performed under the guidelines specifiedenclosed inPKCS #1 and #7. The receiver acknowledges this session key by returningthefollowing header in its reply: X-STS-Session-Key-Ack: key-id=%s; key-life=%sdelimiters described above. 3.2. Appendix Thekey-id fieldappendix iseither identical to that in the request, or includes itstructured asa prefix. The key-life field, roughly speaking, must be less than that presented infollows: --BEGIN STS APPENDIX-- Version: 1.0 Association-ID | Key-ID: <Value> [Algorithm-ID: <Value>] [Encoding: <Value>] <Signature> --END STS APPENDIX-- If therequest. Specifically, a reply key-life value of "0"signature isalways permitted; additionally, if eitherto be based on aninteger lifetime or expiration time is given, a smaller integer inestablished association, then thesame format is also permitted. 4. Message Semantics 4.1. Authentication An authenticationsecond headerhas the following format: X-STS-Authentication-Header: sense=%d; protocol-id=%s; [key-id=%s; authentication-data=%s] The only currently defined authentication protocolisKerberosV5. It is assumed thatthesender knows the receiver's principal name. The contents ofAssociation-ID field, and its value is implementation-defined. If, instead, theauthentication-data fieldsignature issimplybased on aKRB-AP-REQ (as defined in RFC 1510), BASE64 encoded. The sessionkeycontaineddistributed inthis requestthe preamble, then the second header isdenoted bythe Key-ID field, and its valueofis thekey-id field. (Note that this interpretation ofidentifier assigned to thekey-id field is different from thatkey inSections 4.2 and 4.3.) Ifthesecond digit ofpreamble. Normally, thesense field is 0,Association-ID determines the signature algorithm and encoding; if it does not, then thelastalgorithm and encoding are named in the optional Algorithm-ID and Encoding fields. These two fields areomitted andnot optional in thereceiver is requested to authenticate his reply. 4.2. Integrity A data integrity header hascase of in-band key distribution. The Signature begins with the first non-white-space character followingformat: X-STS-Integrity-Header: sense=%d; protocol-id=%s; [key-id=%s; integrity-data=%s] Currently defined integrity protocols are DESMD5 and DESSHA1. In either case,theappropriate one-way hash function (either MD5 or SHA1) is applied to the data,last appendix header value, andthen signed (encrypted)ends with thekey specified by key-id. The key-id refers either to a key exchanged in band as described in Section 3.2, or to a key that has been agreed upon previously. If this key has been exchanged out of band, then it is assumed that the receiver knows how to interpret this field. The resulting ciphertext is then BASE64 encodedlast non-white-space character beforebeing placed intheheader field. Ifend of thesecond digitappendix. The structure of thesense fieldSignature is0, thendependent on thelast two fields are omittedalgorithm and encoding used. 4. Response Normally, thereceiverresponse isrequestedsent tointegrity protect his reply. 4.3. Encryption An encryption header hasthefollowing format: X-STS-Encryption-Header: sense=%d; protocol-id=%s; [key-id=%s] Currently defined protocols are DES and IDEA. The key-id refers either to a key exchangedinitiator of the transaction inbandthe same way asdescribed in Section 3.2, or to a key that has been agreed upon previously. Ifthe request. However, thiskey has been exchanged out of band, then itisassumed thatnot possible if thereceiver knows how to interpretSTS wrapping could not be properly decoded. In thisfield. Ifcase, thesecond digit ofreply indicates thesense field is 0, thenerror discovered in decoding thelast two fields are omitted andSTS request. 4.1. Error Reply The STS error reply is structured exactly as thereceiverrequest, except that an additional field isrequestedused toencrypt his reply. 5. Error Returnindicate the error: Error-ID: Ifan STS header of a request fails, thenapplicable, additional information about thereceiver returns anerrorreply. This error takesis enclosed in theformbody ofa single header: X-STS-Error: %s wherethecurrentlyprimary. Currently defined errorsare: Header verification failed. Header rejected. Key verification failed. Key rejected.are as follows: Key(s) not recognized. (List of Key-IDs.) Certificate type(s) not recognized. (List of Types.) Can't decode certificate(s). (List of Key-IDs.) Can't extract key(s). (List of Key-IDs.) Distribution algorithm(s) not supported. (List of Algorithms.) Encoding(s) not supported. (List of Encodings.) Body doesn't decrypt. Can't verify signature. Where shown, the message body contains the listed information. 5. Supported Algorithms and Types Currently supported certificate formats are X.509. Currently supported encryption algorithms are DES and RSA. Currently supported signature algorithms are MD5-DES, MD5-RSA, SHA-DES, and SHA-RSA. Currently supported key distribution algorithms are KerberosV5. Currently supported encodings are BASE64, 7-BIT, and 8-BIT. 6. Expiration Date This draft expires onSeptember 30, 1997.January 31, 1998. 7. Author Brian Tung USC Information Sciences Institute 4676 Admiralty Way Suite 1001 Marina del Rey CA 90292-6695 Phone: +1 310 822 1511 Fax: +1 310 823 6714 E-mail: brian@isi.edu