Recent

Author Topic: Encrypt decrypt blowfish and I don't understand nothing!  (Read 5944 times)

Robert W.B.

  • Sr. Member
  • ****
  • Posts: 331
  • Love my Wife, My Kids and Lazarus/Freepascal.
Encrypt decrypt blowfish and I don't understand nothing!
« on: April 19, 2011, 04:20:26 pm »
Hi Friends. I saw this example in the forum but ,how do I call it?    :(
Where do I call it?  From a button?  :(
How do I save it?  :(
mystring:='I don't understand'; // that i would want to encrypt and decrypt?
Thanks for any help.
//
procedure Encrypt(InStream, OutStream: TStream; const Key: string);
var EC: TStream;
begin
   EC := TBlowFishEncryptStream.Create(Key, OutStream);
   try
      EC.CopyFrom(InStream, InStream.Size);
   finally
      EC.Free; // Destroy automatically calls Flush
   end;
end;

procedure Decrypt(InStream, OutStream: TStream; const Key: string);
var EC: TStream;
begin
   EC := TBlowFishDeCryptStream.Create(Key, InStream);
   try
      OutStream.CopyFrom(EC, InStream.Size);
   finally
      EC.Free; // Destroy automatically calls Flush
   end;
end;                     

//

Rob

Alain

  • New member
  • *
  • Posts: 7
Re: Encrypt decrypt blowfish and I don't understand nothing!
« Reply #1 on: April 19, 2011, 04:26:23 pm »
Have a look to DecryptString and EncryptString.
A.G.

Robert W.B.

  • Sr. Member
  • ****
  • Posts: 331
  • Love my Wife, My Kids and Lazarus/Freepascal.
uses DCPrijndael, DCPsha256  I put this in uses but, i got this message

unit1.pas(1,1) Fatal: Can't find unit DCPrijndael used by Unit1

Can You tell me what's wrong?

Best regards
Robban  %)
Rob

Alain

  • New member
  • *
  • Posts: 7
uses DCPrijndael, DCPsha256  I put this in uses but, i got this message

unit1.pas(1,1) Fatal: Can't find unit DCPrijndael used by Unit1

Can You tell me what's wrong?

Best regards
Robban  %)

Did you install successfully the DCPCrypt package ?
A.G.

 

TinyPortal © 2005-2018