Hello, I'm looking for help to convert an ASCII MD5 hashed password into a Unicode MD5 hashed password?
For example, I'll use the string "password" .
When it's converted to an ascii byte array, I get a base64 encoded hash of X03MO1qnZdYdgyfeuILPmQ== When it's converted into a unicode byte array, I get a base64 encoded hash of sIHb6F4ew//D1OfQInQAzQ==
All my passwords are stored in an md5 hash that was applied to an ascii byte array, but I'm trying to migrate my application's user data to a system that stores password in an md5 hash that is applied a unicode byte array.
In case it's not clear, with the following C#code:
var passwordBytes = Encoding.ASCII.GetBytes("password");
var hashAlgorithm = HashAlgorithm.Create("MD5");
var hashBytes = hashAlgorithm.ComputeHash(passwordBytes);
My current system uses this, but the system I'm moving to has a different first line. It uses Encoding.Unicode.GetBytes.
Does anybody know how I can convert my passwords? From
X03MO1qnZdYdgyfeuILPmQ==
into
sIHb6F4ew//D1OfQInQAzQ==
I'm guessing the answer is that I can't.. the encoding is being done before the hashing, but I thought I'd inquire the bright minds of stackoverflow and see if anybody has a way.