File Compare between MD5 hash and Regular File

  • Thread starter Thread starter TOI DAY
  • Start date Start date
T

TOI DAY

Hi All,

This is what I want to do.
Support I have two file name abc.txt, xyz.txt
I did created md5 hash for abc.txt and store it some directory

Here is how I create md5 for the abc.txt

FileStream file1 = new FileStream(abc.txt, FileMode.Open, FileAccess.Read);
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
md5.ComputeHash(file1);

byte[] hash = md5.Hash;
StringBuilder buff = new StringBuilder();
foreach (byte hashByte in hash)
{
buff.Append(String.Format("{0:X1}", hashByte));
}

Now I want to open the abc.txt file and do the binary compare with xyz.txt file.
Would someone show me how can I do it.

Thanks in advance
 
TOI said:
Hi All,

This is what I want to do.
Support I have two file name abc.txt, xyz.txt
I did created md5 hash for abc.txt and store it some directory

Here is how I create md5 for the abc.txt

FileStream file1 = new FileStream(abc.txt, FileMode.Open, FileAccess.Read);
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
md5.ComputeHash(file1);

byte[] hash = md5.Hash;
StringBuilder buff = new StringBuilder();
foreach (byte hashByte in hash)
{
buff.Append(String.Format("{0:X1}", hashByte));
}

Now I want to open the abc.txt file and do the binary compare with xyz.txt file.
Would someone show me how can I do it.

Thanks in advance

What does the MD5 hash have to do with the binary compare?

You got an answer about binary compares in this thread:


http://groups.google.com/[email protected]

Was it not good enough?
 
Back
Top