Introduction to XML Encryption


This is a Web Services security book, so let’s jump ahead a little bit and put XML Encryption into a Web Services context.

Persistent Encryption for Web Services Transactions

Confidentiality means that information at rest and in transit cannot be accessed by unauthorized parties. When information is at rest, as in a database, a strong access control policy may be used for confidentiality, as may an “air gap” between the protected data and the network. When information is in transit, encryption is often the most appropriate means of ensuring confidentiality. There are multiple confidentiality options available at various levels of the OSI stack. Remember, it is not the technology that is used, but the security principle that is to be implemented. The question should be “how do I get confidentiality into my communication?” not “how do I get XML Encryption into my communication?” SSL may be used if the SOAP request is bound to HTTP, or IPSec may be used at the network layer.

When is XML Encryption useful for Web Services? The chief importance of XML Encryption for Web Services is that it allows the security principle of confidentiality to be satisfied across more than just the context of a single SOAP request. This capability finds a number of applications in Web Services, because the security context of a SOAP message often extends beyond a single SOAP request. One obvious scenario is if information in a SOAP message must be kept confidential while it is sent over a multihop SOAP transaction. In this scenario, if SSL alone is used, a gap exists at each SOAP endpoint, where the sensitive data would be temporarily in the clear.

Additionally, if information in a SOAP message must be kept encrypted after the SOAP message has been processed by a Web Service, XML Encryption is also useful. This scenario would apply if encrypted information is being submitted into a database via a Web Service.

These scenarios have one thing in common: persistent encryption. This contrasts with session encryption. The encryption is not linked to the point-to-point SOAP exchange, so it does not end when the message reaches a SOAP endpoint.

Now that we’ve seen where XML Encryption fits into the picture for Web Services, let’s take a closer look at what it is and how it works.

XML-Aware Encryption

XML Encryption is a W3C Recommendation. Its functionality boils down to two themes:

  1. Encrypted data can be expressed using XML.

  2. Portions of an XML document can be selectively encrypted.

Note that XML Encryption is not a new type of encryption. The same tried- and-trusted encryption algorithms—DES, Triple-DES, AES—are used for XML Encryption. It isn’t just a way of encrypting XML documents; that could be done before, because encrypting an entire XML document is no different than encrypting any other type of digital document. Selective encryption of an XML document is something new, which couldn’t be done before XML Encryption.

Expressing Encrypted Data Using XML

This capability may seem mundane, and perhaps it is. Expressing data as XML is not so exciting now that the world is moving to expressing many types of structured data in XML. However, the general advantages of XML apply. Enclosing encrypted data in XML is an advantage to the consumer of the encrypted data, since an XML DOM can be used to extract the ciphertext and feed it into an algorithm (along with a key of course) for decryption.

What Information Is Expressed Using XML Encryption?

It is not only the encrypted data that may be expressed in XML using XML Encryption. Optional items include

  • Details of the data type of the encrypted document (for example, JPEG, XML, HTML, and so forth)

  • An encrypted key (for example, symmetric key)

  • Information about how the encrypted key was agreed on (for example, Diffie-Hellman)

  • Reference to the encrypted data, if it is not in the EncryptedData XML fragment itself

  • The encryption method that was used (for example, RSA for encrypting a symmetric key, AES for data)

To express some of these items, XML Encryption “borrows” some XML elements from XML Signature, namely the KeyInfo block. If a public key is to be transported in XML and there already exists a method for doing this, defined in the XML Signature specification, then it makes sense to use these elements in XML Encryption also. We will see later that two extra subelements were added to KeyInfo in order to cater for encrypted keys.

In the shorthand rendering of XML Encryption below, we can see the XML Signature elements, distinguished by their “ds” namespace (note that a question mark denotes an optional element):

<EncryptedData Id? Type?>     <EncryptionMethod/>?     <ds:KeyInfo>       <EncryptedKey>?       <AgreementMethod>?       <ds:KeyName>?       <ds:RetrievalMethod>?       <ds:*>?     </ds:KeyInfo>?     <CipherData>       <CipherValue>?       <CipherReference URI?>?     </CipherData>     <EncryptionProperties>?   </EncryptedData>




Web Services Security
Web Services Security
ISBN: 0072224711
EAN: 2147483647
Year: 2003
Pages: 105
Authors: Mark ONeill

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net