Delphi Database, Delphi Components from ComponentAce
Products Download Order Contact us
/img/help/home.gif /img/help/prev.gif /img/help/disnext.gif

 

Encrypting a string

 


 

With Easy Compression Library you can easily encrypt and decrypt a string.

 

Encrypting a string.

To encrypt a string you need to call ECLCompressAndEncryptString function.

The Password parameter must be not blank.

 

Decrypting a string.

To decrypt a string you need to call ECLDecompressAndDecryptString.

 

Warning:

Set bHexFormat parameter of ECLCompressAndEncryptString to True if you plan to access encrypted string as null-terminated string (PChar). This is required if you store encrypted password to Registry for example.

By default encrypted string can contain some CHR(0) entrances and accessing the string with PChar() will not be correct.

 

Example:

var

EncryptStr, DecryptStr: string;

begin

{ encrypt a string }

ECLCompressAndEncryptString('test', EncryptStr, 'Password', ppmFastest);

{ decrypt a string }

ECLDecompressAndDecryptString(EncryptStr, DecryptStr, 'Password');

{ show decrypted string }

ShowMessage(DecryptStr);

end;

 

 

 

        © 2003 - 2024 ComponentAce  | .net zip component | barcode for .net | delphi zip component | delphi database Apr 20, 2024