DI Management Home > Cryptography > Extended Demo of Blowfish in Visual Basic 6

Extended Demo of Blowfish in Visual Basic 6

This is an extended demonstration showing more functions in David Ireland's adaptation of Bruce Schneier's Blowfish algorithm in classic Visual Basic 6. To download the source code, go to Blowfish: a Visual Basic version.

The first example is the same as the simple Blowfish VB Demo where a short ASCII string "Hello, world!" is padded and encrypted in ECB mode.

BlowfishEx Demo in VB

The second example is the same as above except CBC mode is used instead. Padding is carried out automatically by the blf_BytesEnc function and removed by blf_BytesDec

BlowfishEx Demo in VB

The last example shows how to carry out "raw" encryption - i.e. without padding the string - in Cipher Block Chaining (CBC) mode. This is Eric Young's test vector. Note how the plain text is entered in hex format so we can add non-printable null characters to the end of the string (to get this, enter the text into the 'Plain Text' box as normal, click on Encrypt, then copy and paste the hex characters from the 'PT Input' box).

Cipher Block Chaining mode

Note that if the padding option is set to "none", the plain text will be truncated to a multiple of 8 characters.

See also

Back to the Cryptography Page.

Contact us

To comment on this page or to contact us, please send us a message.

This page last updated 12 December 2019.