To Antonio:

To Antonio:

Postby HunterEC » Thu Jul 04, 2013 8:22 am

Antonio:

I want to follow your advice to move from xHarbour to Harbour but Harbour does not support the RDD SIX driver. This RDD allows for transparent record and table encryption. Any suggestions ? Thank you.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: To Antonio:

Postby Antonio Linares » Thu Jul 04, 2013 9:50 am

Gustavo,

If there is no source code for the Six RDD, then I would advice not to use it, to avoid future problems.

What Six functionality do you use that DBFCDX RDD does not support ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: To Antonio:

Postby Antonio Linares » Thu Jul 04, 2013 9:51 am

If you just need the encryption, you could encrypt the data before saving it and later decrypt it when you read it,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: To Antonio:

Postby HunterEC » Thu Jul 04, 2013 6:53 pm

Antonio:

I use it for the encryption. If I am to encrypt the data myself, instead of being done automatically by the driver, I have to change all numeric, date and logical fields to character types so I can store the encrypted values. This will add a lot of overhead to the app and also will make reporting lot much harder to implement. The SIX libraries in xHarbour are: SDE61.DLL & SDECDX61.DLL

For those of us that develop software for health related business encryption is a must due to HIPAA regulations (patient confidentiality).

Maybe it can be incorporated in a future FW release.

Thank you.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: To Antonio:

Postby Antonio Linares » Thu Jul 04, 2013 7:53 pm

Gustavo,

How do you tell Six to activate the encryption ?

Is it a function call ? What syntax ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: To Antonio:

Postby Marc Vanzegbroeck » Thu Jul 04, 2013 8:57 pm

Antonio,

I use to use the six-driver also when I was still using Clipper5.2e + FW
The syntax to use a password was:
Code: Select all  Expand view
USE myfile SHARED new PASSWORD "MyPassword"

When you did for example:
Code: Select all  Expand view
repl firma with 'Mijn Firma"

it was automaticly encrypted in the DBF.

With xHarbour + FWH I use now
Code: Select all  Expand view
repl firma with sx_encrypt("Mijn Firma","MyPassword")


I use sx_decrypt() to read it again.

Does functions like that are also available with Harbour?
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: To Antonio:

Postby Antonio Linares » Fri Jul 05, 2013 3:32 am

Marc,

Harbour provides a very good support for Six. In fact we can do:

#include "hbsix.ch"

USE "customer" PASSWORD "mypass"
Sx_DdfEncrypt()

There is some important info about Six bugs that Przemek detected related to memo fields:
https://groups.google.com/forum/#!searchin/harbour-devel/encrypt/harbour-devel/rY8rn70IBI0/d-HoKNhkWQAJ

When I was adding support for SIX3 encryption to [x]Harbour i blocked
it for tables with memos. I made it intentionally when I found few
serious bugs in SIX3 implementation when tables with memos are encrypted.
I didn't want to replicate them and make [x]Harbour RDDs bug compatible
with SIX3 because SIX3 is corrupting data in some cases.
I left them to the moment when I'll find some spare time to precisely
document SIX3 bugs and differences in new implementation.
Meanwhile I decided to block support for SIX3 encrypted tables with
memos to not have backward compatibility problems with data created
by [x]Harbour RDDs before I'll introduce workarounds for SIX3 bugs.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: To Antonio:

Postby HunterEC » Fri Jul 05, 2013 4:57 am

Antonio:

Marc pointed out the correct syntax via the USE filename VIA SIX PASSWORD "mypassword" (password cannot be greater than 8 chars).
Also this is correct:
Code: Select all  Expand view
USE filename VIA SIX
Sx_SetPass("mypassword")    // this sets the password for the current workarea, can be used to change the default password for a DBF
 


When storing data there's nothing new to do:
Code: Select all  Expand view
REPLACE Field1 WITH cChar, Field2 WITH dDate, etc.
 

And the record is stored in encrypted form.

The DOS/Clipper 5.2e Six driver changes the byte that defines the presence or not of a memo field in the DBF header as follows:
1. CHR(6) - encrypted table (no Memo field)
2. CHR(134) - encrypted table with memo file (.DBT) DBFNDX driver CHR(131) - NO encryption
3. CHR(230) - encrypted table with memo file (.SMT) SIXNSX driver CHR(229) - NO encryption
4. CHR(246) - encrypted table with memo file (.FPT) SIXCDX driver CHR(245) - NO encryption

On the link you provided the PRG is using DBFNSX as the driver. On xHarbour the driver is SIX. Also the person is migrating from 16 bit. Under 16 bit you can define the default block size for memo fields. Maybe that's the cause for data corruption. I think that you, as our guru, should test it with a small program.

Thank you Antonio.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: To Antonio:

Postby nageswaragunupudi » Fri Jul 05, 2013 4:16 pm

I answered your post on sub-grouping in reports.
Mr Antonio is actively attending to the other post.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: To Antonio:

Postby James Bott » Fri Jul 05, 2013 5:31 pm

There is also the possibility of subclassing TDatabase to provide automatic encryption/decryption. All we need to do is modify the Load() and Save() methods to do the encryption and decryption. If your program is already using TDatabase, the new class would just be a plugin replacement. Otherwise you would need to convert to using database object syntax, but this could allow you to eliminate lots of code.

As for this requiring more overhead than the SIX driver, I don't think it would. The encryption/decryption is just being done in a different section of code.

Encryption is something all of us need to be thinking about.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: To Antonio:

Postby Antonio Linares » Fri Jul 05, 2013 7:40 pm

Gustavo,

What I meant is that as far as I know, you can encrypt/decrypt with any RDD using the syntax, as Harbour seems to support it:

USE "name" VIA "whatever" PASSWORD "mypass"

I have not tested it myself, but thats what I seemed to me
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: To Antonio:

Postby HunterEC » Wed Jul 10, 2013 4:56 pm

Antonio:

Does the DBUSEAREA() function supports a password parameter ? I use this function to open files instead of the USE command.
Thank you.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: To Antonio:

Postby Enrico Maria Giordano » Wed Jul 10, 2013 6:11 pm

HunterEC wrote:Antonio:

Does the DBUSEAREA() function supports a password parameter ? I use this function to open files instead of the USE command.
Thank you.


No, you have to use Sx_SetPass() function.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 95 guests