ENCRIPTAR ARCHIVOS DBF
Amigos podrian ayudarme como puedo encripytar una tabla o archivo dbf
gracias por su ayuda
gracias por su ayuda
use TINDEX exclu
*Do EncDesData With "ON" && Encripta
Do EncDesData With "OFF" &&Desencripta
********************************************************************
Procedure EncDesData
LPARAMETERS LCENCR
maxno=100
LCENCR=UPPER(ALLT(LCENCR))
IF LCENCR<>'ON' AND LCENCR<>'OFF'
RETURN MESSAGEBOX("Pass ON or OFF for encryption/decryption!")
ENDIF
LNFIELDS=FCOUNT()
FOR J = 1 TO LNFIELDS
LCFIELD=FIELD(J)
* wait wind lcfield
* if lcfield="NOMDBF"
* loop
* endif
DO CASE
CASE TYPE(LCFIELD) $ 'CM'
REPL ALL &LCFIELD WITH CONVRT(LCENCR,&LCFIELD)
ENDCASE
ENDFOR
PROCEDURE CONVRT
lparameters lcencrypt,lcstring
if parameters()<2
messagebox('Pass two arguments, [On Off] and string')
return
endif
lcencrypt=upper(allt(lcencrypt))
if lcencrypt='ON'
lnlen=len(allt(lcstring))
lcnewstring=''
for i = 1 to lnlen
if i<maxno
lcchar=chr(asc(substr(lcstring,i,1))+i)
else
lcchar=chr(asc(substr(lcstring,i,1))+1)
endif
lcnewstring=lcnewstring+lcchar
endfor
RETVAL=LCNEWSTRING
ELSE
lnlen=len(allt(lcstring))
lcnewstring=''
for i = 1 to lnlen
if i<maxno
lcchar=chr(asc(substr(lcstring,i,1))-i)
else
lcchar=chr(asc(substr(lcstring,i,1))-1)
endif
lcnewstring=lcnewstring+lcchar
endfor
RETVAL=LCNEWSTRING
ENDIF
RETURN (RETVAL)
*Do EncDesData With "ON" && Encripta
Do EncDesData With "OFF" &&Desencripta
********************************************************************
Procedure EncDesData
LPARAMETERS LCENCR
maxno=100
LCENCR=UPPER(ALLT(LCENCR))
IF LCENCR<>'ON' AND LCENCR<>'OFF'
RETURN MESSAGEBOX("Pass ON or OFF for encryption/decryption!")
ENDIF
LNFIELDS=FCOUNT()
FOR J = 1 TO LNFIELDS
LCFIELD=FIELD(J)
* wait wind lcfield
* if lcfield="NOMDBF"
* loop
* endif
DO CASE
CASE TYPE(LCFIELD) $ 'CM'
REPL ALL &LCFIELD WITH CONVRT(LCENCR,&LCFIELD)
ENDCASE
ENDFOR
PROCEDURE CONVRT
lparameters lcencrypt,lcstring
if parameters()<2
messagebox('Pass two arguments, [On Off] and string')
return
endif
lcencrypt=upper(allt(lcencrypt))
if lcencrypt='ON'
lnlen=len(allt(lcstring))
lcnewstring=''
for i = 1 to lnlen
if i<maxno
lcchar=chr(asc(substr(lcstring,i,1))+i)
else
lcchar=chr(asc(substr(lcstring,i,1))+1)
endif
lcnewstring=lcnewstring+lcchar
endfor
RETVAL=LCNEWSTRING
ELSE
lnlen=len(allt(lcstring))
lcnewstring=''
for i = 1 to lnlen
if i<maxno
lcchar=chr(asc(substr(lcstring,i,1))-i)
else
lcchar=chr(asc(substr(lcstring,i,1))-1)
endif
lcnewstring=lcnewstring+lcchar
endfor
RETVAL=LCNEWSTRING
ENDIF
RETURN (RETVAL)
