Layer7 API Management

Expand all | Collapse all

Symmetric Encryption-Decryption of XML tags

Jump to Best Answer
  • 1.  Symmetric Encryption-Decryption of XML tags

    Posted 12-23-2016 10:02 AM

    Hi,

     

     I am facing issue in symmetric encryption-decryption of XML data. Below is the explanation:

     

    Input Data:

    <AXML><TAG1>ABC</TAG1><TAG2>DADASD</TAG2><TAG3>ASDQAED</TAG3></AXML>

    Step 1: Symmetrically encrypted it using tactical symmetric assertion with 16 bit key. Encryption algo it AES/CBC/PKCS5.

     

    While decrypting the encrypted values, received in Step1, using tactical symmetric assertion with same 16 bit key (used in Step 1), I am getting following output:

    AXMLTAG1ABC/TAG1TAG2DADASD/TAG2TAG3ASDQAED/TAG3/AXML

     

    However the expected output was the input data value itself. Please help. Am I missing any step in decryption or encryption?

     

    Thanks

     



  • 2.  Re: Symmetric Encryption-Decryption of XML tags
    Best Answer

    Posted 12-23-2016 11:43 AM
      |   view attached

    Siddharth,

     

    Good afternoon. The encryption and decryption of the Symmetrical assertion will interpret the XML element incorrect and will drop them so you need to base64 the data prior to encrypting and decode from base64 once you have completed the decryption. I've attached a sample policy that outlines how this can be done.

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support

    Attachment(s)