Converting C# Hashing Routines to PHP
| From: | Jason Alexander | Date: | Tue, 02 Jan 2007 21:20:59 +0000 |
| Subject: | Converting C# Hashing Routines to PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-246377@lists.php.net to get a copy of this message | ||
Hey there,
I'm currently working on converting an ASP.NET, C# site/application to
PHP, and I've run into a small snag. The login algorithm hashes the
user passwords like so:
MD5 md1 = new MD5CryptoServiceProvider();
byte[] buffer1 = new ASCIIEncoding().GetBytes(stringToHash);
byte[] buffer2 = md1.ComputeHash(buffer1);
md1.Clear();
return Convert.ToBase64String(buffer2);
The challenge here is that in this conversion, I'm also migrating the
users over to a different system which uses a completely different
hashing mechanism. So, really, I need to be able to un-hash these
values, if that's even possible.
Thoughts? Options? I'm afraid this is one way hash, that I'm not going
to be able to do anything about, unfortunately.
TIA,
-Jason