|
||
|
|
#1 (permalink) |
|
Forum Novice
|
Hello all
I search a way to use website login sharing the same accounting information with runuo server. I saw password are crypted in SHA1 with RunUO2.0, but I can't get the same result with the SHA1 php crypt function ( sha1(string) ) Here is the crypt function of runuo : Code:
public static string HashSHA1( string phrase )
{
if ( m_SHA1HashProvider == null )
m_SHA1HashProvider = new SHA1CryptoServiceProvider();
if ( m_HashBuffer == null )
m_HashBuffer = new byte[256];
int length = Encoding.ASCII.GetBytes( phrase, 0, phrase.Length > 256 ? 256 : phrase.Length, m_HashBuffer, 0 );
byte[] hashed = m_SHA1HashProvider.ComputeHash( m_HashBuffer, 0, length );
return BitConverter.ToString( hashed );
}
Thanks |
|
|
|
|
|
#2 (permalink) |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,909
|
I havent looked at it for a while, but im pretty sure the string is the username + password. So you might trying that.
__________________
Useful links (Use them or die in a fire!!!): Ultimate Little Guide, C# Tutorials & Docs, RunUO Basic Scripts, Run UO How to..., Configure server for connections, Scripting for Dummies, Common Problem Solutions, FAQ Forum, RunUO Wiki, Basic Generics, Xml Tutorial |
|
|
|
|
|
#3 (permalink) |
|
Forum Novice
|
you're right, I found this this morning
![]() Works fine ![]() Just an example of script for testing (working, but it's not really good ) :Code:
$tocrypt = 'test';
$crypted = sha1($tocrypt, true);
$crypted_array = array();
echo $tocrypt.' => '.$crypted.'<br />';
for( $i=0; $i<strlen($crypted); ++$i) {
$crypted_array[$i] = $crypted[$i];
}
for( $i=0; $i<count($crypted_array); ++$i) {
echo bin2hex($crypted_array[$i]).'-';
}
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|