Смекни!
smekni.com

Использование современных симметрических DES и асимметрических RSA алгоритмов шифрования (стр. 3 из 5)

Wifrovanie_ECB('20.txt','DES_crypted\Z_20_5_ECB.txt');

razmer:=1024*20;

end;

if Form1.RadioButton9.Checked=true then

begin

Wifrovanie_ECB('50.txt','DES_crypted\Z_50_5_ECB.txt');

razmer:=1024*50;

end;

if Form1.RadioButton8.Checked=true then

begin

Wifrovanie_ECB('100.txt','DES_crypted\Z_100_5_ECB.txt');

razmer:=1024*100;

end;

if Form1.RadioButton7.Checked=true then

begin

Wifrovanie_ECB('500.txt','DES_crypted\Z_500_5_ECB.txt');

razmer:=1024*500;

end;

if Form1.RadioButton6.Checked=true then

begin

Wifrovanie_ECB('1.txt','DES_crypted\Z_1_5_ECB.txt');

razmer:=1024*1024;

end;

t2:=Time;

vremja:=round((t2 - t1)*24*60*60)+1;

Label33.Caption := IntToStr(vremja-1)+ 'сек';

Label34.Caption := FloatToStr((razmer/vremja)-1)+'байт/сек';

end;

//Raswifrovanie failov klju4om na 5 bait

procedure TForm1.Button2Click(Sender: TObject);

var

klu4:string;

t1,t2:TDateTime;

vremja:integer;

razmer:integer;

begin

klu4:=Edit10.text;

razmer:=0;

while( Length(klu4)<8 ) do

klu4:=klu4+'0';

Formirovanie_16_podklju4ei(klu4);

t1:=Time;

if Form1.RadioButton10.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_20_5_ECB.txt','DES_uncrypted&bsol;R_20_5_ECB.txt');

razmer:=1024*20;

end;

if Form1.RadioButton9.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_50_5_ECB.txt','DES_uncrypted&bsol;R_50_5_ECB.txt');

razmer:=1024*50;

end;

if Form1.RadioButton8.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_100_5_ECB.txt','DES_uncrypted&bsol;R_100_5_ECB.txt');

razmer:=1024*100;

end;

if Form1.RadioButton7.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_500_5_ECB.txt','DES_uncrypted&bsol;R_500_5_ECB.txt');

razmer:=1024*500;

end;

if Form1.RadioButton6.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_1_5_ECB.txt','DES_uncrypted&bsol;R_1_5_ECB.txt');

razmer:=1024*1024;

end;

t2:=Time;

vremja:=round((t2 - t1)*24*60*60)+1;

Label33.Caption := IntToStr(vremja-1)+ 'сек';

Label34.Caption := FloatToStr(razmer/vremja-1)+'байт/сек';

end;

//Zawifrovanie failov klju4om na 6 bait

procedure TForm1.Button3Click(Sender: TObject);

var

klu4:string;

t1,t2:TDateTime;

vremja:integer;

razmer:integer;

begin

klu4:=Edit11.text;

while( Length(klu4)<8 ) do

klu4:=klu4+'0';

Formirovanie_16_podklju4ei(klu4);

t1:=Time;

if Form1.RadioButton10.Checked=true then

begin

Wifrovanie_ECB('20.txt','DES_crypted&bsol;Z_20_6_ECB.txt');

razmer:=1024*20;

end;

if Form1.RadioButton9.Checked=true then

begin

Wifrovanie_ECB('50.txt','DES_crypted&bsol;Z_50_6_ECB.txt');

razmer:=1024*50;

end;

if Form1.RadioButton8.Checked=true then

begin

Wifrovanie_ECB('100.txt','DES_crypted&bsol;Z_100_6_ECB.txt');

razmer:=1024*100;

end;

if Form1.RadioButton7.Checked=true then

begin

Wifrovanie_ECB('500.txt','DES_crypted&bsol;Z_500_6_ECB.txt');

razmer:=1024*500;

end;

if Form1.RadioButton6.Checked=true then

begin

Wifrovanie_ECB('1.txt','DES_crypted&bsol;Z_1_6_ECB.txt');

razmer:=1024*1024;

end;

t2:=Time;

vremja:=round((t2 - (t1))*24*60*60)+1;

Label33.Caption := IntToStr(vremja-1)+ 'сек';

Label34.Caption := FloatToStr(razmer/vremja-1)+'байт/сек';

end;

//Raswifrovanie failov klju4om na 6 bait

procedure TForm1.Button4Click(Sender: TObject);

var

klu4:string;

t1,t2:TDateTime;

vremja:integer;

razmer:integer;

begin

klu4:=Edit11.text;

while( Length(klu4)<8 ) do

klu4:=klu4+'0';

Formirovanie_16_podklju4ei(klu4);

t1:=Time;

if Form1.RadioButton10.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_20_6_ECB.txt','DES_uncrypted&bsol;R_20_6_ECB.txt');

razmer:=1024*20;

end;

if Form1.RadioButton9.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_50_6_ECB.txt','DES_uncrypted&bsol;R_50_6_ECB.txt');

razmer:=1024*50;

end;

if Form1.RadioButton8.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_100_6_ECB.txt','DES_uncrypted&bsol;R_100_6_ECB.txt');

razmer:=1024*100;

end;

if Form1.RadioButton7.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_500_6_ECB.txt','DES_uncrypted&bsol;R_500_6_ECB.txt');

razmer:=1024*500;

end;

if Form1.RadioButton6.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_1_6_ECB.txt','DES_uncrypted&bsol;R_1_6_ECB.txt');

razmer:=1024*1024;

end;

t2:=Time;

vremja:=round((t2 - t1)*24*60*60)+1;

Label33.Caption := IntToStr(vremja-1)+ 'сек';

Label34.Caption := FloatToStr(razmer/vremja-1)+'байт/сек';

end;

//Zawifrovanie failov klju4om na 7 bait

procedure TForm1.Button5Click(Sender: TObject);

var

klu4:string;

t1,t2:TDateTime;

vremja:integer;

razmer:integer;

begin

klu4:=Edit12.text;

while( Length(klu4)<8 ) do

klu4:=klu4+'0';

Formirovanie_16_podklju4ei(klu4);

t1:=Time;

if Form1.RadioButton10.Checked=true then

begin

Wifrovanie_ECB('20.txt','DES_crypted&bsol;Z_20_7_ECB.txt');

razmer:=1024*20;

end;

if Form1.RadioButton9.Checked=true then

begin

Wifrovanie_ECB('50.txt','DES_crypted&bsol;Z_50_7_ECB.txt');

razmer:=1024*50;

end;

if Form1.RadioButton8.Checked=true then

begin

Wifrovanie_ECB('100.txt','DES_crypted&bsol;Z_100_7_ECB.txt');

razmer:=1024*100;

end;

if Form1.RadioButton7.Checked=true then

begin

Wifrovanie_ECB('500.txt','DES_crypted&bsol;Z_500_7_ECB.txt');

razmer:=1024*500;

end;

if Form1.RadioButton6.Checked=true then

begin

Wifrovanie_ECB('1.txt','DES_crypted&bsol;Z_1_7_ECB.txt');

razmer:=1024*1024;

end;

t2:=Time;

vremja:=round((t2 - t1)*24*60*60)+1;

Label33.Caption := IntToStr(vremja-1)+ 'сек';

Label34.Caption := FloatToStr(razmer/vremja-1)+'байт/сек';

end;

//Raswifrovanie failov klju4om na 7 bait

procedure TForm1.Button6Click(Sender: TObject);

var

klu4:string;

t1,t2:TDateTime;

vremja:integer;

razmer:integer;

begin

klu4:=Edit12.text;

while( Length(klu4)<8 ) do

klu4:=klu4+'0';

Formirovanie_16_podklju4ei(klu4);

t1:=Time;

if Form1.RadioButton10.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_20_7_ECB.txt','DES_uncrypted&bsol;R_20_7_ECB.txt');

razmer:=1024*20;

end;

if Form1.RadioButton9.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_50_7_ECB.txt','DES_uncrypted&bsol;R_50_7_ECB.txt');

razmer:=1024*50;

end;

if Form1.RadioButton8.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_100_7_ECB.txt','DES_uncrypted&bsol;R_100_7_ECB.txt');

razmer:=1024*100;

end;

if Form1.RadioButton7.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_500_7_ECB.txt','DES_uncrypted&bsol;R_500_7_ECB.txt');

razmer:=1024*500;

end;

if Form1.RadioButton6.Checked=true then

begin

Raswifrovanie_ECB('DES_crypted&bsol;Z_1_7_ECB.txt','DES_uncrypted&bsol;R_1_7_ECB.txt');

razmer:=1024*1024;

end;

t2:=Time;

vremja:=round((t2 - t1)*24*60*60)+1;

Label33.Caption := IntToStr(vremja-1)+ 'сек';

Label34.Caption := FloatToStr(razmer/vremja-1)+'байт/сек';

end;

//CBC zawifrovanie failov klju4om na 5 bait

procedure TForm1.Button7Click(Sender: TObject);

var

klu4:string;

vektor:string;

t1,t2:TDateTime;

vremja:integer;

razmer:integer;

begin

klu4:=Edit10.text;

while( Length(klu4)<8 ) do

klu4:=klu4 + '*';

Formirovanie_16_podklju4ei(klu4);

vektor:=Edit1.text;

while( Length(vektor)<8 ) do

vektor:=vektor+ '0';

t1:=Time;

if Form1.RadioButton10.Checked=true then

begin

Wifrovanie_CBC('20.txt','DES_crypted&bsol;Z_20_5_CBС.txt',vektor);

razmer:=1024*20;

end;

if Form1.RadioButton9.Checked=true then

begin

Wifrovanie_CBC('50.txt','DES_crypted&bsol;Z_50_5_CBС.txt',vektor);

razmer:=1024*50;

end;

if Form1.RadioButton8.Checked=true then

begin

Wifrovanie_CBC('100.txt','DES_crypted&bsol;Z_100_5_CBС.txt',vektor);

razmer:=1024*100;

end;

if Form1.RadioButton7.Checked=true then

begin

Wifrovanie_CBC('500.txt','DES_crypted&bsol;Z_500_5_CBС.txt',vektor);

razmer:=1024*500;

end;

if Form1.RadioButton6.Checked=true then

begin

Wifrovanie_CBC('1.txt','DES_crypted&bsol;Z_1_5_CBС.txt',vektor);

razmer:=1024*1024;

end;

t2:=Time;

vremja:=round((t2 - t1)*24*60*60)+1;

Label34.Caption := IntToStr(vremja-1)+ 'сек';

Label34.Caption := FloatToStr(razmer/vremja-1)+'байт/сек';

end;

//CBC raswifrovanie failov klju4om na 5 bait

procedure TForm1.Button8Click(Sender: TObject);

var

klu4:string;

vektor:string;

t1,t2:TDateTime;

vremja:integer;

razmer:integer;

begin

klu4:=Edit10.text;

while( Length(klu4)<8 ) do

klu4:=klu4 + '*';

Formirovanie_16_podklju4ei(klu4);

vektor:=Edit1.text;

while( Length(vektor)<8 ) do

vektor:=vektor+ '0';

t1:=Time;

if Form1.RadioButton10.Checked=true then

begin

Raswifrovanie_CBC('DES_crypted&bsol;Z_20_5_CBС.txt','DES_uncrypted&bsol;R_20_5_CBС.txt',vektor);

razmer:=1024*20;

end;

if Form1.RadioButton9.Checked=true then

begin

Raswifrovanie_CBC('DES_crypted&bsol;Z_50_5_CBС.txt','DES_uncrypted&bsol;R_50_5_CBС.txt',vektor);

razmer:=1024*50;

end;

if Form1.RadioButton8.Checked=true then

begin

Raswifrovanie_CBC('DES_crypted&bsol;Z_100_5_CBС.txt','DES_uncrypted&bsol;R_100_5_CBС.txt',vektor);

razmer:=1024*100;

end;

if Form1.RadioButton7.Checked=true then

begin

Raswifrovanie_CBC('DES_crypted&bsol;Z_500_5_CBС.txt','DES_uncrypted&bsol;R_500_5_CBС.txt',vektor);

razmer:=1024*500;

end;

if Form1.RadioButton6.Checked=true then

begin

Raswifrovanie_CBC('DES_crypted&bsol;Z_1_5_CBС.txt','DES_uncrypted&bsol;R_1_5_CBС.txt',vektor);

razmer:=1024*1024;

end;

t2:=Time;

vremja:=round((t2 - t1)*24*60*60)+1;

Label33.Caption := IntToStr(vremja-1)+ 'сек';

Label34.Caption := FloatToStr(razmer/vremja-1)+'байт/сек';

end;

//CBC zawifrovanie failov klju4om na 6 bait

procedure TForm1.Button9Click(Sender: TObject);

var

klu4:string;

vektor:string;

t1,t2:TDateTime;

vremja:integer;

razmer:integer;

begin

klu4:=Edit11.text;

while( Length(klu4)<8 ) do

klu4:=klu4 + '*';

Formirovanie_16_podklju4ei(klu4);

vektor:=Edit1.text;

while( Length(vektor)<8 ) do

vektor:=vektor+ '0';

t1:=Time;

if Form1.RadioButton10.Checked=true then

begin

Wifrovanie_CBC('20.txt','DES_crypted&bsol;Z_20_6_CBС.txt',vektor);

razmer:=1024*20;

end;

if Form1.RadioButton9.Checked=true then

begin

Wifrovanie_CBC('50.txt','DES_crypted&bsol;Z_50_6_CBС.txt',vektor);

razmer:=1024*50;

end;

if Form1.RadioButton8.Checked=true then

begin

Wifrovanie_CBC('100.txt','DES_crypted&bsol;Z_100_6_CBС.txt',vektor);

razmer:=1024*100;

end;

if Form1.RadioButton7.Checked=true then

begin

Wifrovanie_CBC('500.txt','DES_crypted&bsol;Z_500_6_CBС.txt',vektor);

razmer:=1024*500;

end;

if Form1.RadioButton6.Checked=true then

begin

Wifrovanie_CBC('1.txt','DES_crypted&bsol;Z_1_6_CBС.txt',vektor);

razmer:=1024*1024;

end;

t2:=Time;

vremja:=round((t2 - t1)*24*60*60)+1;

Label33.Caption := IntToStr(vremja-1)+ 'сек';

Label34.Caption := FloatToStr(razmer/vremja-1)+'байт/сек';

end;

//CBC raswifrovanie failov klju4om na 6 bait

procedure TForm1.Button10Click(Sender: TObject);

var

klu4:string;

vektor:string;

t1,t2:TDateTime;

vremja:integer;

razmer:integer;

begin

klu4:=Edit11.text;

while( Length(klu4)<8 ) do

klu4:=klu4 + '*';

Formirovanie_16_podklju4ei(klu4);

vektor:=Edit1.text;

while( Length(vektor)<8 ) do

vektor:=vektor+ '0';

t1:=Time;

if Form1.RadioButton10.Checked=true then

begin

Raswifrovanie_CBC('DES_crypted&bsol;Z_20_6_CBС.txt','DES_uncrypted&bsol;R_20_6_CBС.txt',vektor);

razmer:=1024*20;

end;

if Form1.RadioButton9.Checked=true then

begin

Raswifrovanie_CBC('DES_crypted&bsol;Z_50_6_CBС.txt','DES_uncrypted&bsol;R_50_6_CBС.txt',vektor);

razmer:=1024*50;

end;

if Form1.RadioButton8.Checked=true then

begin

Raswifrovanie_CBC('DES_crypted&bsol;Z_100_6_CBС.txt','DES_uncrypted&bsol;R_100_6_CBС.txt',vektor);

razmer:=1024*100;

end;

if Form1.RadioButton7.Checked=true then

begin

Raswifrovanie_CBC('DES_crypted&bsol;Z_500_6_CBС.txt','DES_uncrypted&bsol;R_500_6_CBС.txt',vektor);

razmer:=1024*500;

end;

if Form1.RadioButton6.Checked=true then

begin

Raswifrovanie_CBC('DES_crypted&bsol;Z_1_6_CBС.txt','DES_uncrypted&bsol;R_1_6_CBС.txt',vektor);

razmer:=1024*1024;

end;

t2:=Time;

vremja:=round((t2 - t1)*24*60*60);

Label33.Caption := IntToStr(vremja)+ 'сек';

Label34.Caption := FloatToStr(razmer/vremja)+'байт/сек';

end;

//CBC zawifrovanie failov klju4om na 7 bait

procedure TForm1.Button11Click(Sender: TObject);

var

klu4:string;

vektor:string;

t1,t2:TDateTime;

vremja:integer;

razmer:integer;

begin

klu4:=Edit12.text;

while( Length(klu4)<8 ) do

klu4:=klu4 + '*';

Formirovanie_16_podklju4ei(klu4);

vektor:=Edit1.text;

while( Length(vektor)<8 ) do

vektor:=vektor+ '0';

t1:=Time;

if Form1.RadioButton10.Checked=true then

begin

Wifrovanie_CBC('20.txt','DES_crypted&bsol;Z_20_7_CBС.txt',vektor);

razmer:=1024*20;

end;

if Form1.RadioButton9.Checked=true then

begin

Wifrovanie_CBC('50.txt','DES_crypted&bsol;Z_50_7_CBС.txt',vektor);

razmer:=1024*50;

end;

if Form1.RadioButton8.Checked=true then

begin

Wifrovanie_CBC('100.txt','DES_crypted&bsol;Z_100_7_CBС.txt',vektor);

razmer:=1024*100;

end;

if Form1.RadioButton7.Checked=true then

begin

Wifrovanie_CBC('500.txt','DES_crypted&bsol;Z_500_7_CBС.txt',vektor);

razmer:=1024*500;

end;

if Form1.RadioButton6.Checked=true then

begin

Wifrovanie_CBC('1.txt','DES_crypted&bsol;Z_1_7_CBС.txt',vektor);

razmer:=1024*1024;

end;

t2:=Time;

vremja:=round((t2 - t1)*24*60*60)+1;

Label33.Caption := IntToStr(vremja-1)+ 'сек';

Label34.Caption := FloatToStr(razmer/vremja-1)+'байт/сек';

end;

//CBC raswifrovanie failov klju4om na 7 bait

procedure TForm1.Button12Click(Sender: TObject);

var

klu4:string;

vektor:string;

t1,t2:TDateTime;

vremja:integer;

razmer:integer;

begin

klu4:=Edit12.text;

while( Length(klu4)<8 ) do

klu4:=klu4 + '*';

Formirovanie_16_podklju4ei(klu4);

vektor:=Edit1.text;

while( Length(vektor)<8 ) do

vektor:=vektor+ '0';

t1:=Time;

if Form1.RadioButton10.Checked=true then