Copyright ©2001 W3C® (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply.
This document demonstrates the use of XML Encryption with SOAP.
This document is an informal proposal with no standing.
This scenario is akin to a cypherpunk anonymous remailer: I want to send Alice a secret message, but I don't want anyone to know I sent her that message and I know her email is being watched. What can I do? I know Bob can send Alice a message without much note, but I don't want him to read the secret message. So I encrypt my message to Alice in her key, and then I encrypt that and Alice's address to Bob. This can be chained such that I encrypt this and Bob's address in Carol's key, and send the message to her: For N hops, recipient [N-x] receives an encrypted message to send to [N-x-1].
In this example, I'm only sending my secret message to my recipient
(Alice) through a single hop (Bob). I'm also sending some header information
asking Bob to send the message within 5 days: he mi ght not send it out
immediately to confound traffic analysis -- though this information should be
encrypted just as well, but I want to use a env:Header
.
<env:Envelope xmlns:env="http://www.w3.org/2001/06/soap-envelope"> <env:Header env:actor="http://example.org/xmlsec/Bob"> <n:forward xmlns:n="http://example.org/xmlsec/forwarding"> <n:window>120</n:window> </n:forward> </env:Header> <env:Body> <env:Envelope xmlns:env="http://www.w3.org/2001/06/soap-envelope"> <env:Header env:actor="http://example.org/xmlsec/Alice"/> <env:Body> <secret xmlns="http://example.org/xmlsec/message"> The black squirrel rises at dawn</secret> </env:Body> </env:Envelope> </env:Body> </env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2001/06/soap-envelope"> <env:Header env:actor="http://example.org/xmlsec/Bob"> <n:forward xmlns:n="http://example.org/xmlsec/forwarding"> <n:window>120</n:window> </n:forward> </env:Header> <env:Body> <env:Envelope xmlns:env="http://www.w3.org/2001/06/soap-envelope"> <env:Header env:actor="http://example.org/xmlsec/Alice"/> <env:Body> <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Element"/> <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#3des-cbc"/> <ds:KeyInfo
xmlns:ds='http://www.w3.org/2000/09/xmldsig#'> <ds:KeyNam
e>Alice<ds:KeyNam
e> </ds:KeyInf
o> <CipherData><CipherValue>1DEADBEEF</CipherValue></CipherData> </EncryptedData> </env:Body> </env:Envelope> </env:Body> </env:Envelope>
The secret
to Alice has been encrypted in her key.
<env:Envelope xmlns:env="http://www.w3.org/2001/06/soap-envelope"> <env:Header env:actor="http://example.org/xmlsec/Bob"> <n:forward xmlns:n="http://example.org/xmlsec/forwarding"> <n:window>120</n:window> </n:forward> </env:Header> <env:Body> <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Element"/> <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#3des-cbc"/> <ds:KeyInfo
xmlns:ds='http://www.w3.org/2000/09/xmldsig#'> <ds:KeyNam
e>Bob<ds:KeyNam
e> </ds:KeyInf
o> <CipherData><CipherValue>2DEADBEEF</CipherValue></CipherData> </EncryptedData> </env:Body> </env:Envelope>
The SOAP Body
to Bob is encrypted in his key.
Questions