Sign in to follow this  
Followers 0
gto250

The MD5 in au3 and php

5 posts in this topic

The au3 code:

Global $_SHA1Opcode = '0xC86800005356576A006A006A008D459850E829000000FF7514FF750CFF75088D459850E88A0000006A006A008D459850FF7510E8490000005F5E5BC9C210005589E5538B5D08836314008363180083635C00C70301234567C7430489ABCDEFC74308FEDCBA98C7430C76543210C74310F0E1D2C383636000836364005B5DC210005589E55657FF750CE8850200008B7D088B750C6A0559A58A47FF8647FC8847FF8A47FE8647FD8847FEE2EB5F5E5DC210005589E55356578B5D08837D10007502EB59837B60007506837B640074076A018F4364EB468B4D108B7D0CEB3449518A078B735C8844331CFF435C83431408837B1400750EFF4318837B180075056A018F4364837B5C40750653E813000000475985C97406837B640074C25F5E5B5DC21000C84801005356578B5D086A10598D51FF89D7C1E7020FB6443B1CC1E018898495BCFEFFFF0FB6443B1DC1E010098495BCFEFFFF0FB6443B1EC1E008098495BCFEFFFF0FB6443B1F098495BCFEFFFFE2BD6A105A83FA5073288B8495B0FEFFFF3384959CFEFFFF33849584FEFFFF3384957CFEFFFFD1C0898495BCFEFFFF42EBD38B4D088B318B59048B51088B790C8B41108985B8FEFFFF8365FC00837DFC147D3C89D131F921D931F989F0C1C00501C80385B8FEFFFF8B4DFC03848DBCFEFFFF059979825A5089BDB8FEFFFF89D789D8C1C01E89C289F35EFF45FCEBBE6A148F45FC837DFC287D3A89D931D131F989F0C1C00501C80385B8FEFFFF8B4DFC03848DBCFEFFFF05A1EBD96E5089BDB8FEFFFF89D789D8C1C01E89C289F35EFF45FCEBC06A288F45FC837DFC3C7D4689D821F85089D021F889D921D109C15809C189F0C1C00501C80385B8FEFFFF8B4DFC03848DBCFEFFFF05DCBC1B8F5089BDB8FEFFFF89D789D8C1C01E89C289F35EFF45FCEBB46A3C8F45FC837DFC507D3A89D931D131F989F0C1C00501C80385B8FEFFFF8B4DFC03848DBCFEFFFF05D6C162CA5089BDB8FEFFFF89D789D8C1C01E89C289F35EFF45FCEBC08B4D088B0101F089018B410401D88941048B410801D08941088B410C01F889410C8B41100385B8FEFFFF89411083615C005F5E5BC9C204005589E55356578B5D08837B6400740431C0EB14837B6000750B53E80F0000006A018F436031C0405F5E5B5DC204005589E553578B5D088B7B5C83FF37762EC6443B1C8047EB06C6443B1C004783FF4072F5897B5C53E8B6FDFFFF8B7B5CEB06C6443B1C004783FF3872F5EB13C6443B1C8047EB06C6443B1C004783FF3872F5897B5C8B4318C1E81825FF0000008843548B4318C1E81025FF0000008843558B4318C1E80825FF0000008843568B431825FF0000008843578B4314C1E81825FF0000008843588B4314C1E81025FF0000008843598B4314C1E80825FF00000088435A8B431425FF00000088435B53E81EFDFFFF5F5B5DC20400'
Global  $_MD5Opcode = '0xC85800005356576A006A006A008D45A850E8280000006A00FF750CFF75088D45A850E8440000006A006A008D45A850FF7510E8710700005F5E5BC9C210005589E58B4D0831C0894114894110C70101234567C7410489ABCDEFC74108FEDCBA98C7410C765432105DC21000C80C0000538B5D088B4310C1E80383E03F8945F88B4510C1E0030143103943107303FF43148B4510C1E81D0143146A40582B45F88945F4394510724550FF750C8B45F88D44031850E8A00700008D43185053E84E0000008B45F48945FC8B45FC83C03F39451076138B450C0345FC5053E8300000008345FC40EBE28365F800EB048365FC008B45102B45FC508B450C0345FC508B45F88D44031850E84D0700005BC9C21000C84000005356576A40FF750C8D45C050E8330700008B45088B088B50048B70088B780C89D021F089D3F7D321FB09D801C1034DC081C178A46AD7C1C10701D189C821D089CBF7D321F309D801C7037DC481C756B7C7E8C1C70C01CF89F821C889FBF7D321D309D801C60375C881C6DB702024C1C61101FE89F021F889F3F7D321CB09D801C20355CC81C2EECEBDC1C1C21601F289D021F089D3F7D321FB09D801C1034DD081C1AF0F7CF5C1C10701D189C821D089CBF7D321F309D801C7037DD481C72AC68747C1C70C01CF89F821C889FBF7D321D309D801C60375D881C6134630A8C1C61101FE89F021F889F3F7D321CB09D801C20355DC81C2019546FDC1C21601F289D021F089D3F7D321FB09D801C1034DE081C1D8988069C1C10701D189C821D089CBF7D321F309D801C7037DE481C7AFF7448BC1C70C01CF89F821C889FBF7D321D309D801C60375E881C6B15BFFFFC1C61101FE89F021F889F3F7D321CB09D801C20355EC81C2BED75C89C1C21601F289D021F089D3F7D321FB09D801C1034DF081C12211906BC1C10701D189C821D089CBF7D321F309D801C7037DF481C7937198FDC1C70C01CF89F821C889FBF7D321D309D801C60375F881C68E4379A6C1C61101FE89F021F889F3F7D321CB09D801C20355FC81C22108B449C1C21601F289D021F889FBF7D321F309D801C1034DC481C162251EF6C1C10501D189C821F089F3F7D321D309D801C7037DD881C740B340C0C1C70901CF89F821D089D3F7D321CB09D801C60375EC81C6515A5E26C1C60E01FE89F021C889CBF7D321FB09D801C20355C081C2AAC7B6E9C1C21401F289D021F889FBF7D321F309D801C1034DD481C15D102FD6C1C10501D189C821F089F3F7D321D309D801C7037DE881C753144402C1C70901CF89F821D089D3F7D321CB09D801C60375FC81C681E6A1D8C1C60E01FE89F021C889CBF7D321FB09D801C20355D081C2C8FBD3E7C1C21401F289D021F889FBF7D321F309D801C1034DE481C1E6CDE121C1C10501D189C821F089F3F7D321D309D801C7037D'
        $_MD5Opcode &= 'F881C7D60737C3C1C70901CF89F821D089D3F7D321CB09D801C60375CC81C6870DD5F4C1C60E01FE89F021C889CBF7D321FB09D801C20355E081C2ED145A45C1C21401F289D021F889FBF7D321F309D801C1034DF481C105E9E3A9C1C10501D189C821F089F3F7D321D309D801C7037DC881C7F8A3EFFCC1C70901CF89F821D089D3F7D321CB09D801C60375DC81C6D9026F67C1C60E01FE89F021C889CBF7D321FB09D801C20355F081C28A4C2A8DC1C21401F289D031F031F801C1034DD481C14239FAFFC1C10401D189C831D031F001C7037DE081C781F67187C1C70B01CF89F831C831D001C60375EC81C622619D6DC1C61001FE89F031F831C801C20355F881C20C38E5FDC1C21701F289D031F031F801C1034DC481C144EABEA4C1C10401D189C831D031F001C7037DD081C7A9CFDE4BC1C70B01CF89F831C831D001C60375DC81C6604BBBF6C1C61001FE89F031F831C801C20355E881C270BCBFBEC1C21701F289D031F031F801C1034DF481C1C67E9B28C1C10401D189C831D031F001C7037DC081C7FA27A1EAC1C70B01CF89F831C831D001C60375CC81C68530EFD4C1C61001FE89F031F831C801C20355D881C2051D8804C1C21701F289D031F031F801C1034DE481C139D0D4D9C1C10401D189C831D031F001C7037DF081C7E599DBE6C1C70B01CF89F831C831D001C60375FC81C6F87CA21FC1C61001FE89F031F831C801C20355C881C26556ACC4C1C21701F289F8F7D009D031F001C1034DC081C1442229F4C1C10601D189F0F7D009C831D001C7037DDC81C797FF2A43C1C70A01CF89D0F7D009F831C801C60375F881C6A72394ABC1C60F01FE89C8F7D009F031F801C20355D481C239A093FCC1C21501F289F8F7D009D031F001C1034DF081C1C3595B65C1C10601D189F0F7D009C831D001C7037DCC81C792CC0C8FC1C70A01CF89D0F7D009F831C801C60375E881C67DF4EFFFC1C60F01FE89C8F7D009F031F801C20355C481C2D15D8485C1C21501F289F8F7D009D031F001C1034DE081C14F7EA86FC1C10601D189F0F7D009C831D001C7037DFC81C7E0E62CFEC1C70A01CF89D0F7D009F831C801C60375D881C6144301A3C1C60F01FE89C8F7D009F031F801C20355F481C2A111084EC1C21501F289F8F7D009D031F001C1034DD081C1827E53F7C1C10601D189F0F7D009C831D001C7037DEC81C735F23ABDC1C70A01CF89D0F7D009F831C801C60375C881C6BBD2D72AC1C60F01FE89C8F7D009F031F801C20355E481C291D386EBC1C21501F28B4508010801500401700801780C5F5E5BC9C20800C814000053E840000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008F45EC8B5D0C6A088D4310508D'
        $_MD5Opcode &= '45F850E8510000008B4310C1E80383E03F8945F483F838730B6A38582B45F48945F0EB096A78582B45F48945F0FF75F0FF75ECFF750CE831F8FFFF6A088D45F850FF750CE823F8FFFF6A1053FF7508E8050000005BC9C210005589E55156578B7D088B750C8B4D10FCF3A45F5E595DC20C00'
