Sunday, August 28, 2005


IMPORTANT: The functions within this FLL have changed. Please refer to the latest documention for the VFP Encryption FLL that can be found at the following link:

http://www.sweetpotatosoftware.com/SPSBlog/PermaLink,guid,db662a8f-d47c-46c8-b0d2-a591c20d024b.aspx



As security concerns mount, developers and clients are looking at ways to encrypt/decrypt sensitive data and files. Visual FoxPro comes with a Crypto API example in the Solution Samples, but more than a few Visual FoxPro developers have been bitten when using this in distributed applications. I felt there were too many gotchas and, after running into my fair share of client systems that it didn't work on, I eventually gave up on it.

What I wanted was something extremely secure and reliable that was also very simple to use. So, I sat down and wrote an FLL that gives Visual FoxPro developers access to the Blowfish cipher (this is not a mini version of Blowfish, this is fullblown 16-Round based on work by Bruce Schneier & Jim Conge). Some good information is available at the links below for those of you that might not be familiar with Blowfish...

http://en.wikipedia.org/wiki/Blowfish_(cipher)

http://www.schneier.com/paper-blowfish-oneyear.html

16-round Blowfish is very secure, extremely fast when handling large amounts of data, and I like the idea of only having to write a few lines of code to get reliable encryption and decryption for my Visual FoxPro applications.

   SET LIBRARY TO LOCFILE("vfpencryption.fll")
   cEncryptedString = BFEncrypt("Credit Card #35823908523105009", "My_SeCuRe_PaSsWoRd_kEY")
   ? "Encrypted As: " + cEncryptedString
   cDecryptedString = BFDecrypt(cEncryptedString, "My_SeCuRe_PaSsWoRd_kEY")
   ? "Decrypted As: " + cDecryptedString


Files can also be encrypted, simply use STRTOFILE() and FILETOSTR() in conjunction with the above functions. I'll be adding native file encryption/decryption and more encryption algorithms to this FLL in the coming months. The eventual goal is to provide a number of security enhancements for Visual FoxPro, this FLL is just the humble beginning of a much bigger plan. Here's the download link where you can get the vfpencryption.fll and try out the example code above.

Download the vfpencryption.fll (9 KB approx.)

Sunday, August 28, 2005 10:48:13 AM (Central Daylight Time, UTC-05:00)  #    Comments [2]
Monday, December 05, 2005 10:52:48 PM (Central Standard Time, UTC-06:00)
Thanks Craig !!

You can find the Spanish version of this article at (Puede encontrar la versión en Español de este artículo en:)

http://www.portalfox.com/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=98

Regards / Saludos,

Ana
www.amby.net
www.PortalFox.com

Tuesday, May 30, 2006 6:19:15 PM (Central Daylight Time, UTC-05:00)
I'm trying to get vfpencryption.fll working with the example of your page and I get the following message:

"The file 'bfencrypt.prg' doesn´t exists"

I'm testing with VFP 8 and VFP 6
Alberto G.GARCÍA CANO
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u)  

Enter the code shown (prevents robots):


 

Archive

<November 2008>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456