Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-12

I need some help with using Rijndael encryption algorithm

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Frank Church

I am using the Rijndael algorithm to encrypt some application settings, but it does not generate the type of variation in the encrypted output I expect. I am not quite sure if that is a flaw, just normal behaviour, or I am failing to set some additional parameters properly.

Here is my current implementation. I expect a whole lot more variation in the output when I add more characters, but the previous parts don't change much.

unit testform;
Show quoted text 51 lines
{$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, DCPrijndael, DCPsha1; type { TForm1 } TForm1 = class(TForm) edtKeyString: TEdit; edtInputText: TEdit; edtEncryptedText: TEdit; Label1: TLabel; Label2: TLabel; Label3: TLabel; procedure edtInputTextChange(Sender: TObject); private { private declarations } public { public declarations } end; var Form1: TForm1; implementation { TForm1 } procedure TForm1.edtInputTextChange(Sender: TObject); var Cipher: TDCP_rijndael; begin Cipher:= TDCP_rijndael.Create(Self); Cipher.InitStr(edtKeyString.Text,TDCP_sha1); edtEncryptedText.Text := Cipher.EncryptString(edtInputText.Text); Cipher.Burn; Cipher.Free; end; initialization {$I testform.lrs} end.
Frank Church ======================= http://devblog.brahmancreations.com