Global $_MD5CodeBuffer='',$_SHA1CodeBuffer='',$CodeBuffer

Dim $C_NONCE="AAB3238922BCC25A6F606EB525FFDC56"
Dim $fetion_no="572554551"
Dim $domain_fetion="fetion.com.cn"
Dim $fetion_pwd="123456"
Dim $NONCE="2811FF792CFE8F6E5CF947D25BE129CC"

;$h1=AE30B9BDD4F770B144315319D7EC129D php计算的到的

MsgBox(0,"",FetionEncryptPassWD())

Func FetionEncryptPassWD()
$key = Binary(_MD5($fetion_no&':'&$domain_fetion&':'&$fetion_pwd))
; $file=FileOpen("44.txt",18)
;$key=FileRead($file)
;MsgBox(0,"",$key)
                $h1 = StringUpper(MD5($key&':'&$NONCE&':'&$C_NONCE));
                Return $h1 ;
EndFunc

Func MD5($str_en)
        Return StringTrimLeft(_MD5($str_en),2)
    EndFunc
    
    



Func _MD5($Data)
    Local $CodeBuffer = DllStructCreate("byte[" & BinaryLen($_MD5Opcode) & "]")
    DllStructSetData($CodeBuffer, 1, $_MD5Opcode)

    Local $Input = DllStructCreate("byte[" & BinaryLen($Data) & "]")
    DllStructSetData($Input, 1, $Data)

    Local $Digest = DllStructCreate("byte[16]")

    DllCall("user32.dll", "none", "CallWindowProc", "ptr", DllStructGetPtr($CodeBuffer), _
                                                    "ptr", DllStructGetPtr($Input), _
                                                    "int", BinaryLen($Data), _
                                                    "ptr", DllStructGetPtr($Digest), _
                                                    "int", 0)

    Local $Ret = DllStructGetData($Digest, 1)
    $Input = 0
    $Digest = 0
    $CodeBuffer = 0
    Return $Ret
