Help with encryption routine
Posted: Thu Sep 08, 2005 8:50 pm
Hello,
I am relatively new to PHP and currently I am in the middle of migrating a small Web App developed in ASP.NET with C# to PHP 5.
My problem is that there is a small routine that encrypts passwords that I need to migrate over to PHP. The original code reads:
public static String Encrypt(String pValue)
{
byte[] aClearBytes = new UnicodeEncoding().GetBytes(pValue);
byte[] aHashedBytes = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(aClearBytes);
return(BitConverter.ToString(aHashedBytes));
}
I would really appreciayte it very much if you can help me translate this code over to PHP
Thanks a lot
BobbaFett_666
I am relatively new to PHP and currently I am in the middle of migrating a small Web App developed in ASP.NET with C# to PHP 5.
My problem is that there is a small routine that encrypts passwords that I need to migrate over to PHP. The original code reads:
public static String Encrypt(String pValue)
{
byte[] aClearBytes = new UnicodeEncoding().GetBytes(pValue);
byte[] aHashedBytes = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(aClearBytes);
return(BitConverter.ToString(aHashedBytes));
}
I would really appreciayte it very much if you can help me translate this code over to PHP
Thanks a lot
BobbaFett_666