Network Working Group                                        J. Bradeley
Internet-Draft                                                    Wingaa
Intended status: Informational                               N. Sakimura
Expires: December 4, 2010                      Nomura Research Institute
                                                            June 2, 2010


                        JSON Encryption Envelope
                       draft-sakimura-jsonenc-00

Abstract

   This document defines a lightweight mechanism for encrypting
   arbitrary data to be encrypted and enveloped in JSON [RFC4627]
   together with necessary encryption parameters.

Requirements Language

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in RFC 2119 [RFC2119].

Status of this Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   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 in progress."

   This Internet-Draft will expire on December 4, 2010.

Copyright Notice

   Copyright (c) 2010 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents



Bradeley & Sakimura     Expires December 4, 2010                [Page 1]

Internet-Draft                   JSONenc                       June 2010


   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.


Table of Contents

   1.  JSON Encryption Envelope  . . . . . . . . . . . . . . . . . . . 3
     1.1.  Envelope Parameters . . . . . . . . . . . . . . . . . . . . 3
     1.2.  The JSON Serialization  . . . . . . . . . . . . . . . . . . 5
   2.  IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 5
   3.  Security Considerations . . . . . . . . . . . . . . . . . . . . 5
   4.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . 5
   5.  References  . . . . . . . . . . . . . . . . . . . . . . . . . . 5
     5.1.  Normative References  . . . . . . . . . . . . . . . . . . . 5
     5.2.  Informative References  . . . . . . . . . . . . . . . . . . 6
   Appendix A.  An Appendix  . . . . . . . . . . . . . . . . . . . . . 6
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . . . 6































Bradeley & Sakimura     Expires December 4, 2010                [Page 2]

Internet-Draft                   JSONenc                       June 2010


1.  JSON Encryption Envelope

   JSON Encryption Envelope comprises a message bundled along with
   encryption parameters for that message, expressed as a series of
   parameters, and serialized as JSON in RFC 4627 [RFC4627].  The
   envelope specifies the data that was encrypted, the MIME type of the
   data, the transfer encoding, and the encryption parameters.

1.1.  Envelope Parameters

   o  object_type

         Value: "http://jsonenc.info/json-encryption/"

   o  data_type

         Value: The MIME type OR the Type URL of the payload prior to
         encoding

   o  enc_data

         Value: The JSON Form OpenID assertion that is encrypted and
         Base64url encoded as in [magic_signatures] .

   o  enc_key

         Value: The symmetric encryption key that was used for the
         encryption of the payload encrypted with the algorithm
         specified in 'enc_type_asy' by the Public specified by the RP
         then Base64url encoded.

   o  enc_iv

         Value: (Optional) Base64 encoded initialization vector.  It
         SHOULD be different for each encryption.  The default IV is
         null, however, using null as the IV is strongly discouraged.

   o  enc_type_asy

         Value: (Optional) Asymmetric cypher type expressed in the Type
         URL from XML Encryption [xml_enc]



         +  (Default) RSA-v1.5 http://www.w3.org/2001/04/xmlenc#rsa-1_5
            : RSA Encryption with PKCS1_PADDING.





Bradeley & Sakimura     Expires December 4, 2010                [Page 3]

Internet-Draft                   JSONenc                       June 2010


         +  RSA-OAEP http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p :
            RSA Encryption with PKCS1_OAEP_PADDING.

         One MAY use other Type URLs if so desired.

   o  enc_type

         Value: (Optional) String expressing the encryption type.
         Default is "AES-128-CBC".  Possible values are:



         +  "PLAIN" No encryption base64 encoding only

         +  "AES-128-CBC" 128 bit AES encryption in CBC mode (default) .
            Short hand for
            "http://www.w3.org/2001/04/xmlenc#aes128-cbc".

         +  "AES-256-CBC" 256 bit AES encryption in CBC mode.  Short
            hand for "http://www.w3.org/2001/04/xmlenc#aes256-cbc"

         One MAY define other Type URL if so desired.

   o  enc_ref

         Value: (Optional) URI of the PEM format X.509 Certificate that
         corresponds to the public key encryption of the symmetric key.

   o  enc_pem

         Value: (Optional) Base64url encoded PEM format X.509
         Certificate that corresponds to the public key encryption of
         the symmetric key.

   o  enc_thumbprint

         Value: (Optional) A SHA1 of the DER encoded certificate.

         Note: One may calculate this value as in the follwoing non-
         normative example from a PEM encoded certificate:


openssl x509 -in cer.cert -text | perl -ne 'print if /BEGIN/../END/' | openssl base64 -d | openssl sha1 -hex








Bradeley & Sakimura     Expires December 4, 2010                [Page 4]

Internet-Draft                   JSONenc                       June 2010


1.2.  The JSON Serialization

   JSON Encryption Envelope MUST be well formed JSON as defined in
   [RFC4627].  The parameters are serialized into a JSON object as a
   sequence of name/value pairs for the parameter described in
   Section 1.1.

   Additional name/value pairs MAY appear within the JSON object and
   processors MUST ignore elements they do not understand.

   Example:


   {
       "object_type":"http://jsonenc.info/json-encryption/",
       "enc_data":"b5guwzFgvrIUd7XcXI0bAFrg-....O69VKhY",
       "enc_key":"mHM2ongmZlPVexe....2lsBNdw",
       "enc_iv":"_b4INfYIRwLPZdxB2L7wJg",
       "enc_type":"AES-128-CBC',
       "enc_ref":"https://rp.example.com/rpf_ax.json"
   }




2.  IANA Considerations

   This document makes no request of IANA.


3.  Security Considerations

   The symmetric encryption key should be generated with a reliable
   pseudo-random number generator to achieve high entropy.

   The initialization vector should be generated with a reliable pseudo-
   random number generator to achieve high entropy.


4.  Acknowledgements


5.  References

5.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.



Bradeley & Sakimura     Expires December 4, 2010                [Page 5]

Internet-Draft                   JSONenc                       June 2010


   [RFC4627]  Crockford, D., "The application/json Media Type for
              JavaScript Object Notation (JSON)", RFC 4627, July 2006.

   [magic_signatures]
              Panzer, J., "Magic Signatures", February 2010.

   [xml_enc]  Imamura, T., "XML Encryption Syntax and Processing",
              December 2002.

5.2.  Informative References


Appendix A.  An Appendix


Authors' Addresses

   John Bradeley
   Wingaa

   Email: john.bradley@wingaa.com


   Nat Sakimura
   Nomura Research Institute
   1-6-5 Marunouchi, Marunouchi Kitaguchi Bldg.
   Chiyoda-ku, Tokyo  100-0005
   Japan

   Phone: +81-3-5533-2111
   Email: n-sakimura@nri.co.jp




















Bradeley & Sakimura     Expires December 4, 2010                [Page 6]