Page 1 of 5

Blowfish Encryption Componet

Posted: Sat Jul 31, 2004 1:59 am
by kake26
If anyone cares I've created a blowfish encryption componet. A small DLL that I will make avail to you guys. Does string and file encryption with 448 bit Blowfish. More to be added soon if anyone wants it lemme know I will upload and post a URL.

Posted: Sat Jul 31, 2004 8:23 am
by thefool
it would be cool to have it as an userlib :)

Posted: Sat Jul 31, 2004 3:16 pm
by kake26
Its not written in PB. To be percise its written inf FPC(Free Pascal). Which does generate ASM and compiles that, so I maybe able to make it a user lib. However, thats a huge if, but I'll take as stab at it. It a DLL and was designed that way so I can use it in may places. a Pure Lib restricts it to PB only. So you see how that conflicts with my design? Anyhow, I'll try it to make a PB lib version any way.

Posted: Sat Jul 31, 2004 3:18 pm
by thefool
ok thanks.

Posted: Sat Jul 31, 2004 3:30 pm
by kake26
Nope it cannot be converted. Sorry.

Posted: Sat Jul 31, 2004 3:35 pm
by thefool
ok anyway, i dont know if others are interested, but i would like to have the dll.

Posted: Sat Jul 31, 2004 4:57 pm
by kake26
ok, here is URL along with the definitions.
http://www.r-t-f-m.com/files/pb/blowfish/blowfish.dll

The DLL exports one function "strfunc" which accepts 3 parameters.

strfunc(func:pchar;buffer:pchar;key:pchar):pchar;

DO NOTE FPC PCHARS ARE STRINGS IN PB!!! I've included the PB binding below.

Code: Select all

OpenLibrary(255,"blowfish.dll")
*strfunc = IsFunction(255,"strfunc")
test.s = "Hello world"
func.s = "encstring"
pass.s = "rtfmisgod"
Debug PeekS(CallFunctionFast(*strfunc,func,test,pass))
; CallFunctionFast(*strfunc,"encstring","Hello world","blah") should work    ; too
CloseLibrary(255)
func can be one of the following.

1. encstring - encrypts string
2. decstring - decrypts string , remeber must be passed only encrypted strings
3. encfile - encrypts a file num 4 decrypts, "buffer" in this case is a full filename with path rather than a text string. Example "C:\pb\somefile.exe", but if the file is in the dir the app is in its enough t o
4. decfile - does the reverse of # 3

Anymore questions ask me. Oh, 1 & 2 return strings hence you may want to Result = Peeks(CallFunctionFast(*strfunc,func,test,pass))

Posted: Sat Jul 31, 2004 5:06 pm
by thefool
thanks :)

will have a look at it :)

Posted: Sun Aug 01, 2004 12:29 am
by kake26
Oh, its binary safe, the file encryption. It will not harm binary data.

Posted: Sun Aug 01, 2004 2:25 am
by Dare2
kake26 wrote:Its not written in PB. To be percise its written inf FPC(Free Pascal).
Hi kake26,

OT (apologies) but do you know where there is a strong and currently active online community for Free Pascal? Something like these boards.

Thanks. :D

Posted: Sun Aug 01, 2004 3:17 am
by PB
> Aug 01, 2004 00:16 -- "I maybe able to make it a user lib"
> Aug 01, 2004 00:30 -- "Nope it cannot be converted"

Come on, 14 minutes wasn't much of an attempt. :( Oh well.

Posted: Sun Aug 01, 2004 3:23 am
by NoahPhense
PB wrote:> Aug 01, 2004 00:16 -- "I maybe able to make it a user lib"
> Aug 01, 2004 00:30 -- "Nope it cannot be converted"

Come on, 14 minutes wasn't much of an attempt. :( Oh well.
It can be converted easily.. he just doesn't want to make it available
like that. You can download the blowfish source in vb and convert it
from there..

No sweat here.. got my own 'better' algo's.. ;)

- np

Posted: Sun Aug 01, 2004 4:17 am
by kake26
NoahPhense wrote:
PB wrote:> Aug 01, 2004 00:16 -- "I maybe able to make it a user lib"
> Aug 01, 2004 00:30 -- "Nope it cannot be converted"

Come on, 14 minutes wasn't much of an attempt. :( Oh well.
It can be converted easily.. he just doesn't want to make it available
like that. You can download the blowfish source in vb and convert it
from there..

No sweat here.. got my own 'better' algo's.. ;)

- np
@NoahPhense:
Then bloody tell me how! I've been on this again for hours. The libmaker looks for object files with weird names. I've tried to fool it no luck yet. And a PB lib was never part of my plan. I wanted a DLL/SO so I can use it from any lang and on *nix and win32. I choose FPC cause its a much more mature compiler thats very good and not as bloody annoying as C/C++. I've stated my intention's for this DLL before. So naturally, making it a PB would limit my intended span of usage. Oh, and yes I ported only one algo into a lib cause I only wanted blowfish. VB isn't worthy of PB, cause VB sucks and PB owns. When it comes down to doing things cross platform and efficiently PB isn't it for me. Not mature enough, but getting there. Oh, next time don't be so fast to judge. Oh and thank you for sharing that with the class.

Posted: Sun Aug 01, 2004 4:22 am
by kake26
Dare2 wrote:
kake26 wrote:Its not written in PB. To be percise its written inf FPC(Free Pascal).
Hi kake26,

OT (apologies) but do you know where there is a strong and currently active online community for Free Pascal? Something like these boards.

Thanks. :D
Try freepascal.org or the IRC channel #fpc on freenode.net

Posted: Sun Aug 01, 2004 4:19 pm
by NoahPhense
kake26 wrote:@NoahPhense:
Then bloody tell me how! I've been on this again for hours. The libmaker looks for object files with weird names. I've tried to fool it no luck yet. And a PB lib was never part of my plan. I wanted a DLL/SO so I can use it from any lang and on *nix and win32. I choose FPC cause its a much more mature compiler thats very good and not as bloody annoying as C/C++. I've stated my intention's for this DLL before. So naturally, making it a PB would limit my intended span of usage. Oh, and yes I ported only one algo into a lib cause I only wanted blowfish. VB isn't worthy of PB, cause VB sucks and PB owns. When it comes down to doing things cross platform and efficiently PB isn't it for me. Not mature enough, but getting there. Oh, next time don't be so fast to judge. Oh and thank you for sharing that with the class.
First, I never intended to put you on the defense, nor get your panties in
a bunch. I'm glad that you created something that you are sharing with
the community. I was mearly being straight with the people that were
interested in having this algorithm as a lib.

I misunderstood your posts, I had thought that you had created a PB DLL
and didn't know how to make it a PB Lib.. (which would have been kind
of silly).. not because of the C language factor, becuase I don't do C
myself.. I use TailBite, on my DLL's to make them libs.

Again, my apologies, I will now go grab the vb blowfish source and see
how 'fun' it would be to convert.

- np