Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > Other

Other Discuss other languages or best practice coding here.

Reply
 
Thread Tools Display Modes
Old 02-14-2006, 11:13 AM   #1 (permalink)
Forum Expert
 
Join Date: Jan 2003
Posts: 564
Default Help trying to convert C# account crypto to PHP

Ok, i have a need to convert the way runuo crypto it's passwords...

Code:
		public static string HashPassword( string plainPassword )

		{

			if ( m_HashProvider == null )

				m_HashProvider = new MD5CryptoServiceProvider();



			if ( m_HashBuffer == null )

				m_HashBuffer = new byte[256];



			int length = Encoding.ASCII.GetBytes( plainPassword, 0, plainPassword.Length > 256 ? 256 : plainPassword.Length, m_HashBuffer, 0 );

			byte[] hashed = m_HashProvider.ComputeHash( m_HashBuffer, 0, length );



			return BitConverter.ToString( hashed );

		}
i have no knowledge about MD5CryptoServiceProvider... but i know how to create a MD5 hash using php with a string...

is it possible to create the same MD5 hash that C# creates using php?
__________________
UO Central: O Mistério do Oculto
(Free Shard Brasileiro)

brodock is offline   Reply With Quote
Old 02-14-2006, 11:23 AM   #2 (permalink)
Forum Expert
 
Courageous's Avatar
 
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
Default

MD5 is MD5. It is definitionally the same, whereever it is generated.
Courageous is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5