xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

Crypt()

Encrypts or decrypts a character string.

Syntax

Crypt( <cString>, <cPassWord> ) --> cResult

Arguments

<cString>
Theis is the character string to encrypt or decrypt.
<cPassWord>
A character string holding the password for the encryption or decryption. It should have at least six characters.

Return

The function encrypts a character string, and decrytps it using the same password. When a previously encrypted string is passed for <cString>, the return value is the original string.

Info

See also:CharXOR(), HB_Crypt()
Category: CT:String manipulation , Character functions
Source:ct\ctcrypt.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The examples shows encryption end decryption of a character string

   PROCEDURE Main
      LOCAL cString  := "xHarbour compiler"
      LOCAL cPassWord:= "eeMCsq"
      LOCAL cCipher

      ? cCipher := Crypt( cString, cPassWord )

      ? cCipher == cString           // result: .F.

      cCipher := Crypt( cCipher, cPassWord )

      ? cCipher == cString           // result: .T.
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe