I’m working on an Android project which send datas to my Webservice and store them in my Database. I’m using a HTTP protocol to connect to my webservice. Using JSON for data format.
I send to the webservice the datas and the HASH (SHA256) of these datas.
Before storing the datas to the database, I verify by using HASH
if what I’ve sent (datas) equals to what The Webservice received. If not, I send
an error message.
Sometimes the values of the HASH are differents which cause an error message, and no datas storing in the database
So my question : Is there a another method to verify if the datas
aren’t altered during the sending operation?
The hash seems to work for your scenario, since you detect data modifications pretty well.
But a hash can be altered along with the data, so this is not a security measure against malicious attackers. If you’re concerned about security, you might be interested in WS-Security.
Essentially, you must either use an encrypted channel (HTTPS) or sign your message.