We help IT Professionals succeed at work.

300 pts for complete help

foxjax asked
I have downloaded several blowfish components from torry with source code such as DCP, etc.

However i really would like just the blowfish source code only instead of it all being mixed together as is the case with these packages.

So what i would want would be the source code and example of encrypting/decrypting a string with it.

I am using delphi 2.
Watch Question


A lots of good links .

And look for 'How to encrypt a String' sample project on this page.


Thanks ginsonic.  I had already checked out all of the links on the page you first suggested but to no avail.  The other web site you listed gives the code in C for a DLL - both of which i am not very good at.

I am really just looking for a plain delphi code version of blowfish with no added extras.  I want to both study the code so i can learn from it and perhaps write a better version once i learn more.

Then try http://www.multimania.com/sirius29/algos.html

A lots of algos , blowfish included ( 100% delphi code , I verify it )

I think that Cipher is what you wish ( source code and demo )

This is the web description:

A Compendium of various strong Encryption Algorithm, includes:
40 Ciphers (IDEA, Blowfish, Twofish, DES, Square ...)
23 Hashs (MD4/5, SHA/1, RipeMD, Havel, Tiger ...)
5 Checksums (CRC32, CRC16-CCITT, CRC16-Standard ...)
6 Textformats (MIME Base 64, XX/UU Coding, RFC1760 Six Word ...)
2 Randoms (LFSR Linear Feedback Shift Register with variable Period upto 2^2032-1 ...)
with Ciphers can be encrypt in Modes CTS/CBC/CFB/OFB/ECB
Ciphers supports Message Authentication Codes in CBC-MAC/CFB-MAC/CTS-MAC
fast Implementation (i.e. Blowfish > 8Mb/sec, MD4 > 27Mb/sec)
full and easy objectorientated
High optimized Assembler Core
Designtime Components to managing Cipher- and Hashclasses
Message Authentication Codes for all Hashs (Internet RFC2104-HMAC ...)
Internet RFC2289/RFC1760/RFC2444 One Time Password Routines as Component
Self Test Support for all Cipher-, Hash- and Checksumclasses
multiple cascading (chanining) from all Cipher-, Hash-, Random- and Compressionclasses
all Cipher-, Hash-, Randomclasses can be encrypt, decrypt, scramble and wipe any Inputs as String, Stream, File or Buffer in multiple chaining modes
detailed and full DEMO, Docus for implemented RFC


Thanks Ginsonic, the routine at http://www.multimania.com/sirius29/algos.html is the type of thing i was looking for except that i cannot work out how to pass a string to it to encrypt and decrypt.  The txt file with the routine gives an example but not for passing a string.  If you know of how i can do this or know of a similar routine that will accept a string the points are your.

The other listings you gave are all mainly "packages" of encryption code which is not really what i am looking for - i just want the single item rather than thousands of lines of code to read through.


Give me your address to send you a sample project .
I have an unit for DES and Blowfish , with good comment and full working sample for strings crypt/decrypt ( included text files ).


Thanks ginsonic.  The email address is foxjax@verballed.com - if the routines work then i shall award you the points and upload the units to a web page and place a link here for anyone else that buys this question in the future.

Read your mail.


Got it Ginsonic - only i cannot work out from the code how to pass a string and a password so i can encrypt the string and then decrypt it.

Got any ideas on this one?

What password ? The encryption key algorithm is in CipherBlock.pas .


sorry, but i am not sure how this one works.  I thought it would allow me to give it a password that i could pick and a string and it would do what it was supposed to do.  What is the point of having the key algorythm in the program - is that not less secure?

I have some lines to encrypt/decrypt a string using a specified password . But isn't BlowFish . Interesting you ?

If you still wish to use BlowFish then can use my codes for password ( crypt one ) and then crypt again with BlowFish ( crypt two ).


sorry for the delay ginsonic, i was unable to connect to EE for a while.

Yes, i am interested in the code - then i shall close this question and award the points to you with a grade A for all of your help.
Take your mail


thanks ginsonic for all of your help.  

Any time.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.