Re: .NET's CryptoStream vs Java's .update()

From: Brandon Bloom (BrandonBloom_at_discussions.microsoft.com)
Date: 11/20/04


Date: Fri, 19 Nov 2004 15:51:02 -0800

If I only call update once, the result is the same if I call the respective
Write once.
The updates/Writes are is 10 bytes, 16 bytes, 26 bytes respectively.

Thanks for offering your help

"Rob Teixeira" wrote:

> Two questions to help start troubleshooting this...
> 1) what happens if you update only once and then digest? Do you get the same
> result?
> 2) what is the size of the data for each update?
>
> -Rob Teixeira
>
> "Brandon Bloom" <BrandonBloom@discussions.microsoft.com> wrote in message
> news:1C8BF651-8087-4E21-9B17-683ED1FC203B@microsoft.com...
> > I am porting a Java application to .NET and came across a problem working
> > with .NET's MD5CryptoServiceProvider producing a different result from
> Java's
> > MessageDigest. I was hoping someone could help me as this as the only
> thread
> > I could find that tackled the subject directly:
> >
> >
> http://groups.google.com/groups?hl=en&lr=&c2coff=1&safe=off&threadm=OjHc2kP6DHA.3360%40tk2msftngp13.phx.gbl&rnum=5&prev=/groups%3Fq%3Dmd5%2B.hash%2Bcryptostream%26hl%3Den%26lr%3D%26c2coff%3D1%26safe%3Doff%26selm%3DOjHc2kP6DHA.3360%2540tk2msftngp13.phx.gbl%26rnum%3D5
> >
> > I have a Java application that calls MessageDigest.getInstance("MD5") and
> > then calls .update() three times on the MessageDigest instance returned.
> > Afterwards, .digest() is called. In my C# application I create a
> > MD5CryptoServiceProvider and CryptoStream as you suggested and call
> ..Write()
> > three times with the same information. After carefully checking all three
> > calls and the data passed to each numerous times (with the understanding
> that
> > Java uses signed bytes where as C# doesn't), I have found no differences,
> but
> > the C# version returns a different Hash from the .Hash property. Why? How
> can
> > I correct this?
> >
> > Any help would be greatly appreciated.
> >
> > Thank you for your time,
> > Brandon Bloom
>
>
>