FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Blowfish encryption issue - key too long
Posts: 223
Joined: Thu Dec 01, 2005 03:34 PM

Blowfish encryption issue - key too long

Posted: Thu Dec 05, 2013 02:24 PM

When encrypting a dbf field, hb_blowfishkey() creates an encryption key that is 4168 bytes long. This causes the encryption and decryption processes to be extremely time consuming. For example, I have 23 fields in a dbf that take about 5 minutes to encrypt/decrypt per 1000 records. I see that RSA and other encryption systems generally use encryption keys that are only 128 BITS (not bytes) long, and so are much faster to process.

Is there a way to set the size of the encryption key in Blowfish to make it a much shorter length so it will process faster?

  • Roger
Posts: 223
Joined: Thu Dec 01, 2005 03:34 PM

Re: Blowfish encryption issue - key too long

Posted: Thu Dec 05, 2013 06:38 PM
Here is some test code that shows the problem:

Code (fw): Select all Collapse
Function BlowfishTest()

    local cBfKey := hb_blowfishKey( "fivewin" )

    MsgInfo(cBfKey,"cBfKey")

    Msginfo(LEN(cBfKey),"LEN(cBfKey)")    // I get len of 4168 bytes. Much too big!

return nil


I'm using FWH 13.08 and xHarbour.com 13.08 .
Posts: 223
Joined: Thu Dec 01, 2005 03:34 PM

Re: Blowfish encryption issue - key too long

Posted: Fri Dec 06, 2013 12:57 PM

I sent a private email to Przemek about this. He is the expert on Blowfish encryption for Harbour, and If he offers a solution, I'll post it here.

Continue the discussion