Decrypt

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Methods >

Decrypt

Declaration

function Decrypt( cpBuffer : PChar; sPassWord : String;

iLen : Integer ): PChar;

Description

Decrypt a buffer previously encrypted with Encrypt.

Parameters

cpBuffer : The buffer to decrypt.

sPassword: The password used to decrypt the buffer. If no password is used (nil) the global workarea password is used.

iLen: The length of the string being decrypted.

Return Value

The buffer contents are returned decrypted as a PChar type.

Delphi Example

// Retrieve an encrypted field

procedure TForm1.Button1Click(Sender: TObject);

var

 cpVar: PChar; 

 iSize: Integer; 

 sVal: String; 

begin

 iSize := ApTbl.FieldWidth( 'PASSWORD' ); 

 GetMem( cpVar, iSize+1 ); 

 ApTbl.GetBinary( 'PASSWORD', cpVar );

 sVal := String( ApTbl.Decrypt( cpVar, 'FooBar', iSize )); 

 ShowMessage( 'Password is: ' + sVal ); 

 FreeMem( cpVar ); 

end;

See Also

Encrypt, DbfDecrypt, GetBinary, PutBinary