Sign in to follow this  
Followers 0
SomeoneHere

DllCall/Open (Blowfish Encryption .dll)

6 posts in this topic

#1 ·  Posted (edited)

sup everyone... ok so i found this site . . .

http://www.cryptosys.net/manapi/api_BLF_BytesMode.html

and i'm trying to do that sample encryption in AutoIt, but i'm not getting the same results . . .

$dll = DllOpen("diCryptoSys.dll")

    MsgBox(0,"",$dll)

    $strInput = "0123456789ABCDEF"
    $strKey = "FEDCBA9876543210"
    $sCorrect = "0ACEAB0FC6A0A28D"
    ; Set strOutput to be same length as strInput
    $strOutput = String(StringLen($strInput))

    ConsoleWrite("KY= " & $strKey & @CR)
    ConsoleWrite("PT= " & $strInput & @CR)
    ; Encrypt in one-off process
    $nRet = DllCall($dll, "long", "BLF_Hex", "String", $strOutput, "String", $strInput, "String", $strKey, "Boolean", True)
    ConsoleWrite("CT= " & $strOutput & @CR)
    ConsoleWrite("OK= " & $sCorrect & @CR)

    ; Now decrypt back to plain text
    $strInput = $strOutput
    $nRet = DllCall($dll, "long", "BLF_Hex", "String", $strOutput, "String", $strInput, "String", $strKey, "Boo", False)
    ConsoleWrite("P'= " & $strOutput & @CR)

the results i get are...

KY= FEDCBA9876543210

PT= 0123456789ABCDEF

CT= 16

OK= 0ACEAB0FC6A0A28D

P'= 16

i'm not sure what the problem is... i put the diCryptoSys.dll in the same folder . . . Edited by SomeoneHere

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If i'm not mistaken, DllOpen("diCryptoSys.dll") refers to "C:\Windows\System32\diCryptoSys.dll". Try putting in the full path of the dll (@ScriptDir & "\diCryptoSys.dll").

Edited by dantay9

[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

If i'm not mistaken, DllOpen("diCryptoSys.dll") refers to "C:\Windows\System32\diCryptoSys.dll". Try putting in the full path of the dll (@ScriptDir & "\diCryptoSys.dll").

the problem isn't that it doesn't find the DLL (i checked it returns a value of 1)... it's somethine else which i don't know

Share this post


Link to post
Share on other sites

the problem isn't that it doesn't find the DLL (i checked it returns a value of 1)... it's somethine else which i don't know

Did you write the code from the first post?

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Did you write the code from the first post?

yes, it was my attempt at converting VB6 to AutoIt... which i "think" there's no errors in, or at least can't find it? :D

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

yes, it was my attempt at converting VB6 to AutoIt... which i "think" there's no errors in, or at least can't find it? :D

Try this:

$hDLL = DllOpen("diCryptoSys.dll")

$sInput = "0123456789ABCDEF"
$sKey = "FEDCBA9876543210"
$sCorrect = "0ACEAB0FC6A0A28D"

ConsoleWrite("KY= " & $sKey & @CRLF)
ConsoleWrite("PT= " & $sInput & @CRLF)

$aCall = DllCall($hDLL, "int", "BLF_Hex", "str", "", "str", $sInput, "str", $sKey, "int", 1)
; ...check for errors here...

$sOutput = $aCall[1]

ConsoleWrite("CT= " & $sOutput & @CRLF)
ConsoleWrite("OK= " & $sCorrect & @CRLF)

$sInput = $sOutput

$aCall = DllCall($hDLL, "int", "BLF_Hex", "str", "", "str", $sInput, "str", $sKey, "int", 0)
; ...check for errors here...

ConsoleWrite("P'= " & $aCall[1] & @CRLF)
Edited by trancexx

♡♡♡

.

eMyvnE

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