Any encrypt / decrypt can be broken if the person devotes enough time to it. However the average person may take a look at the DBF file and give up at that point. That being in mind, here is a simple routine to encrypt / decrypt each individual field in a DBF file on the fly:
*!*************************************************
*!
*! Function: X_ENCRYPT()
*!
*!*************************************************
FUNCTION x_encrypt(cstring)
LOCAL cnewstring, I
cnewstring := ''
FOR I := 1 TO LEN(cstring)
cnewstring += CHR(2*(I+ASC(SUBSTR(cstring, I, 1))))
NEXT
RETURN(cnewstring)
*!*************************************************
*!
*! Function: X_DECRYPT()
*!
*!*************************************************
FUNCTION x_decrypt(cstring)
LOCAL cnewstring, I
cnewstring := ''
FOR I := 1 TO LEN(cstring)
cnewstring += CHR(( ASC(SUBSTR(cstring, I, 1)) / 2 )-I)
NEXT
RETURN(cnewstring)
NOTE: This routine does not require a password.
This will at least discourage anyone from casual browseing your data. If anyone has additional or better routines to post, then please do.
Thanks
Steve