Search code examples
securitysoapencryptionksoap2android-ksoap2

ksoap2: how to ecrypt data or request


maybe question is stupid but.... i would like to know if exists a way to hide or encrypt data in a soap message. I want to prevent as much as possible classic problem about "man in the middle". So, i don't want "middle man" can understand my data. I thought about using an encryption function for merging all data of each element node with a symmetric key. And maybe it can be a solution, but my question is.... exists in ksoap a way to manage somekind of encryption/security ? If not, can you tell me a possible solution ?

Thx for your time


Solution

  • I agree with Thomas, if you are just worried about classical man in the middle attack, all you need is HTTPS.

    And some comments on terminology:

    Hash functions can't be used to encrypt data. They are one way functions, meaning that you can take a hash of data, but you can't get a data our of hash.

    If you have shared key and use it to encrypt data, this is called symmetric encryption.

    kSOAP2 is a SOAP library. It doesn't know about encryption.

    However, if you want to encrypt some particular piece of data, you can do it with other libraries/API and send it as part of SOAP message.