As far as I know, SIXCDX is included in xHarbour's DBFCDX.
That was the conclusion that I came to. Probably Hunter has not tried it recently and thus his statement that you have to use the Six driver to encrypt.
James
As far as I know, SIXCDX is included in xHarbour's DBFCDX.
James Bott wrote:Enrico,As far as I know, SIXCDX is included in xHarbour's DBFCDX.
That was the conclusion that I came to. Probably Hunter has not tried it recently and thus his statement that you have to use the Six driver to encrypt.
James
------------
Description: Sx_Encrypt() and it related function Sx_Decrypt() provide
an easy way to integrate data security to a system. The
encryption engine provides security through the use of a
64-bit (8 byte) security code and multi-adaptive computa-
tion. Multi-adaptive computation ensures a wide uniqueness
within the outputted encrypted string. If a string of all
blanks were encrypted you would see a wide distribution of
characters. This ensures a reasonable amount of security
at a small speed penalty.
Of course, the best way to protect your data is to keep it
away from those who shouldn't have access to it. Protect
your passwords, and don't store them in .DBF files.
This encryption/decryption method is _not_ DES (Data
Encryption Standard) compliant, so it can be used in
programs distributed both in the US and Overseas.
HunterEC wrote:James, Enrico:
I do encrypt my DBFs with a 16 bit Clipper utility program using the SIX driver. Memos do encrypt. In 32 bit you can encrypt the memo field before storing it with the Sx_encrypt (cPassword) function and that's it (in case that the memo fields does not get encrypted).
HunterEC wrote:Enrico:
If you can email me (morenoec2007 at hotmail dot com) your program or a sample program and your DBFs, I'll give it a try. Thank you.
FUNCTION MAIN()
DBCREATE( "MYTEST", { { "TEST1", "C", 35, 0 },;
{ "TEST2", "M", 10, 0 } } )
USE MYTEST EXCLUSIVE
APPEND BLANK
REPLACE FIELD -> test1 WITH "Test1"
REPLACE FIELD -> test2 WITH "Test2"
CLOSE
USE MYTEST EXCLUSIVE
? SX_DBFENCRYPT( "EMAG" )
? SX_ENCRYPT( "EMAG" )
? SX_TABLETYPE()
CLOSE
INKEY( 0 )
RETURN NIL
I do encrypt my DBFs with a 16 bit Clipper utility program using the SIX driver. Memos do encrypt. In 32 bit you can encrypt the memo field before storing it with the Sx_encrypt (cPassword) function and that's it (in case that the memo fields does not get encrypted).
James Bott wrote:Do you know why memo field encryption was never implemented in 32bits?
It was a Przemek decision.
//------------------------
Func ENCRYPT( TO_DO )
Local PadBack,Done,Qaz
PadBack := Len(To_Do)
*msginfo( "Padback" )
*msginfo( PadBack )
Done := " "
TO_DO := ALLTRIM(TO_DO)
FOR QAZ := LEN(TO_DO) to 1 STEP -1
DONE := DONE + CHR(ASC(SUBSTR(TO_DO, QAZ, 1)) + 104)
NEXT
*MsgInfo( "In Encrypt" )
*MsgInfo( Done )
*msginfo( Len( Done ))
RETURN( Fill_Out( Done, PadBack ))
//--------------------
Func DENCRYPT( TO_DO )
LOCAL PADBACK := LEN(TO_DO), DONE := " ", QAZ
TO_DO := ALLTRIM(TO_DO)
FOR QAZ := LEN(TO_DO) to 1 STEP -1
DONE := DONE + CHR(ASC(SUBSTR(TO_DO, QAZ, 1)) - 104)
NEXT
RETURN( FILL_OUT(DONE, PADBACK))
//----------------------
Func FILL_OUT( Done, PadBack )
* MsgInfo( "In Fill_Out Pcount")
* msginfo( pcount())
* Msginfo( len( done ))
IF PCOUNT() = 1
PadBack := 80
ELSE
* msginfo( "Initial PadBack" )
* msginfo( PadBack )
IF TYPE("PadBack") = "C"
PadBack := VAL(PadBack)
ENDIF
* PadBack := IIF(PadBack <= 1, 80, PadBack)
If PadBack >= 1
Else
PadBack := 80
Endif
* PadBack := IIF(PadBack < 1, 80, PadBack)
* msginfo( "End PadBack")
* msginfo( PadBack )
ENDIF
*msginfo( "if PadBack <= len(Done)")
*msginfo( PadBack)
*msginfo( len(Done))
IF PadBack <= LEN(Done)
* Msginfo( "Return Done")
* Msginfo( Done )
* msginfo( len(done ))
RETURN(Done)
ENDIF
RETURN(Done + SPACE(PadBack - LEN(Done)))
Rick Lipkin wrote:To All
There functions have served me well over the years .. I copied this ( public domain ) code from an old Clipper Tools book some time ago and have modified it from time to time.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 39 guests