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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -