Blowfish Encryption Componet

Everything else that doesn't fall into one of the other PB categories.
kake26
Enthusiast
Enthusiast
Posts: 157
Joined: Sun Jan 25, 2004 7:21 pm
Contact:

Blowfish Encryption Componet

Post 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.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

it would be cool to have it as an userlib :)
kake26
Enthusiast
Enthusiast
Posts: 157
Joined: Sun Jan 25, 2004 7:21 pm
Contact:

Post 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.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

ok thanks.
kake26
Enthusiast
Enthusiast
Posts: 157
Joined: Sun Jan 25, 2004 7:21 pm
Contact:

Post by kake26 »

Nope it cannot be converted. Sorry.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

ok anyway, i dont know if others are interested, but i would like to have the dll.
kake26
Enthusiast
Enthusiast
Posts: 157
Joined: Sun Jan 25, 2004 7:21 pm
Contact:

Post 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))
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

thanks :)

will have a look at it :)
kake26
Enthusiast
Enthusiast
Posts: 157
Joined: Sun Jan 25, 2004 7:21 pm
Contact:

Post by kake26 »

Oh, its binary safe, the file encryption. It will not harm binary data.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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
@}--`--,-- A rose by any other name ..
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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.
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post 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
kake26
Enthusiast
Enthusiast
Posts: 157
Joined: Sun Jan 25, 2004 7:21 pm
Contact:

Post 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.
kake26
Enthusiast
Enthusiast
Posts: 157
Joined: Sun Jan 25, 2004 7:21 pm
Contact:

Post 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
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post 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
Post Reply