JSON Simple Encryption ver.1 draft00 (original) (raw)
Network Working Group | J. Bradeley |
---|---|
Internet-Draft | Protivity Government Services |
Intended status: Informational | N. Sakimura (Editor) |
Expires: April 2, 2011 | Nomura Research Institute |
September 29, 2010 |
JSON Simple Encryption ver.1 draft00
json-simple-enc-1_0
Abstract
This document defines a lightweight mechanism for encrypting arbitrary data to be encrypted and enveloped in JSON 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 (Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.) [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 April 2, 2011.
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 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
1.1.Envelope Parameters
1.2.The JSON Serialization
2.IANA Considerations
3.Security Considerations
4.Acknowledgements
5.References
5.1.Normative References
5.2.Informative References
Appendix A.An Appendix
§Authors' Addresses
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 (Crockford, D., “The application/json Media Type for JavaScript Object Notation (JSON),” July 2006.) [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
- type
Value: "http://jsonenc.info/json-encryption/"
- data_type
Value: The MIME type OR the Type URL of the payload prior to encoding
- enc_data
Value: RFC1962 (Deutsch, P., Gailly, J-L., Adler, M., Deutsch, L., and G. Randers-Pehrson, “GZIP file format specification version 4.3,” May 1996.) [RFC1952] compressed (gzip), Encrypted and Base64url encoded data.
- 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.
- 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.
- enc_type_asy
Value: (Optional) Asymmetric cypher type expressed in the Type URL from XML Encryption (Imamura, T., “XML Encryption Syntax and Processing,” December 2002.) [xml_enc]
- (Default) RSA-v1.5 http://www.w3.org/2001/04/xmlenc#rsa-1\_5 : RSA Encryption with PKCS1_PADDING.
- 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.
- 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"
- "ECDH-ES" Eliptic Curve Diffie-Helman Ephemeral Secret. Short hand for "http://www.w3.org/2009/xmlenc11#ECDH-ES"
One MAY define other Type URL if so desired.
- enc_ref
Value: (Optional) URI of the PEM format X.509 Certificate that corresponds to the public key encryption of the symmetric key.
- enc_certs
Value: (Optional) Base64url encoded DER format X.509 Certificate that corresponds to the public key encryption of the symmetric key.
- enc_ephemeral_pub_key
Value: (Optional) The ephemeral public key created by the originator for the use in ECDH-ES encryption. It is a JSON object that has two parameters "curve" and "key" where "curve" is URI of the named curve and "key" is the base64url encoded key.
- 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
1.2. The JSON Serialization
JSON Encryption Envelope MUST be well formed JSON as defined in [RFC4627] (Crockford, D., “The application/json Media Type for JavaScript Object Notation (JSON),” July 2006.). The parameters are serialized into a JSON object as a sequence of name/value pairs for the parameter described in Section 1.1 (Envelope Parameters).
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/certs.pem" }
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
Deutsch, P., Gailly, J-L., Adler, M., Deutsch, L., and G. Randers-Pehrson, “GZIP file format specification version 4.3,” RFC 1952, May 1996 (TXT, PS, PDF). | |
---|---|
[RFC2119] | Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” BCP 14, RFC 2119, March 1997 (TXT, HTML, XML). |
[RFC4627] | Crockford, D., “The application/json Media Type for JavaScript Object Notation (JSON),” RFC 4627, July 2006 (TXT). |
[xml_enc] | Imamura, T., “XML Encryption Syntax and Processing,” December 2002. |
5.2. Informative References
Appendix A. An Appendix
Authors' Addresses
| | John Bradeley | | -------------------------------- | | | Protivity Government Services | | | | | | Nat Sakimura | | | Nomura Research Institute |