Mansii,
Okay, I've played with it a bit, and have gotten it to work. The code I'm stealing here is from the Solutions Foundation class example, which you can take a look at as well, but it is pretty straight forward.
There are a number of ways that this API works. The two key being Stream, and Block encryption. The only difference between the two is, one encrypts based on the size of the item to be encrypted, and returns an encryption string the same length as the item. The other is Block encryption, and that always returns a block, regardless of how long the item is, as you specify the block size. The size of the block has to be at least the same size as the item to encrypt.
In this example:
* Determine if the API is installed and registered
*Put this in your Form's INIT.
IF !THIS._cryptapi.GetIsInstalled()
MESSAGEBOX('Crypto API is not installed properly. Ensure it is registered with your OS.')
RETURN .F.
CANCEL
ENDIF
* Put this on your Encrypt routine:
LOCAL lcEncryptedStream,lcPassword,lcKey
lcEncryptedStream = ''
lcPassWord = THIS.Parent.txtPassword.Value
lcKey = THIS.Parent.txtKey.Value
IF THISFORM._cryptapi.EncryptSessionStreamString(lcPassWord, lcKey, @lcEncryptedStream)
THIS.Parent.txtPassword.Value=""
THIS.Parent.txtPassword.Value = lcEncryptedStream
ELSE
MESSAGEBOX("Error: "+MESSAGE())
RETURN
ENDIF
It uses stream encryption. What you do is, create a form, and drop the _crypt.vcx onto the form. This will place the FFC (FoxPro Foundation Class) onto your form for use. (Or, you can create an instance of it in code, if you're not using a form).
Next, on whatever "Magic" function you'll use to encrypt the data (like a click event on a button), the above example encrypts a string of text when the Encrypt button is clicked. The parameters passed to the _cryptapi give it the string to encrypt a "Password" used to encrypt/decrypt the value, and the type of operation to perform (stream encryption).
You can easily adapt this code to encrypt/decrypt fields in a table as they are read/written.
In the "Solutions" project (which you can run, and demonstarte how this works), there is also code on how to utilize it for public/private key encryption (as apposed to "Password"

, and how to do block encryption, among other things.
Now, unfortunatly, it is NOT a table level encryptor, so as I had speculated before, your field headings will still be visible in a brows window, though the data in your table will look like a jumbled mass of junk. Which, is in most cases, more than adequet.
Hope this sheds some light on the _crypt.vcx for you, Mansii. If you still have troubles, let me know, and I'll try to help some more.
Best Regards,
Scott
"Everything should be made as simple as possible, and no simpler."
![[hammer] [hammer] [hammer]](/data/assets/smilies/hammer.gif)