Questions tagged [xml-encryption]

XML Encryption, also known as XML-Enc, is a specification governed by a W3C recommendation, that defines how to encrypt the contents of an XML element.

The W3C XML Encryption standard specifies a process for encrypting data and representing the result in XML. The data may be arbitrary data (including an XML document), an XML element, or XML element content. The result of encrypting data is an XML Encryption EncryptedData element which contains (via one of its children's content) or identifies (via a URI reference) the cipher data.

When encrypting an XML element or element content the EncryptedData element replaces the element or content (respectively) in the encrypted version of the XML document.

When encrypting arbitrary data (including entire XML documents), the EncryptedData element may become the root of a new XML document or become a child element in an application-chosen XML document.

(source and further reading: http://www.w3.org/TR/xmlenc-core/)

21 questions
2
votes
0 answers

xml encryption of SOAP request in ruby

I need to consume a 3rd party SOAP webservice from a Rails 5 app running Ruby 2.3.x. The SOAP webservice requires the use of XML signatures and XML encryption on all requests/responses. There appear to be adequate ruby gems that add XML signatures…
carlos
  • 193
  • 8
2
votes
0 answers

xmlenc support in Python

I have a xml messaging based API written in Python. Now there is a need to support xmlenc (https://www.w3.org/TR/xmlenc-core/) and I see very little information over the web about how to bite the problem. Is there any hope for my cause? Like any…
McAbra
  • 2,212
  • 2
  • 18
  • 28
1
vote
0 answers

SamlTool Xml Decryption - Why won't this decrypt?

I have an xml file that I have encrypted with c# and Microsoft's EncryptedXml routines. The source is the SamlTool.com example response. The encrypted version is listed below, as well as the public and private keys. The SamlTool response…
user34314
  • 21
  • 4
1
vote
1 answer

Decrypting XML with asymmetric keys fails with InvalidCastException in .NET

Using .NET 4.6 I try to do the following: Load the key for decryption from a PFX file. Decrypt an XML document with the private key from the file above. My code is based on How to: Decrypt XML Elements with Asymmetric Keys from MSDN. CspParameters…
Robert Strauch
  • 9,213
  • 17
  • 79
  • 138
1
vote
1 answer

How to provide an initialization vector with XML Encryption Syntax

I encrypt my data with AES with a key and a random IV. This key I encrypt with RSA and include it in my EncryptedData as seen below. I need to include the IV too but how do I include it with XML Encryption Syntax as the KeyInfo element is already…
steros
  • 1,452
  • 1
  • 18
  • 54
1
vote
1 answer

How to [en|de]crypt XML using Xamarin.iOS?

I want to encrypt/decrypt some XML using Xamarin.iOS. In .NET this is done using the System.Security.Cryptography.Xml namespaces (and types) found in the System.Security.dll assembly. However the System.Security.dll assembly is not part of the…
Hâluk Yilmaz
  • 227
  • 5
  • 12
1
vote
1 answer

MTOM and WS-Security (in CXF)

I am using WS-Security (XML-Signature and XML-Encryption) in my Web Service. For larger, binary objects, I intend to use MTOM. From what I understood is that the binary data is referenced via something like this:
Frizz
  • 2,294
  • 6
  • 27
  • 42
1
vote
3 answers

CXF Web service client not encrypting the SOAP Request XML message

I am learning Webservice security . I am using CXF framework for that. I have developed one test service it will just double up the value whatever we sent. Based on this tutorial i have added the WS-Policy for XML encryption and signature. Then i…
Dilip
  • 889
  • 3
  • 13
  • 31
0
votes
0 answers

How to decrypt a xml EncryptedData element (saml2 response) encrypted with aes128-gcm

I'm receiving a SAML2 reponse with an EncryptedData element that looks like the xml block below. The data is encrypted with aes128-gcm. I need to decrypt the data. The closest I've come to a solution seems to be this code but I'm failing to provide…
Mathias Rönnlund
  • 2,868
  • 1
  • 26
  • 63
0
votes
1 answer

Problem encrypting XML using RijndaelManaged key

I am trying to encrypt an XML element in an XML document. I came across THIS MSDN DOC which shows an approach of how to do this. If I use the code "as is" in this doc, it works. However, this demo code does not fit my scenario, where I need to save…
Cleve
  • 973
  • 1
  • 9
  • 20
0
votes
1 answer

SAML 2 - openSAML - Sign and Encrypt Assertion

We are the IDP and we implemented SAML 2 using openSAML 3.2 library. We are integrating with one of our SPs and it works fine if we sign the assertion and encryption is disabled on our side. If we enable encryption then it fails with one of the…
Jack
  • 181
  • 2
  • 11
0
votes
1 answer

Decrypt signaturevalue from XML c#

I've signed a XML file to send with the proper securities but somehow the service I'm sending detects the file has an invalid signature (X.509 certificate validation it's ok). I've been searching if it's possible, once I have signed an specific XML,…
0
votes
0 answers

How to decrypt an XML encrypted document?

I have to decode an XML encrypted document. The relevant part is: TK
MichaelW
  • 1,078
  • 11
  • 22
0
votes
0 answers

XmlCipher: How to define additional algorithms?

I have to encrypt a xml message with a specific algorithm(http://www.tta.or.kr/2001/04/xmlenc#seed-cbc) and I want to use the org.apache.xml.security.encryption.XMLCipher class(xmlsec 1.5.6). I have tried to add the bouncycastle provider and have…
soilworker
  • 1,280
  • 14
  • 31
0
votes
1 answer

derive from foreign xml schema

This is an xml example I want to be able to validate with my selfmade schema. The whole EncryptedData part is actually syntax of the XML Encryption specification.
steros
  • 1,452
  • 1
  • 18
  • 54
1
2