| View previous topic :: View next topic |
| Author |
Message |
Rajat
Joined: 28 Mar 2004 Posts: 1718
|
Posted: Sat Jul 23, 2005 3:34 am Post subject: Blowfish encryption dll |
|
|
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 |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2402
|
Posted: Sat Jul 23, 2005 8:12 pm Post subject: |
|
|
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
|
|
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1718
|
Posted: Sat Jul 23, 2005 9:26 pm Post subject: |
|
|
that's terrific help corrupt!! thanx a lot!
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 |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2402
|
Posted: Sat Jul 23, 2005 10:23 pm Post subject: |
|
|
You're welcome . I'd be interested to see what you come up with using this .dll ... |
|
| Back to top |
|
 |
dandy
Joined: 09 May 2007 Posts: 45
|
Posted: Wed Dec 05, 2007 1:51 pm Post subject: |
|
|
| the link to the dll is dead,can somebody reupload it? thanks |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5890
|
Posted: Wed Dec 05, 2007 2:05 pm Post subject: |
|
|
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.
 |
|
| Back to top |
|
 |
dandy
Joined: 09 May 2007 Posts: 45
|
Posted: Wed Dec 05, 2007 2:27 pm Post subject: |
|
|
| got it,thanks! |
|
| Back to top |
|
 |
AHKnow
Joined: 03 Jul 2004 Posts: 118
|
Posted: Fri Dec 07, 2007 4:02 am Post subject: AHKnow* |
|
|
| 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? |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5890
|
|
| Back to top |
|
 |
AHKnow
Joined: 03 Jul 2004 Posts: 118
|
Posted: Fri Dec 07, 2007 7:12 am Post subject: Re: AHKnow* |
|
|
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 |
|
 |
rafleo
Joined: 16 Jul 2007 Posts: 42 Location: Bremen, Germany
|
Posted: Thu Dec 13, 2007 12:50 pm Post subject: |
|
|
The file contains a virus!
could someone please check it again? maybe it's just "antivir" being a fool... |
|
| Back to top |
|
 |
|