encrypting dbf files
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: encrypting dbf files
James,
are you using latest xHarbour from SVN? Can I see your linker configuration file?
EMG
are you using latest xHarbour from SVN? Can I see your linker configuration file?
EMG
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: encrypting dbf files
Hunter,
Another question.
Do you know if the SIX driver automatically securely erases the original unencrypted DBF after it encrypts the file? Or, maybe it is encrypted in place (there is no new encrypted copy made)?
James
Another question.
Do you know if the SIX driver automatically securely erases the original unencrypted DBF after it encrypts the file? Or, maybe it is encrypted in place (there is no new encrypted copy made)?
James
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: encrypting dbf files
Enrico,
Also using Borland 5.82.
ilink.cfg contains just this:
-L"c:\bcc582\lib"
I am using buildx.bat to build the test files.
Regards,
James
I am using FWH 13.04 with xHarbour 1.2.3 Intl. (SimpLex) (Build 20130326). I don't know if xHarbour is the latest version.are you using latest xHarbour from SVN? Can I see your linker configuration file?
Also using Borland 5.82.
ilink.cfg contains just this:
-L"c:\bcc582\lib"
I am using buildx.bat to build the test files.
Regards,
James
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: encrypting dbf files
Enrico,
Are you closing the file after encryption, then reopening it? I don't see that happening in your posted code. Maybe that is the issue.
James
Are you closing the file after encryption, then reopening it? I don't see that happening in your posted code. Maybe that is the issue.
James
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: encrypting dbf files
James,
I don't get the table POLIZZE.DBF encrypted. Can I see the sample you're using?
EMG
Tried. No changes. My current sample is:James Bott wrote:Enrico,
Are you closing the file after encryption, then reopening it? I don't see that happening in your posted code. Maybe that is the issue.
James
Code: Select all
FUNCTION MAIN()
USE POLIZZE EXCLUSIVE
? SX_DBFENCRYPT( "EMAG" )
? SX_TABLETYPE()
INKEY( 0 )
RETURN NIL
EMG
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: encrypting dbf files
Enrico,
This is working for me.
This is working for me.
Code: Select all
#include "fivewin.ch"
FUNCTION MAIN()
local cPassword:="EHAB"
USE xcustomer EXCLUSIVE // unencrypted source
copy to customer
use
use customer // unencrptyed test file
? SX_DBFENCRYPT( cPassword )
// you must close and then reopen the file
use
use customer
? SX_TABLETYPE()
msgInfo(company,"Company - encrypted")
Sx_SetPass(cPassword)
msgInfo(company,"Company - decrypted")
use
RETURN NIL
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: encrypting dbf files
James,
I found the culprit: it doesn't work with memo fields.
Can you confirm this?
EMG
I found the culprit: it doesn't work with memo fields.
Can you confirm this?
EMG
Re: encrypting dbf files
I'm very interested in this thread. However, we have some other considerations.
Many of us are now working with Harbour / MSVC 2012. Antonio has been encouraging people to move up to the newer compilers. The functions you are testing and working with are only valid with xHarbour.
James, you are using the old command style for testing these files, but how well will this work with data objects ?
Regarding ADS. That's a good option for those people who use the ADS Server. However, in my tests, I'm seeing much better performance on a network ( peer to peer ) when using DBFCDX instead of the ADS Local server. I have both available, so I technically could use the ADS option ( I think ), but then I may get performance hits from people using LOCAL.
I would appreciate if you would consider these issues as you discuss the options. I, also, am finding a need to encrypt my data. With all the "integration" I find people accessing my databases without caution. When they crash the databases, they tell the client its all my fault and I should repair them. It makes for rough situations.
Tim
Many of us are now working with Harbour / MSVC 2012. Antonio has been encouraging people to move up to the newer compilers. The functions you are testing and working with are only valid with xHarbour.
James, you are using the old command style for testing these files, but how well will this work with data objects ?
Regarding ADS. That's a good option for those people who use the ADS Server. However, in my tests, I'm seeing much better performance on a network ( peer to peer ) when using DBFCDX instead of the ADS Local server. I have both available, so I technically could use the ADS option ( I think ), but then I may get performance hits from people using LOCAL.
I would appreciate if you would consider these issues as you discuss the options. I, also, am finding a need to encrypt my data. With all the "integration" I find people accessing my databases without caution. When they crash the databases, they tell the client its all my fault and I should repair them. It makes for rough situations.
Tim
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: encrypting dbf files
Tim,
I see no reason it wouldn't work with data objects. We just need to subclass and add the password unlock and possibly a check to make sure the database is encrypted.
When time permits, I will test this to be certain.
James
I see no reason it wouldn't work with data objects. We just need to subclass and add the password unlock and possibly a check to make sure the database is encrypted.
When time permits, I will test this to be certain.
James
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: encrypting dbf files
James,
did you check if the encrypting function works with memo fields? Maybe you missed my message above.
EMG
did you check if the encrypting function works with memo fields? Maybe you missed my message above.
EMG
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: encrypting dbf files
Enrico,
James
I will try to get to it today.did you check if the encrypting function works with memo fields?
James
Re: encrypting dbf files
James:
I don't know the encryption algorithm that it uses. It encrypts the records over the old ones, no copy is made. Undelete tools will not recover the unencrypted data.
Enrico:
It does work with memo fields since I've been using it since 1996 in my production apps.
I suggest that you compile a small program that do the initial encryption using the SIX driver and then, and only then, the DBF header will have the 1st byte changed. Afterwards you can use the DBFCDX driver.
If you wish to email me one of your files, I'll happily will try your code with your DBFs.
I don't know the encryption algorithm that it uses. It encrypts the records over the old ones, no copy is made. Undelete tools will not recover the unencrypted data.
Enrico:
It does work with memo fields since I've been using it since 1996 in my production apps.
I suggest that you compile a small program that do the initial encryption using the SIX driver and then, and only then, the DBF header will have the 1st byte changed. Afterwards you can use the DBFCDX driver.
If you wish to email me one of your files, I'll happily will try your code with your DBFs.
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: encrypting dbf files
HunterEC,
EMG
Great!HunterEC wrote:Enrico:
It does work with memo fields since I've been using it since 1996 in my production apps.
This is my non-working sample. Please fix it. Use any tables with memo fields and xHarbour. Thank you!HunterEC wrote:I suggest that you compile a small program that do the initial encryption using the SIX driver and then, and only then, the DBF header will have the 1st byte changed. Afterwards you can use the DBFCDX driver.
Code: Select all
FUNCTION MAIN()
USE ANYTABLE EXCLUSIVE
? SX_DBFENCRYPT( "EMAG" )
? SX_TABLETYPE()
INKEY( 0 )
RETURN NIL
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: encrypting dbf files
Hunter,
The following code is working fine for me without using the SIX RDD. I can confirm that the file is encrypted.
When I attempt to use either VIA SIXCDX or EXTERNAL SIXCDX I get this error:
Error: Unresolved external '_HB_FUN_SIXCDX' referenced
Any ideas? Do we really need this? Is there an include file that I am supposed to be referencing? Do you have a sample program you can share?
James
The following code is working fine for me without using the SIX RDD. I can confirm that the file is encrypted.
When I attempt to use either VIA SIXCDX or EXTERNAL SIXCDX I get this error:
Error: Unresolved external '_HB_FUN_SIXCDX' referenced
Any ideas? Do we really need this? Is there an include file that I am supposed to be referencing? Do you have a sample program you can share?
James
Code: Select all
// Test Six lib's DBF encryption
#include "fivewin.ch"
FUNCTION MAIN()
use xcustomer exclusive // source file
copy to customer // working file
use
USE customer EXCLUSIVE
? SX_DBFENCRYPT( "EMAG" ) // returns .t.
? SX_TABLETYPE() // returns 2
RETURN NIL
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: encrypting dbf files
James,
EMG
As far as I know, SIXCDX is included in xHarbour's DBFCDX.James Bott wrote:The following code is working fine for me without using the SIX RDD.
EMG