EndFunc

The php code

<?
$c=md5("572554551:fetion.com.cn:123456",true);
$h1= md5($c.':2811FF792CFE8F6E5CF947D25BE129CC:AAB3238922BCC25A6F606EB525FFDC56');
echo  $h1;
?>

Why the $h1 in au3 and php are different

Share this post


Link to post
Share on other sites



I think that AE30B9BDD4F770B144315319D7EC129D is incorrect. At least, according to this.

#include "MD5.au3"

Dim $C_NONCE="AAB3238922BCC25A6F606EB525FFDC56"
Dim $fetion_no="572554551"
Dim $domain_fetion="fetion.com.cn"
Dim $fetion_pwd="123456"
Dim $NONCE="2811FF792CFE8F6E5CF947D25BE129CC"

;$h1=AE30B9BDD4F770B144315319D7EC129D php?????

MsgBox(0,"",FetionEncryptPassWD())

Func FetionEncryptPassWD()
    Local $key = _MD5($fetion_no&':'&$domain_fetion&':'&$fetion_pwd)
    $key = BinaryToString($key)
    ConsoleWrite($key & @CRLF)

    Return StringTrimLeft(_MD5($key&':'&$NONCE&':'&$C_NONCE), 2)
EndFunc

Share this post


Link to post
Share on other sites

