home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 20.9 Decrypt()
- Author: Joe Booth
- Excerpted from "Clipper 5: A Developer's Guide"
- Copyright (c) 1991 M&T Books
- 501 Galveston Drive
- Redwood City, CA 94063-4728
- (415) 366-3600
- */
-
- //───── NOTE: must compile with the /N option!
-
- function decrypt(enc_word, passkey)
- LOCAL plain:="",jj,kk:=0,x
- passkey := if(passkey==NIL,"CLIPPER",passkey)
- for jj=len(enc_word) to 1 step -1
- kk :=if(kk>len(passkey),1,kk)
- x :=asc(substr(enc_word,jj,1)) - asc(substr(passkey,kk,1))
- plain += chr(x)
- next
- return plain
-
- // end of file CHP2009.PRG
-