unit Mainunit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, Vegunit, StdCtrls;
type
TFcryptdecrypt =
class(TForm)
sg1: TStringGrid;
bCrypt: TButton;
Bdecrypt: TButton;
Label1: TLabel;
Label2: TLabel;
Editkey: TEdit;
Label3: TLabel;
Editergebniss: TEdit;
Memogeheim: TMemo;
Label4: TLabel;
procedure FormActivate(Sender: TObject);
procedure bCryptClick(Sender: TObject);
procedure BdecryptClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Fcryptdecrypt: TFcryptdecrypt;
veg: TVegenere;
textvar:
string;
implementation
{$R *.dfm}
procedure TFcryptdecrypt.FormActivate(Sender: TObject);
begin
veg:= tvegenere.create;
veg.ShowQuad(sg1);
end;
procedure TFcryptdecrypt.bCryptClick(Sender: TObject);
var
str:
string;
i: integer;
begin
str:='
';
for i:=0
to memogeheim.Lines.Count-1
do
str:= str+memogeheim.Lines[i];
veg.Setklar(str);
veg.Setkey(editkey.text);
veg.EnCrypt;
editergebniss.Text:= veg.Getcode;
end;
procedure TFcryptdecrypt.BdecryptClick(Sender: TObject);
var
str:
string;
i: integer;
begin
str:='
';
for i:=0
to memogeheim.Lines.Count-1
do
str:= str+memogeheim.Lines[i];
veg.Setcode(str);
veg.Setkey(editkey.text);
veg.Decrypt;
editergebniss.Text:= veg.Getklar;
end;
end.