Thanks

It is my fault!

Global $_SHA1Opcode = '0xC86800005356576A006A006A008D459850E829000000FF7514FF750CFF75088D459850E88A0000006A006A008D459850FF7510E8490000005F5E5BC9C210005589E5538B5D08836314008363180083635C00C70301234567C7430489ABCDEFC74308FEDCBA98C7430C76543210C74310F0E1D2C383636000836364005B5DC210005589E55657FF750CE8850200008B7D088B750C6A0559A58A47FF8647FC8847FF8A47FE8647FD8847FEE2EB5F5E5DC210005589E55356578B5D08837D10007502EB59837B60007506837B640074076A018F4364EB468B4D108B7D0CEB3449518A078B735C8844331CFF435C83431408837B1400750EFF4318837B180075056A018F4364837B5C40750653E813000000475985C97406837B640074C25F5E5B5DC21000C84801005356578B5D086A10598D51FF89D7C1E7020FB6443B1CC1E018898495BCFEFFFF0FB6443B1DC1E010098495BCFEFFFF0FB6443B1EC1E008098495BCFEFFFF0FB6443B1F098495BCFEFFFFE2BD6A105A83FA5073288B8495B0FEFFFF3384959CFEFFFF33849584FEFFFF3384957CFEFFFFD1C0898495BCFEFFFF42EBD38B4D088B318B59048B51088B790C8B41108985B8FEFFFF8365FC00837DFC147D3C89D131F921D931F989F0C1C00501C80385B8FEFFFF8B4DFC03848DBCFEFFFF059979825A5089BDB8FEFFFF89D789D8C1C01E89C289F35EFF45FCEBBE6A148F45FC837DFC287D3A89D931D131F989F0C1C00501C80385B8FEFFFF8B4DFC03848DBCFEFFFF05A1EBD96E5089BDB8FEFFFF89D789D8C1C01E89C289F35EFF45FCEBC06A288F45FC837DFC3C7D4689D821F85089D021F889D921D109C15809C189F0C1C00501C80385B8FEFFFF8B4DFC03848DBCFEFFFF05DCBC1B8F5089BDB8FEFFFF89D789D8C1C01E89C289F35EFF45FCEBB46A3C8F45FC837DFC507D3A89D931D131F989F0C1C00501C80385B8FEFFFF8B4DFC03848DBCFEFFFF05D6C162CA5089BDB8FEFFFF89D789D8C1C01E89C289F35EFF45FCEBC08B4D088B0101F089018B410401D88941048B410801D08941088B410C01F889410C8B41100385B8FEFFFF89411083615C005F5E5BC9C204005589E55356578B5D08837B6400740431C0EB14837B6000750B53E80F0000006A018F436031C0405F5E5B5DC204005589E553578B5D088B7B5C83FF37762EC6443B1C8047EB06C6443B1C004783FF4072F5897B5C53E8B6FDFFFF8B7B5CEB06C6443B1C004783FF3872F5EB13C6443B1C8047EB06C6443B1C004783FF3872F5897B5C8B4318C1E81825FF0000008843548B4318C1E81025FF0000008843558B4318C1E80825FF0000008843568B431825FF0000008843578B4314C1E81825FF0000008843588B4314C1E81025FF0000008843598B4314C1E80825FF00000088435A8B431425FF00000088435B53E81EFDFFFF5F5B5DC20400'
Global  $_MD5Opcode = '0xC85800005356576A006A006A008D45A850E8280000006A00FF750CFF75088D45A850E8440000006A006A008D45A850FF7510E8710700005F5E5BC9C210005589E58B4D0831C0894114894110C70101234567C7410489ABCDEFC74108FEDCBA98C7410C765432105DC21000C80C0000538B5D088B4310C1E80383E03F8945F88B4510C1E0030143103943107303FF43148B4510C1E81D0143146A40582B45F88945F4394510724550FF750C8B45F88D44031850E8A00700008D43185053E84E0000008B45F48945FC8B45FC83C03F39451076138B450C0345FC5053E8300000008345FC40EBE28365F800EB048365FC008B45102B45FC508B450C0345FC508B45F88D44031850E84D0700005BC9C21000C84000005356576A40FF750C8D45C050E8330700008B45088B088B50048B70088B780C89D021F089D3F7D321FB09D801C1034DC081C178A46AD7C1C10701D189C821D089CBF7D321F309D801C7037DC481C756B7C7E8C1C70C01CF89F821C889FBF7D321D309D801C60375C881C6DB702024C1C61101FE89F021F889F3F7D321CB09D801C20355CC81C2EECEBDC1C1C21601F289D021F089D3F7D321FB09D801C1034DD081C1AF0F7CF5C1C10701D189C821D089CBF7D321F309D801C7037DD481C72AC68747C1C70C01CF89F821C889FBF7D321D309D801C60375D881C6134630A8C1C61101FE89F021F889F3F7D321CB09D801C20355DC81C2019546FDC1C21601F289D021F089D3F7D321FB09D801C1034DE081C1D8988069C1C10701D189C821D089CBF7D321F309D801C7037DE481C7AFF7448BC1C70C01CF89F821C889FBF7D321D309D801C60375E881C6B15BFFFFC1C61101FE89F021F889F3F7D321CB09D801C20355EC81C2BED75C89C1C21601F289D021F089D3F7D321FB09D801C1034DF081C12211906BC1C10701D189C821D089CBF7D321F309D801C7037DF481C7937198FDC1C70C01CF89F821C889FBF7D321D309D801C60375F881C68E4379A6C1C61101FE89F021F889F3F7D321CB09D801C20355FC81C22108B449C1C21601F289D021F889FBF7D321F309D801C1034DC481C162251EF6C1C10501D189C821F089F3F7D321D309D801C7037DD881C740B340C0C1C70901CF89F821D089D3F7D321CB09D801C60375EC81C6515A5E26C1C60E01FE89F021C889CBF7D321FB09D801C20355C081C2AAC7B6E9C1C21401F289D021F889FBF7D321F309D801C1034DD481C15D102FD6C1C10501D189C821F089F3F7D321D309D801C7037DE881C753144402C1C70901CF89F821D089D3F7D321CB09D801C60375FC81C681E6A1D8C1C60E01FE89F021C889CBF7D321FB09D801C20355D081C2C8FBD3E7C1C21401F289D021F889FBF7D321F309D801C1034DE481C1E6CDE121C1C10501D189C821F089F3F7D321D309D801C7037D'
        $_MD5Opcode &= 'F881C7D60737C3C1C70901CF89F821D089D3F7D321CB09D801C60375CC81C6870DD5F4C1C60E01FE89F021C889CBF7D321FB09D801C20355E081C2ED145A45C1C21401F289D021F889FBF7D321F309D801C1034DF481C105E9E3A9C1C10501D189C821F089F3F7D321D309D801C7037DC881C7F8A3EFFCC1C70901CF89F821D089D3F7D321CB09D801C60375DC81C6D9026F67C1C60E01FE89F021C889CBF7D321FB09D801C20355F081C28A4C2A8DC1C21401F289D031F031F801C1034DD481C14239FAFFC1C10401D189C831D031F001C7037DE081C781F67187C1C70B01CF89F831C831D001C60375EC81C622619D6DC1C61001FE89F031F831C801C20355F881C20C38E5FDC1C21701F289D031F031F801C1034DC481C144EABEA4C1C10401D189C831D031F001C7037DD081C7A9CFDE4BC1C70B01CF89F831C831D001C60375DC81C6604BBBF6C1C61001FE89F031F831C801C20355E881C270BCBFBEC1C21701F289D031F031F801C1034DF481C1C67E9B28C1C10401D189C831D031F001C7037DC081C7FA27A1EAC1C70B01CF89F831C831D001C60375CC81C68530EFD4C1C61001FE89F031F831C801C20355D881C2051D8804C1C21701F289D031F031F801C1034DE481C139D0D4D9C1C10401D189C831D031F001C7037DF081C7E599DBE6C1C70B01CF89F831C831D001C60375FC81C6F87CA21FC1C61001FE89F031F831C801C20355C881C26556ACC4C1C21701F289F8F7D009D031F001C1034DC081C1442229F4C1C10601D189F0F7D009C831D001C7037DDC81C797FF2A43C1C70A01CF89D0F7D009F831C801C60375F881C6A72394ABC1C60F01FE89C8F7D009F031F801C20355D481C239A093FCC1C21501F289F8F7D009D031F001C1034DF081C1C3595B65C1C10601D189F0F7D009C831D001C7037DCC81C792CC0C8FC1C70A01CF89D0F7D009F831C801C60375E881C67DF4EFFFC1C60F01FE89C8F7D009F031F801C20355C481C2D15D8485C1C21501F289F8F7D009D031F001C1034DE081C14F7EA86FC1C10601D189F0F7D009C831D001C7037DFC81C7E0E62CFEC1C70A01CF89D0F7D009F831C801C60375D881C6144301A3C1C60F01FE89C8F7D009F031F801C20355F481C2A111084EC1C21501F289F8F7D009D031F001C1034DD081C1827E53F7C1C10601D189F0F7D009C831D001C7037DEC81C735F23ABDC1C70A01CF89D0F7D009F831C801C60375C881C6BBD2D72AC1C60F01FE89C8F7D009F031F801C20355E481C291D386EBC1C21501F28B4508010801500401700801780C5F5E5BC9C20800C814000053E840000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008F45EC8B5D0C6A088D4310508D'
        $_MD5Opcode &= '45F850E8510000008B4310C1E80383E03F8945F483F838730B6A38582B45F48945F0EB096A78582B45F48945F0FF75F0FF75ECFF750CE831F8FFFF6A088D45F850FF750CE823F8FFFF6A1053FF7508E8050000005BC9C210005589E55156578B7D088B750C8B4D10FCF3A45F5E595DC20C00'
