AutoHotkey Community

It is currently May 26th, 2012, 12:13 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Blowfish encryption dll
PostPosted: July 23rd, 2005, 3:34 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 23rd, 2005, 8:12 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2541
Hi Rajat,

Thanks :) , 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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 23rd, 2005, 9:26 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
that's terrific help corrupt!! thanx a lot! :)
that dll does have a li'l weird usage than standard!

_________________
Image


Last edited by Rajat on July 23rd, 2005, 10:37 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 23rd, 2005, 10:23 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2541
You're welcome :) . I'd be interested to see what you come up with using this .dll ...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2007, 1:51 pm 
Offline

Joined: May 9th, 2007, 8:13 am
Posts: 45
the link to the dll is dead,can somebody reupload it? thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2007, 2:05 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
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.

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2007, 2:27 pm 
Offline

Joined: May 9th, 2007, 8:13 am
Posts: 45
got it,thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject: AHKnow*
PostPosted: December 7th, 2007, 4:02 am 
Offline

Joined: July 3rd, 2004, 1:03 pm
Posts: 121
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.

:)


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


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: AHKnow*
PostPosted: December 7th, 2007, 4:09 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
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/viewtop ... 3466#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.

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: AHKnow*
PostPosted: December 7th, 2007, 7:12 am 
Offline

Joined: July 3rd, 2004, 1:03 pm
Posts: 121
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/viewtop ... 3466#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.

:)


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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2007, 12:50 pm 
Offline

Joined: July 16th, 2007, 3:00 pm
Posts: 46
Location: Bremen, Germany
The file contains a virus!

could someone please check it again? maybe it's just "antivir" being a fool...


Report this post
Top
 Profile  
Reply with quote  
PostPosted: August 23rd, 2010, 9:51 am 
http://www.dlldll.com/blowfish.dll_download.html


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 26th, 2011, 11:03 pm 
Hi, can anybody explain please, what an errorlevel -4 means.

And how i can fix that ?


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Uberi and 1 guest


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group