110 likes | 339 Views
XML Encryption. Xuemei Li Old Dominion University 11/02/2005. Outline. W3C XML encryption recommendation http://www.w3.org/TR/xmlenc-core/ Apache XML security http://xml.apache.org/security/index.html Demo XML encryption decryption. W3C Encryption Recommendation.
E N D
XML Encryption Xuemei Li Old Dominion University 11/02/2005
Outline • W3C XML encryption recommendation http://www.w3.org/TR/xmlenc-core/ • Apache XML security http://xml.apache.org/security/index.html • Demo • XML encryption • decryption
W3C Encryption Recommendation • W3C Recommendation 10 December 2002 • The data can be an XML document, an XML element, or XML element content. • The result of encrypting data is an XML Encryption EncryptedData element which contains or identifies (via a URI reference) the cipher data.
Encryption Syntax • <EncryptedData Id? Type? MimeType? Encoding?> <EncryptionMethod/>? <ds:KeyInfo> <EncryptedKey>? <AgreementMethod>? <ds:KeyName>? <ds:RetrievalMethod>? <ds:*>? </ds:KeyInfo>? <CipherData> <CipherValue>? <CipherReference URI?>? </CipherData> <EncryptionProperties>? </EncryptedData>
Sample XML Document • <PaymentInfo xmlns='http://example.org/paymentv2'> <Name>John Smith</Name> <CreditCard Limit='5,000' Currency='USD'> <Number>4019 2445 0277 5567</Number> <Issuer>Example Bank</Issuer> <Expiration>04/02</Expiration> </CreditCard> </PaymentInfo>
XML Document Encrypted with a Common Secret Key • <PaymentInfo xmlns='http://example.org/paymentv2'> <Name>John Smith</Name> <EncryptedData Type='http://www.w3.org/2001/04/xmlenc#Element' xmlns='http://www.w3.org/2001/04/xmlenc#'> <EncryptionMethod Algorithm='http://www.w3.org/2001/04/xmlenc#tripledes-cbc'/> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> <KeyName>John Smith</KeyName> </KeyInfo> <CipherData> <CipherValue>ydUNqHkMrD...</CipherValue> </CipherData> </EncryptedData> </PaymentInfo>
XML Document Encrypted with Encrypted Secret Key • <PaymentInfo xmlns='http://example.org/paymentv2'> <Name>John Smith</Name> <EncryptedData Type='http://www.w3.org/2001/04/xmlenc#Element' xmlns='http://www.w3.org/2001/04/xmlenc#'> <EncryptionMethod Algorithm='http://www.w3.org/2001/04/xmlenc#tripledes-cbc'/> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> <EncryptedKey xmlns='http://www.w3.org/2001/04/xmlenc#'> <EncryptionMethod Algorithm='http://www.w3.org/2001/04/xmlenc#rsa-1_5' <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> <KeyName>Sally Doe</KeyName> </KeyInfo> <CipherData> <CipherValue>yMTEyOTA1M...</CipherValue> </CipherData> </EncryptedKey> </KeyInfo> <CipherData> <CipherValue>ydUNqHkMrD...</CipherValue> </CipherData> </EncryptedData> </PaymentInfo>
Apache XML Security Project • The WebSig project (in Europe) • Started in January 2000 and ended up in September 2001 • For XML Signature standard • Aimed at providing implementation of security standards for XML • Currently the focus is on the W3C standards
Apache XML Security Library • Two libraries are available • Java library • A mature Digital Signature implementation • Encryption is currently under development • C++ library • Functionality is more basic than that provided by the Java library
Demo • Using Apache XML Security library • Java API