views:

119

answers:

4

Hi,

(under asp.net enviro)

I will be sending data to a central server via a web service, and I want to hash the data to ensure that it didn't get corrupted during transfer.

Which hash method should I use? Can I hash when the web service is passing objects?

+2  A: 

Preferably use SHA1. You can also use MD5.

smink
A: 

I'd recommend just calling GetHashcode() on the byte array of your data. Send this value as part of the webservice call and verify that they match on the other side.

Mike Brown
+4  A: 

I would recommend using WCF is you have a situation where you might actually have a heavier traffic while requiring reliable transmission. It supports standard SOAP, Binary, etc.

It got all the bells and whistle you will need.

Cheers

Maxim
+2  A: 

You could also use Web Services Enhancements (WSE) 3.0 to sign your messages. The nice thing is that everything is built right in, so you won't have to do a whole ton of work.

There's a wide variety of turn-key security options, but it sounds like you would be the most interested in the AnonymousOverCertificate solution. For your implementation, you could define a couple of really simple policy files.

Bear in mind you'll need to use WSE 3.0 on both sides, though. (Client and server sides, that is.)

For more information, check out the link below. It gives a general overview of WSE 3.0.

What's New in Web Services Enhancements (WSE) 3.0

UnhipGlint