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.As far as I know, SIXCDX is included in xHarbour's DBFCDX.
James
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.As far as I know, SIXCDX is included in xHarbour's DBFCDX.
I agree. Anyway, I would like to know how to get it to work with memo fields too...James Bott wrote:Enrico,
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.As far as I know, SIXCDX is included in xHarbour's DBFCDX.
James
OK, 64bit encryption is not very good, but it will prevent casual users from getting into the DBFs. It would be nice to have the option of higher level encryption but there would also be a speed penalty.------------
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.
Sorry, I didn't get it working...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).
Here it is: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.
Code: Select all
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 am not sure I understand what you are saying. Are you confirming that 32bit FWH programs cannot encrypt DBF files containing a memo field?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).
It was a Przemek decision.James Bott wrote:Do you know why memo field encryption was never implemented in 32bits?
I wonder why. It seems that it would be simple to implement since the encryption/decryption code is already working. Maybe there is some other technical issue...It was a Przemek decision.
Code: Select all
//------------------------
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)))
Thank you. We are discussing an encrypting system at RDD level here. It already exists but unfortunately it doesn't work with memo fields.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.