File Compare between MD5 hash and Regular File

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
 
M

mikeb

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top