XML Encryption
XML Encryption
XML Encryption
XML Encryption
Debachudamani Prusti
Roll no:517cs1018
Web Service
Specifications
• WS-Addressing
• WS-Reliable Messaging
• WS-Policy Framework
• WS-Metadata Exchange
• WS-Security
• WS-Notification Framework
• WS-Eventing
Figure 7.1: Specifications and concepts of web service.
Security
Information needs to be secured from attacks
• Confidentiality- Concealment of sensitive information
• Integrity- Data must be updated/changed from the authorized body
• Availability- Data must be available to the authorized entity.
Security Specifications in SOA
• WS-Security
• WS-SecurityPolicy
• WS-Trust
• WS-SecureConversation
• WS-Federation
• Extensible Access Control Markup Language (XACML)
• Extensible Rights Markup Language (XrML)
• XML Key Management (XKMS)
• XML-Signature
• XML-Encryption
• Security Assertion Markup Language (SAML)
• .NET Passport
• Secure Sockets Layer (SSL)
• WS-I Basic Security Profile
Encryption
P= Plain Text= Message= Readable format
C= Cipher Text= Cryptic Text= Unreadable format
Encipherment= Encryption= E(P)= C
Decipherment= Decryption= D(C)= D(E(P))= P
Some Encryption Algorithms are:
a) Private Key encryption
b) Public Key encryption
c) Digital Signature
d) Hashing
XML Encryption
• Defines how to encrypt the contents of an XML element
// get algorithm
String algo =
XMLCipher.TRIPPELDES_KeyWrap;
// construct XMLCipher
XMLCipher c = XMLCipher.getInstance(algo);
Step by step encryption
3: Generate encryption key
4: Specify encryption algorithm
KeyGenerator kg =
KeyGenerator.getInstance(“DES”);
SecretKey sk = kg.generateKey();
XMLCipher keyCipher =
XMLCipher.getInstance(algo);
Key symmKey = //as in generate key
encryption key
keyCipher.init(XMLCipher.WRAP_MODE, symmKey);
EncryptedKey encryptedKey =
keyCipher.encryptKey(document, symmKey);
Step by step encryption
5: Initialize XMLCipher
XMLCipher xmlCipher =
XMLCipher.getInstance(XMLCipher.AES_128)
xmlCipher.init(XMLCipher.ENCRYPT_MODE,
symmKey);
6: encryption
EncryptedData d = xmlCipher.getEncryptedData();
KeyInfo keyInfo = new KeyInfo(document);
keyInfo.add(encryptedKey);
d.setKeyInfo(keyInfo);
Steps involved in Decryption
1: Get the element that need to be decrypted
3: Decrypt