how the account password encrypted??

Results 1 to 1 of 1
  1. #1
    Account Upgraded | Title Enabled! Aku_ya_aku is offline
    MemberRank
    Dec 2009 Join Date
    IndonesiaLocation
    231Posts

    how the account password encrypted??

    anyone know how the account password or passphrase encrypted..
    i'm trying this code on php
    Code:
    	$username = $_GET['username'];
    	$password = md5($_GET['password']);
    	$query = register($username, $password);
    
    	function connect_mssql(){
    		$host = "127.0.0.1, 1433";
    		$user = "sa";
    		$pass = "xxxxxx";
    		mssql_connect($host,$user,$pass) or die ("Can't connect to db");
    	}
    	function register($username, $password){
    		connect_mssql();
    		$sql = "INSERT INTO DNMembership.dbo.Accounts 
    		(AccountName, AccountLevelCode, CharacterCreateLimit, CharacterMaxCount, PublisherCode, RegisterDate, Passphrase) 
    		VALUES 
    		('$username', '100', '4', '4', '4', GETDATE(), (CONVERT (binary(20),'$password')))";
    		$query = mssql_query($sql);
    		return $query;
    	}
    but still not work

    i also found some hash function in sqlserver

    first
    Code:
    ALTER FUNCTION [dbo].[FN_HashPassphrase](
    	@vchPassphrase varchar(12),
     @IntAccountID int
    )
    RETURNS binary(20)
    AS
    BEGIN
    	RETURN (
    		HASHBYTES('SHA1', '818719D11B0B41CA80C22F5D9901E92B' + STR @IntAccountID, 10) + @vchPassphrase)
    	);
    END
    second
    Code:
    ALTER FUNCTION [dbo].[FN_HashPassphrase2](
    	@vchPassphrase varchar(12),
     @IntAccountID int
    )
    RETURNS binary(20)
    AS
    BEGIN
    	RETURN (
    		HASHBYTES('md5',@vchPassphrase)
    	);
    END
    also when i'm register using P_AddAccount Stored Procedure the password always return empty in the Accounts table..




Advertisement