This may be too simple, but I'll show you anyway...
*****************************************************************************
* Name : Encrypt
* Description: Encrypts or decrypts a given string
* Parameters : tcIn - character string to convert
* tlDecrypt - whether this function should decrypt the given string
* Returns : Character string converted according to the encrypt/decrypte algorithm
*****************************************************************************
FUNCTION ENCRYPT
LPARAMETER tcIn, tlDecrypt
LOCAL lcKey, lnLoop, lcOut, lnPosition, lcChar, lnAscii1, lnAscii2, lnAdjustment
IF PARAMETERS() < 1 OR EMPTY(tcIn)
RETURN ""
ENDIF
lcKey = "BlZ1@d0fDh"
lcOut = ""
FOR lnLoop = 1 TO LEN(TRIM(tcIn))
lnPosition = MOD(lnLoop-1, LEN(lcKey)) + 1
lnAscii = ASC(SUBSTR(tcIn, lnLoop, 1)) - 32 - 1
lnAdjustment = (ASC(SUBSTR(lcKey, lnPosition, 1)) + lnLoop) * IIF(tlDecrypt,-1,1)
lnAsciiNew = lnAscii + lnAdjustment
lcChar = CHR(MOD(lnAsciiNew, 94) + 32 + 1)
lcOut = lcOut + lcChar
ENDFOR
RETURN lcOut
ENDFUNC