Global $_MD5CodeBuffer='',$_SHA1CodeBuffer='',$CodeBuffer

MsgBox(0,"",FetionEncryptPassWD())

Func FetionEncryptPassWD()
    Local $key = _MD5("572554551:fetion.com.cn:123456")
    $key = BinaryToString($key)
    ConsoleWrite($key & @CRLF)

    Return StringTrimLeft(_MD5($key&':2811FF792CFE8F6E5CF947D25BE129CC:AAB3238922BCC25A6F606EB525FFDC56'), 2)
EndFunc

Func _MD5($Data)
    Local $CodeBuffer = DllStructCreate("byte[" & BinaryLen($_MD5Opcode) & "]")
    DllStructSetData($CodeBuffer, 1, $_MD5Opcode)

    Local $Input = DllStructCreate("byte[" & BinaryLen($Data) & "]")
    DllStructSetData($Input, 1, $Data)

    Local $Digest = DllStructCreate("byte[16]")

    DllCall("user32.dll", "none", "CallWindowProc", "ptr", DllStructGetPtr($CodeBuffer), _
                                                    "ptr", DllStructGetPtr($Input), _
                                                    "int", BinaryLen($Data), _
                                                    "ptr", DllStructGetPtr($Digest), _
                                                    "int", 0)

    Local $Ret = DllStructGetData($Digest, 1)
    $Input = 0
    $Digest = 0
    $CodeBuffer = 0
    Return $Ret
EndFunc

The value of au3 return is CC4496CFD6EDD639CB581D43C7DFBA9A

but in PHP The result is 6b2669140fe9196cda8259e8e664a4c0

<?
$c=md5("572554551:fetion.com.cn:123456",true);
$h1= md5($c.':2811FF792CFE8F6E5CF947D25BE129CC:AAB3238922BCC25A6F606EB525FFDC56');
echo  $h1;
?>

Share this post


Link to post
Share on other sites

The encoding of the strings must be the same in PHP & AutoIt. PHP works with ASCII by default (unless you change the encoding of the php-file)

AutoIt uses Unicode-strings,. so you have to convert them to the ASCII-binary form before hashung:

#include<Crypt.au3>
Dim $C_NONCE="AAB3238922BCC25A6F606EB525FFDC56"
Dim $fetion_no="572554551"
Dim $domain_fetion="fetion.com.cn"
Dim $fetion_pwd="123456"
Dim $NONCE="2811FF792CFE8F6E5CF947D25BE129CC"

MsgBox(0,"",FetionEncryptPassWD($fetion_no, $domain_fetion, $fetion_pwd, $NONCE, $C_NONCE))

Func FetionEncryptPassWD($fetion_no, $domain_fetion, $fetion_pwd, $NONCE, $C_NONCE)
    Local $data = StringToBinary($fetion_no&':'&$domain_fetion&':'&$fetion_pwd, 1)
    Local $key = _Crypt_HashData($data, $CALG_MD5)
    $data = $key&StringToBinary(':'&$NONCE&':'&$C_NONCE, 1)
    Local $result = _Crypt_HashData($data, $CALG_MD5)
    Return Hex($result)
EndFunc

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Thanks

I‘ve get the right result

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0