XML encryption security overview
XML encryption can be used to assure data confidentiality of transmitted messages. You can encrypt an entire message or choose to encrypt only certain elements of the message. However, using XML encryption (either separately from XML digital signatures or in conjunction) can have potential security implications.
When you use public key cryptography, XML encryption ensures message confidentiality but it does not ensure message integrity because the receiver key is public. The following are best practices when using XML encryption.
- Use XML encryption with digital signatures to ensure the identity of the sender.
- Within a message, you can keep data elements confidential by encrypting the elements by using a strong encryption cipher with an adequate key length to deter brute forcing.
- Encrypt messages that contain sensitive data with a strong encryption cipher (either with transport encryption or message encryption, or both).
- Encrypt messages that contain sensitive data (and must remain encrypted at rest after the message is received) with strong data encryption (not transport encryption).
- Super-encrypting is the process of encrypting an EncryptedData element. An XML document can contain zero or more EncryptedData elements. An EncryptedData element cannot be the parent or child of another EncryptedData element. However, the actual data encrypted in the element can be anything, including EncryptedData and EncryptedKey elements. During super-encryption of an EncryptedData or EncryptedKey element, you must encrypt the entire element.
- Encrypted keys or data can identify a key that is required for decryption by identifying the corresponding key that is used for encryption with a security token. You do not need to specify a trust path or the specific contents of the certificate to identify the decryption key.