c# - Validating a received file using a checksum -


i need pass file using web service (i have control on webservice). fulfill security requirements need make sure passed file not modified or corrupted. plan below.

  1. convert file byte[]
  2. calculate hash,

    system.security.cryptography.md5.create().computehash(stream);

  3. pass file

when passing file (byte array) web service, passing hash value practice?

or need follow other process check files? best way handle this?

if it's security requirement, sending md5 sum along file not want do: can intercept file can rewrite checksum well.

i use crcs, instead: more sensitive small changes in file (or stream's) contents, , more compact , easier compare. .net doesn't appear have crc implementation, found nice 1 online appears work well, calculating crc-32 in c# , .net.

does client have capability of computing checksum independently on side well?


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -