XML Encryption: Applications & Proposal Overview

Ed Simon, Entrust Technologies

XML Encryption Application: Wireless online banking

Brokerage wants to provide access to stock trading through handheld device and uses a transcoder to strip out images.

Transcoder needs to be able to parse and filter the XML but should not have access to sensitive data.

XML Encryption Application:  Wireless online banking...

img004.gif (15086 bytes)

XML Encryption Application: Buyer-vendor-bank transaction

img005.gif (15234 bytes)

XML Encryption Application: Buyer-vendor-bank transaction...

<EncryptedData xmlns=“Encryption”> <DecryptionInfo> {Acme’s encryption public key} </DecryptionInfo> 
<CreditCard Type=“SuperBank”> 
<EncryptedData xmlns=“Encryption”> <DecryptionInfo> {SuperBank’s encryption public key} </DecryptionInfo> 
</CreditCard > 

Invoice’s encrypted nodes encrypted for different organizations.

XML Security Application: Fine-Grained Access Control

Scenario: A teaching hospital maintains patient records in XML. Each record consists of the patient’s name, address, diagnosis, and history.

Doctors are allowed to see the entire patient record, and update the diagnosis and history.

Administration can see only the patient’s name and address, and only update the address.

Researchers can see only the history and diagnosis. Cannot update any part of the record.

XML Security Application: Fine-Grained Access Control...

<Patient SerialNumber=“ {EncryptedAttribute} ”> 
<Name> <EncryptedData…> </Name> 
<Address> <EncryptedData…> </Address> 
<Diagnosis> <EncryptedData…> </Diagnosis> 
<History> <EncryptedData…> </History> 

Who can see what:

XML Security Application: Fine-Grained Access Control...

How XML Security can help:

XML Security Application: Fine-Grained Access Control...

img010.gif (24060 bytes)

XML Encryption: Proposal Overview


“XML Encryption will specify an XML-based syntax and processing rules for encrypting both XML nodes and arbitrary data”

The Technical Details

XML Encryption has two principal elements:

The <> element: Non-attribute XML nodes

In the encrypted version of an XML instance, the <> element will appear in place of the non-attribute plaintext node that was encrypted. For example:




 <EncryptedData xmlns=“...”>qYrSiO2R5X...</EncryptedData>

Processing rules: Encrypting non-attribute nodes

1. Serialize (into a string) the node list to be encrypted.
2. Encrypt the string and put it in a <CipherText> element.
3. Create the <EncryptedData> element, put in the <DecryptionInfo> and <CipherText> elements.
4. Replace the plaintext node list with the <EncryptedData> element.

Processing rules: Decrypting non-attribute nodes

1. Find an <EncryptedData> element(s) with Type attribute equal to “Element” or “ElementContent”.
2. Decrypt the text nodes of the <CipherText> element to form an XML fragment.
3. Parse the XML fragment into a DOM node list.
4. Replace the <EncryptedData> element with the node list.

The <EncryptedData> element:
XML Attribute nodes

Because attributes are inside elements, one cannot just pop in an element in place of an attribute.

So, if one or more attributes of an element need to be encrypted, an EncryptedDataManifest attribute pointing to a list of encrypted nodes is added to that element. Here’s how it looks:

< AttributeA="A" AttributeB="B"
< xmlns="http://www.exampleorg/xmlenc">
< Name="AttributeValueToBeEncrypted1” Type="AttributeValue">...</EncryptedData>
< Name="AttributeValueToBeEncrypted2” Type="AttributeValue">...</EncryptedData>

Processing rules: Encrypting attribute values

1. Encrypt the attribute value and replace the attribute’s plaintext value with ciphertext. Repeat for each attribute value to be encrypted.
2. Add an EncryptedDataManifest attribute to the owner element; give it the xmlenc namespace .
3. Create an <EncryptedDataManifest> element as a child of the owner element.
4. For each encrypted attribute value, create an <EncryptedData> element specifying its Name attribute as the name of an attribute whose value was encrypted. Include the <DecryptionInfo> element with the info for decrypting that attribute.

Processing rules: Decrypting attribute vales

1. Find an <EncryptedData> element with Type attribute equal to “Attribute”.
2. Obtain the decryption parameters from the <DecryptionInfo> child.
3. Obtain the name of the encrypted attribute value owner from the <EncryptedData> Name attribute.
4. Decrypt the encrypted attribute value and set the attribute value as the derived plaintext .

The <EncryptedData> element: Attribute values...

Some questions:

The <EncryptedData> element: Arbitrary data

XML Encryption can encrypt one or more arbitrary data instances.

< xmlns=“http://www.example.org/xmlenc”> < Type=“video/mpeg” Name=“secret.mpg”> <>…</DecryptionInfo> < URI=“http://www.example.com/videos/secret.enc”/> </EncryptedData> < Type=“text” Name=“secret.txt”> <>...</DecryptionInfo> <>...</CipherText> </EncryptedData> </EncryptedDataManifest>

The above example covers two encrypted data sources (say for SMIL): an MPEG video with referenced ciphertext (detached encryption?) and a text file which is encrypted and stored directly in the <> element.

A closer look at <EncryptedData>


    <EncryptedData Type=“...” Name=“...”>
     <DecryptionInfo URI=“...”?>…<DecryptionInfo>?
     <CipherText URI=“”?>…</CipherText>? 



The <DecryptionInfo> element

The <DecryptionInfo> element contains information about the decryption key:

<DecryptionInfo (Id=)? (URI=)?> <Method Algorithm=”..."/><!-- The decryption method --> 
<Manifest>...</Manifest> <!-- Pointers to <EncryptedData> elements -->
<KeyInfo> <Value/>? <!-- Raw key value --> 
<Identifier/>? <!-- Key identifier -->
<Agreement/>? <!-- Key agreement data -->
<EncryptedKey/>+ <!-- Info for encrypted decryption keys --> </KeyInfo>

The <DecryptionInfo> element...

XML Encryption can be data-centric or key-centric: An <EncryptedData> element can indicate the associated <DecryptionInfo> element OR A <DecryptionInfo> element can indicate associated <EncryptedData> elements

XML Encryption and XML Signature

XML Encryption works with XML Signature so that data can be signed then encrypted OR encrypted then signed

Signed then Encrypted

On verification of the signature, an XML Signature transform is called to decrypt the data before the hash is calculated.

Encrypted then Signed
No special processing required.

Issues needing more study

XmlEncryptor: A proof-of-concept demo

XmlEncryptor: General comments

Addendum: PWC Questions

Addendum: PWC Questions...

Addendum: PWC Questions...

<></></x> OR <></><> OR <>

Addendum: PWC Questions...

XML Encryption: Contact info

Ed Simon Entrust Technologies ph: (613) 247-2583 email: ed.simon@entrust.com

or ejs19630722@hotmail.com