by Roger Seiler » Mon Dec 09, 2013 3:50 pm
The advantages of the Blowfish encryption system (available in Harbour) are:
1. U.S. government regulations covering privacy and encryption rules (like HIPAA - the Health Insurance Portability and Accountability Act) have found Blowfish to be acceptable, along with a few other widely used and proven systems like DES (though it is being deprecated), RSA, RC5, IDEA and PGP. Other proprietary systems are UNACCEPTABLE under HIPAA unless certified by an independent encryption review agency. This is a key requirement for anyone providing any kind of software subject to the U.S. HIPAA law. The ability to comply with HIPAA rules are of huge importance for a broad range of software applications in the U.S.
2. Blowfish can be used for encrypting selected fields within a database instead of encrypting the entire database. By this method, memo fields and numeric fields can also be encrypted (with special functions used to specially format/unformat the data for encryption). Note that by using specific field encryption, each field gets its own unique hard coded password offering greater security than a single password for the entire database. By leaving fields unencrypted that are useful for statistical analysis of operations, the user can easily be provided with a system for creating adhoc reports on the fly in order to get timely insights into organizational performance. Also with this approach, it is easy to create a data browse offering multiple indexing capability to enable great flexibility in ways of viewing the data.
3. Blowfish is RDD independent. Whether using basic dbf, or some SQL implementation, or ADS, Blowfish can be used. Change the RDD, and no change is needed in the encryption-related coding.
Blowfish is a little quirky in that field data has to be presented to it in string lengths that are in some multiple of 8 bytes, so a dbf's field lengths may have to be changed a bit to work right, and special handling via special functions is needed to handle memo fields and numeric fields. The numeric data has to be converted to char before encryption and then after decryption, converted from char back to numeric. Memo data has to be divided into contiguous blocks of some multiple of 8 bytes, like 1024. In this way encrypted block1+block2+block3... get saved to the memo field. Decryption of the memo is just the reverse - the blocks are extracted, individually decrypted and then all of the memo's text put back together as one text string.
The one problem I've had with Blowfish so far, as I noted a few days ago, is that its implementation in Harbour requires a greatly excessive size for the encryption key - 4168 bytes, which causes extremely slow encryption/decryption performance. I've emailed Przemek (who provided the Blowfish C code to implement Blowfish in Harbour) to see if he could fix this, but so far have received no reply.