linkedin facebook linkedin facebook nod32

Delphida shifrlash va deshifrlash dasturini yaratish

Muallif: Mengliyev Sh.

Qo`shilgan sana: 2014-09-19

Delphida shifrlash va deshifrlash dasturini yaratish

Dastur kodi

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Buttons;
const m=26;
type
TForm1 = class(TForm)
Panel1: TPanel;
Memo1: TMemo;
Button1: TButton;
Memo2: TMemo;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
Edit2: TEdit;
Button2: TButton;
Button3: TButton;
Button4: TButton;
BitBtn1: TBitBtn;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

 

procedure TForm1.Button1Click(Sender: TObject);
var
s:string;
at:array[0..25] of char;
i,j,sss:integer;
begin
memo2.Text:='';
i:=1;
at[0]:='a';
repeat
at[i]:=succ(at[i-1]);

i:=i+1;
until at[i-1]='z';

s:=memo1.text;
for j:=1 to length(Memo1.text) do
begin
sss:=0;
for i:=0 to 25 do begin
if at[i]=s[j] then
begin
memo2.Text:=memo2.Text+at[(i*strtoint(edit1.Text)+strtoint(edit2.Text))Mod 26];
end
else
if (ord(s[j])=32) and (sss=0) then memo2.Text:=Memo2.Text+s[j];sss:=1 ;

end;

end;

end;

 

 

 

procedure TForm1.Button2Click(Sender: TObject);
label 12;
var i,j,mm,mmm,s:integer;
begin
i:=strtoint(edit1.Text);
j:=strtoint(Edit2.Text);
if ((i=0) or (j=0)) then
begin
showmessage('Iltimos nol sonini kiritmang');
exit;
end;
mm:=m;
mmm:=i;
if mmm<>1 then
begin
12: if mmm>mm then
begin
mmm:=mmm-mm;
s:=mmm;
end
else
begin
mm:=mm-mmm;
s:=mm;
end;
if (s<>0) and (s<>1) then goto 12;
if s=0 then begin showmessage('Iltimos a soni 26 bilan tub bo`lsin');edit1.Text:=''; exit;end;
end;

edit1.Enabled:=false;
edit2.Enabled:=false;
panel1.Enabled:=true;
Button2.Enabled:=false;
button3.Enabled:=true;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
button2.Enabled:=true;
edit1.Enabled:=true;
edit2.Enabled:=true;
button3.Enabled:=false;
panel1.Enabled:=false;
end;

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
memo1.Text:=memo2.Text;
end;

procedure TForm1.Button4Click(Sender: TObject);
label 12;
var s:string;
x,i,m,l,j,k,a,b:integer;
at:array[0..25] of char;
h:real;
begin
Memo2.Text:='';
b:=strtoint(edit2.Text);
a:=strtoint(edit1.Text);
i:=1;
at[0]:='a';
repeat
at[i]:=succ(at[i-1]);
i:=i+1;
until at[i-1]='z';
s:=Memo1.Text;
for j:=1 to length(s) do
begin
for i:=0 to 25 do
if at[i]=s[j] then k:=i;
if s[j]<>' ' then begin

x:=-1;
repeat
x:=1+x;
if (x*26+k-b)>0 then
l:=(x*26+k-b)mod a else l:=1;
until(l=0);
h:=int((x*26+k-b)/a);
m:=strtoint(FloatToStr(h));
if m=26 then m:=0;
memo2.Text:=memo2.Text+at[m];end else
memo2.Text:=memo2.Text+s[j];
end;

end;

end.

1768 marta o`qildi.

Parol:
Eslab qolish.


Ro`yhatdan o`tish

testing

+998915878681

Siz o`z maxsulotingizni 3D reklama ko`rinishda bo`lishini xohlaysizmi? Unda xamkorlik qilamiz.

3D Reklama


Рейтинг@Mail.ru
Рейтинг@Mail.ru

Besucherzahler
счетчик посещений