AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Blowfish encryption dll

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat
View previous topic :: View next topic  
Author Message
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Sat Jul 23, 2005 3:34 am    Post subject: Blowfish encryption dll Reply with quote

As most of you would know blowfish is a fast (used for bulk data too), very secure encryption with no known weakness. i was wondering if i could find a way to incorporate it in ahk scripts. i found a dll, which besides having enc/dec functions, also has a enckey function, a one way encryption that can be used to encrypt the pwd and then the encrypted pwd can be used to encrypt the data... more security!

now the problem part.... the dll doesn't return the data directly (atleast it didn't when i tried), probably because its written for mirc.

but the good part is that a well-commented source code is available with it... now i was wondering if somebody could look into it and fix it for ahk. not being a programmer, i can't do it.

here's a link to blowfish encryption dll : http://www.myfilestash.com/userfiles/rajat/blowfish.zip

maybe corrupt (programmer) or laszlo (encryption expert) could help.
_________________
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2402

PostPosted: Sat Jul 23, 2005 8:12 pm    Post subject: Reply with quote

Hi Rajat,

Thanks Smile , but I'm more of a "Basic" programmer (usually). I'd be glad to help if I can though... I haven't looked through the source code much yet (It does seem to load into Dev-C++ 4.9.9.2 ok though) but here's a guess at how to call the .dll (after a bit of trial and lots of errors) that seems to work ok. Maybe a starting point?...
Code:
VarSetCapacity(StrOut, 2048)

; Load the .dll for speed (optional, but might be improve speed if this
; is used in a function to encode a file one line at a time)
hModule := DllCall("LoadLibrary", "str", "blowfish.dll","UInt")
if !hModule
{
   MsgBox Error: Can't load DLL.
   Exit
}


; -- Here's a guess at the .dll's usage --
; The first string before space is the key to be used.
; The string after the first space is the string to be encrypted/decrypted
; The function will return the encrypted string to the same variable
; The first string in the variable will be the result of the call ( +OK if it worked ok )
; Return Value - seems to always return 3   
; Use of return value = unknown (returns crap ?)

; Preserve spacing
AutoTrim, Off

; Key to use for Encryption/Decryption (no spaces)
b_Key = MyTestKey

; String to encode
b_String := "  This is a test. Here is my test string. Interesting..."

MsgBox, Key to use: %b_Key%`nString to Encrypt: %b_String%

; String to use in the call (string enclosed in quotes in attempt to preserve spaces if any)
; key + space + string to encode
StrOut = %b_Key%%A_Space%"%b_String%"

; Call the function to encode & display output
Ret1 := DllCall("blowfish.dll\Encrypt", "str", "aircdll.dll", "str", "Encrypt", "str", StrOut, "Cdecl")
MsgBox, ErrorLevel: %ErrorLevel%`nReturnValue: %Ret1%`nStrOut variable: %StrOut%

; Remove +OK from the output
StringTrimLeft, StrOut, StrOut, 4

; String to use to decode (key + space + encoded string)
StrOut = %b_Key%%A_Space%%StrOut%

; Call the function to decode & display output
Ret1 := DllCall("blowfish.dll\Decrypt", "str", "aircdll.dll", "str", "Decrypt", "str", StrOut, "Cdecl")
; Remove +OK and left "
StringTrimLeft, StrOut, StrOut, 5
; Remove right "
StringTrimRight, StrOut, StrOut, 1
MsgBox, ErrorLevel: %ErrorLevel%`nReturnValue: %Ret1%`nStrOut variable: %StrOut%

; Free the library if LoadLibrary option was used
DllCall("FreeLibrary", "UInt", hModule)

; Don't preserve spacing
AutoTrim, On
Back to top
View user's profile Send private message Visit poster's website
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Sat Jul 23, 2005 9:26 pm    Post subject: Reply with quote

that's terrific help corrupt!! thanx a lot! Smile
that dll does have a li'l weird usage than standard!
_________________


Last edited by Rajat on Sat Jul 23, 2005 10:37 pm; edited 1 time in total
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2402

PostPosted: Sat Jul 23, 2005 10:23 pm    Post subject: Reply with quote

You're welcome Smile . I'd be interested to see what you come up with using this .dll ...
Back to top
View user's profile Send private message Visit poster's website
dandy



Joined: 09 May 2007
Posts: 45

PostPosted: Wed Dec 05, 2007 1:51 pm    Post subject: Reply with quote

the link to the dll is dead,can somebody reupload it? thanks
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 5890

PostPosted: Wed Dec 05, 2007 2:05 pm    Post subject: Reply with quote

Logon to GMAIL : http://mail.google.com/mail
username: ahkuser
password: ahkuser1

The inbox contains the DLL

Let me know if you have problems, and I can upload it for you.

Smile
Back to top
View user's profile Send private message
dandy



Joined: 09 May 2007
Posts: 45

PostPosted: Wed Dec 05, 2007 2:27 pm    Post subject: Reply with quote

got it,thanks!
Back to top
View user's profile Send private message
AHKnow



Joined: 03 Jul 2004
Posts: 118

PostPosted: Fri Dec 07, 2007 4:02 am    Post subject: AHKnow* Reply with quote

Skan wrote:
Logon to GMAIL : http://mail.google.com/mail
username: ahkuser
password: ahkuser1

The inbox contains the DLL

Let me know if you have problems, and I can upload it for you.

Smile


Why not just open an autohotkey.net ( http://www.autohotkey.net/ ) account and let people download it from there?
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 5890

PostPosted: Fri Dec 07, 2007 4:09 am    Post subject: Re: AHKnow* Reply with quote

AHKnow wrote:
Why not just open an autohotkey.net ( http://www.autohotkey.net/ ) account and let people download it from there?


You should ask rajat : http://www.autohotkey.com/forum/viewtopic.php?p=63466#63466
It is his account and he uploaded the DLL.

IMHO, on some instances where I am not sure about using autohotkey.net, this account can be useful.

Smile
Back to top
View user's profile Send private message
AHKnow



Joined: 03 Jul 2004
Posts: 118

PostPosted: Fri Dec 07, 2007 7:12 am    Post subject: Re: AHKnow* Reply with quote

Skan wrote:
AHKnow wrote:
Why not just open an autohotkey.net ( http://www.autohotkey.net/ ) account and let people download it from there?


You should ask rajat : http://www.autohotkey.com/forum/viewtopic.php?p=63466#63466
It is his account and he uploaded the DLL.

IMHO, on some instances where I am not sure about using autohotkey.net, this account can be useful.

Smile


I'm still confused. Maybe at that time Rajat had some reason for using g-mail, but in the year 2007, I'm not clear why.

http://www.autohotkey.net/file/index.php?act=reg (sign up)

I thought the point was to host Autohotkey related files. Logging into an e-mail account to get a file seems weird. Much better to post a link of where to download the file directly.
Back to top
View user's profile Send private message
rafleo



Joined: 16 Jul 2007
Posts: 42
Location: Bremen, Germany

PostPosted: Thu Dec 13, 2007 12:50 pm    Post subject: Reply with quote

The file contains a virus!

could someone please check it again? maybe it's just "antivir" being a fool...
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group