Link to home
Start Free TrialLog in
Avatar of Eduardo Fuerte
Eduardo FuerteFlag for Brazil

asked on

Could you point how to correctly use vfpencryption71.fll ?

Hi Experts

Could you point how to correctly use vfpencryption71.fll ?

The "in general"  strategy I planned is:
When an user logs the app with password and read a record it's automatically decrypted to be readed - just the record.
During the CRUD - the line remains decrypted.
After the register is encrypted and saved.

Is it a correct approach?

Reading the examples that came with the library, it's not very clear to me the encryption/ decryption operations:

Encryption:
1. Define a key (that could varies depending on the encryption method adopted)
2. Encrypt the value and save.

Decryption:
1. Give the user the decryption key when login the app.
2. Every  CRUD operation will use the key to decrypt what is needed.

Is it OK?

Could you give me an example on how to do this ?  (you could use whathever encryption/decryption method as you desires)

Sorry so basic doubts.

Thanks in advance.
SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Eduardo Fuerte

ASKER

Pcelba

It looks it will be a "baby steps" implementation - but necessary since confidential data is going to be inserted.

If it's not an abuse could you share a code from your own use to encrypt/ decrypt a variable content f.e. ?
The examples that gone in vfpencryption71.fll is hard to understand.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Pcelba

Really BITXOR()  looks to be an easy option, maybe the sufficient!
Avatar of jrbbldr
jrbbldr

Keep in mind - as Pavel has already said:  
You cannot encrypt the whole record at once.

Encryption/Decryption, no matter which approach you use (BITXOR or VFPEncryption), is done one field at a time.  

You retrieve a record, some of those fields may be Encrypted.
In order to make them readable, you have to Decrypt them one-by-one.
Sure you can SCAN/ENDSCAN through multiple records of a table, but you are still Encrypting/Decrypting each separate record's Encrypted field(s) one-at-a-time.

The more fields you have Encrypted in any given record, the more 'overhead' is needed to Decrypt them and once done, to Encrypt them again on the write back to the data table.   Typically you only Encrypt a few fields in any given record to keep things running smoothly and quickly.

Good Luck
Thank you for the help and guidance!
This

https://kevinragsdale.net/visual-foxpro-flls/

Is pretty good to gain concepts!