General information
Category:
Coding, syntax & commands
Title:
Encrypted dbf file.
A friend sent me this tid bit of code and a encrypted .dbf file.
I am not sure on how to decrypt it for him. Below is the code that he sent me. Can any help me write a decrypt for it?
TKS
Brad
FUNCTION encrypt
PARAMETER databuffer
IF constdebug > 0
RETURN databuffer
ENDIF
IF LEN(ALLTRIM(databuffer)) > 0
keystring = 'In the end there shall be only one, SKANKER'
tempstring = ''
newchar = ''
nkeyindex = 1
FOR nbufcharpos = 1 TO ;
LEN(databuffer)
IF nkeyindex > ;
LEN(keystring)
nkeyindex = 1
ENDIF
newchar = CHR(ASC(SUBSTR(databuffer, ;
nbufcharpos, ;
1)) + ;
ASC(SUBSTR(keystring, ;
nkeyindex, ;
1)))
tempstring = LEFT(databuffer, ;
nbufcharpos - ;
1) + ;
SUBSTR(newchar, ;
1, 1) + ;
RIGHT(databuffer, ;
LEN(databuffer) - ;
nbufcharpos)
databuffer = tempstring
nkeyindex = nkeyindex + ;
1
ENDFOR
ENDIF
RETURN databuffer
ENDFUNC
*
FUNCTION decrypt
PARAMETER databuffer
IF constdebug > 0
RETURN databuffer
ENDIF
szindata = databuffer
szoutdata = ""
ncharpos = 0
IF .NOT. ;
EMPTY(ALLTRIM(szindata))
keystring = 'In the end there shall be only one, SKANKER'
newchar = ''
nkeyindex = 1
FOR ncharpos = 1 TO ;
LEN(szindata)
IF nkeyindex > ;
LEN(keystring)
nkeyindex = 1
ENDIF
newchar = CHR(ASC(SUBSTR(szindata, ;
ncharpos, 1)) - ;
ASC(SUBSTR(keystring, ;
nkeyindex, ;
1)))
szoutdata = szoutdata + ;
newchar
nkeyindex = nkeyindex + ;
1
ENDFOR
ENDIF
szoutdata = ALLTRIM(szoutdata)
RETURN szoutdata
ENDFUNC
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only