FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Protection
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Protection
Posted: Wed Apr 17, 2013 09:04 AM

How can Protect a dbf with 61.819 records ?
I wish open the file only with my app, any help please ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Protection
Posted: Wed Apr 17, 2013 11:14 AM
Silvio,

maybe a better solution ( because You want only a private use )
Create a protected folder. There You can save everything You need.

http://www.kakasoft.com/folder-protect/how-to.html

Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: Protection
Posted: Wed Apr 17, 2013 11:22 AM

Maybe ADS CDX...

Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Protection
Posted: Wed Apr 17, 2013 12:25 PM

[u:13r04q0p]Maybe ADS CDX...[/u:13r04q0p]
How much does it cost?

Marco Boschi
info@marcoboschi.it
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: Protection
Posted: Wed Apr 17, 2013 07:33 PM

There is a Free and a Paid version I use the free version without any considerable drawback

Search for RDD ADS or ADS CDX that you will find more info ( search in the forum too )

Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Protection
Posted: Thu Apr 18, 2013 07:07 AM

Please,
I must pubblish the dbf with my app and I must use Iss to make the setup.exe
I cannot use extern 3d party app
How I can protect this dbf ( 61.819 records) , is there a easy method ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Protection
Posted: Thu Apr 18, 2013 08:12 AM

Maybe this can help you.

viewtopic.php?f=3t=25390p=138300hilit=decrypt#p138300
Regards,
Otto

&&&

Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: Protection
Posted: Thu Apr 18, 2013 11:13 AM

ADS isn't another program, is a set of DLL and config files only, easy to be set in a installer.


Silvio, are the all the fields character?

If yes, you can use Encrypt/Decrypt.
Sample:

DEFINE CRYPT_KEY "SILVIO" //-- Don't need to be

Replace CFIELD with Encrypt(cVar,CRYPT_KEY)

cVar := Decrypt(CFIELD,CRYPT_KEY)

PS.: Everywhere in your code that you make exchanges with the database must be changed.

Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
Posts: 476
Joined: Sat Feb 03, 2007 06:36 AM
Re: Protection
Posted: Thu Apr 18, 2013 01:55 PM
Silvio,
Maybe you can try with this:

Code (fw): Select all Collapse
////////////////////////////////////////////////////////////////////////

Protec( 1, cBase )
IF lShared
   USE ( cBase ) NEW SHARED INDEX ( cIndex ) ALIAS ( cAlias )
Else
   USE ( cBase ) NEW EXCLUSIV INDEX ( cIndex ) ALIAS ( cAlias )
End
Protec( 0, cBase )


//----------------------------------------------------------------------------//

FUNCT Protec( nAction, cFile ) 

    local nHandle   := 0
    local cBuffer   := space( 32 )

    DEFAULT nAction := 1

        nHandle   := FOpen( cFile, FO_READWRITE + FO_SHARED )
   
        if nHandle != -1
            if FRead( nHandle, @cBuffer, 32 ) == 32
                if nAction == 0     // Proteger
                    if SubStr( cBuffer, 1, 1 ) <> Chr( 26 )
                        cBuffer := Chr( 26 ) + SubStr( cBuffer, 1, 31 )
                    endif
                else                // Desproteger
                    if SubStr( cBuffer, 1, 1 ) == Chr( 26 )
                        cBuffer := SubStr( cBuffer, 2, 31 ) + Chr( 0 )
                    endif
                endif
                FSeek( nHandle, 0 )
                FWrite( nHandle, cBuffer, 32 )
            endif
            FClose( nHandle )
        endif

return( FError() )


Carlos.
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Protection
Posted: Thu Apr 18, 2013 02:03 PM

Silvo

Rename your .dbf to .dat .. DBFCDX does not care what the extension is .. it reads the file header to open your database... that should keep "the usual suspects" from prying into your databases.

ren table.dbf table.dat

REQUEST DBFCDX
rddsetdefault ( "DBFCDX" )

Select 1
use ( "Table.Dat" ) via "DBFCDX" Shared

Rick Lipkin

Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: Protection
Posted: Thu Apr 18, 2013 02:35 PM

Hi Carlos.
You're system cannot works in multi user environment.
And in standalone situation, if you want to bypass the protection for using the files, the simplest way
is to kill the application when is running. So you can use the files without the protection.
Massimo

Posts: 476
Joined: Sat Feb 03, 2007 06:36 AM
Re: Protection
Posted: Thu Apr 18, 2013 04:54 PM

Massimo,
I use this option in multi user environment, without problem (near 50 users at same time), using the option "lShared := .t."

Note: You also can rename de files ".dbf" to ".dat"

Best regards.

Carlos.

Continue the discussion