Blowfish

BlitzMax Forums/BlitzMax Programming/Blowfish

Queller(Posted 2007) [#1]
Fun with a fast encryption algorithm...

So I was looking for an encryption algorithm for a custom server suite I am working on. It needed to be fast, in-line and relatively secure. After scouring the forums trying to find something, I got sick of searching and converted this from a C source. I thought I'd share it with you.

I made it into a type so multiple instances of Blowfish could be attached to clients connecting to a server, specifically, updating each client using the connection list to send/receive and process a few data chunks every cycle.

First, the include...



Then something to play with...



Does anyone have suggestions for optimization of the Blowfish code? I would appreciate any help offered.


Filax(Posted 2007) [#2]
Great ! i like it :)


Queller(Posted 2007) [#3]
I am thinking of making an encryption suite. It would have Blowfish, of course, Rijndael, RSA-2048 and Whirlpool, a hashing algorithm. They would be the raw algorithms for general use, as opposed to the typed version I fiddled with as above. I have a project that might use them, and I will make these available if there is enough interest. If not then I will not bother.


xlsior(Posted 2007) [#4]
I'm interested.


Filax(Posted 2007) [#5]
I want it ! :) for sure !


TartanTangerine (was Indiepath)(Posted 2007) [#6]
or just open an https connection to the server?


Queller(Posted 2007) [#7]
Indiepath, what?? I am not sure I understand what you mean.

The idea behind the algorithms, for my purposes, is to deal with server-side operations only, for now at least.

The algorithms can be used to encrypt media, audio streams etc and doesn't even have to be network related, ie. the likes of https. Blowfish, as an example, is awesome for fast in-line encryption. I have played with scrambling VOIP packets and it works so fast its as if en/decryption isn't even happening!


Queller(Posted 2007) [#8]
Here is the untyped version of Blowfish.