[MonoTouch] MD5.Create() appears to no longer work

Kevin Daly kevindaly at xtra.co.nz
Sat Oct 3 19:27:31 EDT 2009


I realise MD5 is not secure, but some services still use it so it's
something we have to deal with.
So I was wondering if anyone has any info that could throw light on the
following:

This was previously working in the Beta version of MonoTouch:

MD5 md5 = MD5.Create();

byte[] buffer = md5.ComputeHash(new
UTF8Encoding().GetBytes(login.Password.Text));
(followed by a loop through a StringBuilder that we won't worry about here)

...It  now produces a null reference exception.
I've established that the md5 variable is the problem: after the
MD5.Create() it's still null.

As I said, this was working before.

Oddly enough, I *did* (after I started writing this) find a workaround
(although not ideal) while experimenting: "MD5 md5 = new
MD5CryptopServiceProvider()" still works.

So something appears to have happened to the MD5.Create method.
Very strange - it doesn't look like something that would be by design.



More information about the MonoTouch mailing list