<br>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.<br>I am not quite sure if that is a flaw, just normal behaviour, or I am failing to set some additional parameters properly.<br>
<br>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.<br><br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">
unit testform;<br><br>{$mode objfpc}{$H+}<br><br>interface<br><br>uses<br> Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,<br> StdCtrls, DCPrijndael, DCPsha1;<br><br>type<br><br> { TForm1 }<br>
<br> TForm1 = class(TForm)<br> edtKeyString: TEdit;<br> edtInputText: TEdit;<br> edtEncryptedText: TEdit;<br> Label1: TLabel;<br> Label2: TLabel;<br> Label3: TLabel;<br> procedure edtInputTextChange(Sender: TObject);<br>
private<br> { private declarations }<br> public<br> { public declarations }<br> end; <br><br>var<br> Form1: TForm1; <br><br>implementation<br><br>{ TForm1 }<br><br>procedure TForm1.edtInputTextChange(Sender: TObject);<br>
var<br> Cipher: TDCP_rijndael;<br>begin<br> Cipher:= TDCP_rijndael.Create(Self);<br> Cipher.InitStr(edtKeyString.Text,TDCP_sha1);<br> edtEncryptedText.Text := Cipher.EncryptString(edtInputText.Text);<br> Cipher.Burn;<br>
Cipher.Free;<br>end;<br><br>initialization<br> {$I testform.lrs}<br><br>end.<br></blockquote>
<br><br><br><br clear="all"><br>-- <br>Frank Church<br><br>=======================<br><a href="http://devblog.brahmancreations.com" target="_blank">http://devblog.brahmancreations.com</a><br>