[DUG] Enryption

Kyley Harris kyleyharris at gmail.com
Fri Oct 24 13:53:12 NZDT 2008


Not sure which is best but I used ECB
The way I used it was..
    FKey:TAESKey256;
    FDecryptKey: string;


  ASource := TStringStream.Create(s);
  try
    ADest := TStringStream.Create('');
    try
      ASource.Position := 0;
      Size := Length(s);
      ADest.WriteBuffer(Size,SizeOf(Size));
      EncryptAESStreamECB(ASource, Size, FKey, ADest);
      ADest.Position := 0;
      s := ADest.DataString;
    finally
      FreeAndNil(ADest);
    end;
  finally
    FreeAndNil(ASource);
  end;

On Fri, Oct 24, 2008 at 12:58 PM, Robert martin <rob at chreos.co.nz> wrote:

> Hi Kyley
>
> Just having a look at this now.  Which mode do you use, wiki says 'ECB'
> might not be the safest although doesn't mention 'CBC' mode.
>
> looking at
>
> procedure EncryptAESStreamCBC(Source: TStream; Count: cardinal;
>  const Key: TAESKey256; const InitVector: TAESBuffer; Dest: TStream);
> overload;
>
> What is InitVector used for / what should I provide here???
>
> Sorry about any dumb questions.  I am by no means an expert on this!
>
> Thanks
> Rob
>
>
>
> Kyley Harris wrote:
> > Also, when I said "I have one" i didn't mean its mine.. copyright is
> > in the header.. it works well and easy to use.
> >
> > On Thu, Oct 23, 2008 at 5:23 PM, Robert martin <rob at chreos.co.nz
> > <mailto:rob at chreos.co.nz>> wrote:
> >
> >     Hi
> >
> >     I have a file I want to FTP to a site.  I want this file to be
> >     physically encrypted with something reasonably strong.  Does any body
> >     have some code / web pointer to a site that doesn't require extra
> >     components or dlls to do it.  I did a search on AES encryption and
> >     found
> >     lots of sites but most want me to use their components.  I just want
> >     some code !
> >
> >     Thanks
> >     Rob
> >     _______________________________________________
> >     NZ Borland Developers Group - Delphi mailing list
> >     Post: delphi at delphi.org.nz <mailto:delphi at delphi.org.nz>
> >     Admin: http://delphi.org.nz/mailman/listinfo/delphi
> >     Unsubscribe: send an email to delphi-request at delphi.org.nz
> >     <mailto:delphi-request at delphi.org.nz> with Subject: unsubscribe
> >
> >
> >
> >
> > --
> > Kyley Harris
> > Harris Software
> > +64-21-671-821
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > NZ Borland Developers Group - Delphi mailing list
> > Post: delphi at delphi.org.nz
> > Admin: http://delphi.org.nz/mailman/listinfo/delphi
> > Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> unsubscribe
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> unsubscribe
>



-- 
Kyley Harris
Harris Software
+64-21-671-821
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20081024/54af6089/attachment.html 


More information about the Delphi mailing list