Blowfish Encryption Componet
Blowfish Encryption Componet
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.
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.
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.
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))
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)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))
- NoahPhense
- Addict

- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
It can be converted easily.. he just doesn't want to make it availablePB 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.
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:NoahPhense wrote:It can be converted easily.. he just doesn't want to make it availablePB 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.
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
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.
Try freepascal.org or the IRC channel #fpc on freenode.netDare2 wrote:Hi kake26,kake26 wrote:Its not written in PB. To be percise its written inf FPC(Free Pascal).
OT (apologies) but do you know where there is a strong and currently active online community for Free Pascal? Something like these boards.
Thanks.
- NoahPhense
- Addict

- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
First, I never intended to put you on the defense, nor get your panties inkake26 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.
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


