You are doing it wrong.
If you really have XML file, read the file as is, into array of bytes, not string. It will make your code independent on encoding.
To compute MD5 has, uses the class
System.Security.Cryptography.MD5
. Yes, it is abstract, but you need to get the provider instance via its
factory method Create
, as shown in the code sample at the end:
https://msdn.microsoft.com/en-us/library/system.security.cryptography.md5%28v=vs.110%29.aspx[
^].
For the creation of
MD5
class instance, please see the method
Program.Main
.
—SA