Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Encrypted dbf file.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Encrypted dbf file.
Divers
Thread ID:
00808797
Message ID:
00808797
Vues:
60
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform