Реферат: Обнаружение вредоносных закладок

else begin

if FileSize(F_Mag)=0 then y:=Yo

else begin

y:=yo;

f:=20*round(FileSize(F_Mag)/30);

i:=1;

repeat

generator;

i:=i+1

until i>=f+1;

end;

end;

Seek(F_Mag,FileSize(F_Mag));

i:=1;

repeat

generator;

xxx:=Chr((ord(Ident[i]))xor(y));

Write(F_Mag,xxx);

i:=i+1;

until i>=11;

i:=1;

repeat

generator;

xxx:=Chr((ord(PSWord[i]))xor(y));

Write(F_Mag,xxx);

i:=i+1;

until i>=11;

{чтение информации из файла}

Y:=14;

AssignFile(F_PSW,'password.txt');

Reset(F_PSW);

{фамилии}

j:=1;

repeat

Read(F_PSW,Surname[j]);

j:=j+1

until j>=151;

{идентификаторы}

j:=1;

repeat

Read(F_PSW,IDs[j]);

generator;

ids[j]:=chr((ord(ids[j]))xor(y));

j:=j+1

until j>=101;

{пароли}

j:=1;

repeat

Read(F_PSW,PSWs[j]);

generator;

PSWs[j]:=chr((ord(PSWs[j]))xor(y));

j:=j+1

until j>=101;

CloseFile(F_PSW);

{сбор в массив UserMatrix}

i:=1;

repeat

stroca:='';

j:=1;

repeat

if Surname[(i-1)*15+j]<>' ' then stroca:=stroca+Surname[(i-1)*15+j];

j:=j+1

until j>=16;

UserMatrix[i,1]:=stroca;

i:=i+1

until i>=11;

i:=1;

repeat

stroca:='';

j:=1;

repeat

if IDs[(i-1)*10+j]<>' ' then stroca:=stroca+IDs[(i-1)*10+j];

j:=j+1

until j>=11;

UserMatrix[i,2]:=stroca;

i:=i+1

until i>=11;

i:=1;

repeat

stroca:='';

j:=1;

repeat

if PSWs[(i-1)*10+j]<>' ' then stroca:=stroca+PSWs[(i-1)*10+j];

j:=j+1

until j>=11;

UserMatrix[i,3]:=stroca;

i:=i+1

until i>=11;

{идентификация и аутентификация}

flag:=0;

i:=1;

repeat

if (EditID.Text=UserMatrix[i,2])and(EditPSW.Text=UserMatrix[i,3])and

(EditID.Text<>'') then begin

Flag:=1;

i1:=i end;

i:=i+1

until i>=11;

if flag=1 then begin

xxx:='y';

i:=1;

repeat

Write(F_Mag,xxx);

i:=i+1

until i>=11;

CloseFile(F_Mag);

Form3.Visible:=true;

end

else

begin

xxx:='n';

i:=1;

repeat

Write(F_Mag,xxx);

i:=i+1

until i>=11;

CloseFile(F_Mag)

end;

end;

end;

end.


unit Unitkurs;{администрирование}

interface

uses

Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

StdCtrls, Grids, ComCtrls;

type

TForm2 = class(TForm)

ButtonAdd: TButton;

ButtonDel: TButton;

Button3: TButton;

Button1: TButton;

StringGrid1: TStringGrid;

procedure FormActivate(Sender: TObject);

procedure ButtonAddClick(Sender: TObject);

procedure ButtonDelClick(Sender: TObject);

procedure Button3Click(Sender: TObject);

procedure Button1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

procedure Generator;

end;

var

Form2: TForm2;

F_PSW:file of char;{переменная, связанная с файлом 'password.txt'}

i,j,l:integer;

y:integer;{псевдослучайное число}

UserMatrix:array[1..10,1..3] of string;{массив фамилий, идентификаторов и паролей пользователей}

Surname:array[1..150] of char;{массив фамилий пользователей}

IDs:array[1..100] of char;{массив идентификаторов пользователей}

PSWs:array[1..100] of char;{массив паролей пользователей}

stroca:string;

implementation

uses Unitkurs4;

{$R *.DFM}

{процедура реализующая ЛИНЕЙНЫЙ КОНГУЭНТНЫЙ ГЕНЕРАТОР}

procedure Tform2.Generator;

begin

y:=(31*y+17)mod(257);

end;

procedure TForm2.FormActivate(Sender: TObject);

begin

y:=14;

{оглавление таблицы пользователей}

i:=1;

repeat

StringGrid1.Cells[0,i]:=IntToStr(i);

i:=i+1;

until i>=11;

StringGrid1.Cells[1,0]:='фамилия';

StringGrid1.Cells[2,0]:='идентификатор';

StringGrid1.Cells[3,0]:='пароль';

{чтение информации из файла 'password.txt'}

AssignFile(F_PSW,'password.txt');

Reset(F_PSW);

{фамилии}

j:=1;

repeat

Read(F_PSW,Surname[j]);

j:=j+1

until j>=151;

{идентификаторы}

j:=1;

repeat

Read(F_PSW,IDs[j]);

generator;

ids[j]:=chr((ord(ids[j]))xor(y));

j:=j+1

until j>=101;

{пароли}

j:=1;

repeat

Read(F_PSW,PSWs[j]);

generator;

PSWs[j]:=chr((ord(PSWs[j]))xor(y));

j:=j+1

until j>=101;

CloseFile(F_PSW);

{сбор в массив UserMatrix}

i:=1;

repeat

stroca:='';

j:=1;

repeat

if Surname[(i-1)*15+j]<>' ' then stroca:=stroca+Surname[(i-1)*15+j];

j:=j+1

until j>=16;

UserMatrix[i,1]:=stroca;

i:=i+1

until i>=11;

i:=1;

repeat

stroca:='';

j:=1;

repeat

if IDs[(i-1)*10+j]<>' ' then stroca:=stroca+IDs[(i-1)*10+j];

j:=j+1

until j>=11;

UserMatrix[i,2]:=stroca;

i:=i+1

until i>=11;

i:=1;

repeat

stroca:='';

j:=1;

repeat

if PSWs[(i-1)*10+j]<>' ' then stroca:=stroca+PSWs[(i-1)*10+j];

j:=j+1

until j>=11;

UserMatrix[i,3]:=stroca;

i:=i+1

until i>=11;

{отображение в таблице}

i:=1;

repeat

j:=1;

repeat

StringGrid1.Cells[j,i]:=UserMatrix[i,j];

j:=j+1

until j>=4;

i:=i+1

until i>=11;

end;

{===============нажатие кнопки 'сохранить изменения'=======================}

procedure TForm2.ButtonAddClick(Sender: TObject);

begin

y:=14;

{заполнение массива UserMatrix}

i:=1;

repeat

j:=1;

repeat

UserMatrix[i,j]:=StringGrid1.Cells[j,i];

j:=j+1

until j>=4;

i:=i+1

until i>=11;

{заполнение массива surname}

i:=1;

repeat

stroca:=UserMatrix[i,1];

l:=length(stroca);

j:=1;

repeat

if j<=l then Surname[(i-1)*15+j]:=stroca[j]

else Surname[(i-1)*15+j]:=' ';

j:=j+1

until j>=16;

i:=i+1

until i>=11;

{заполнение массива IDs}

i:=1;

repeat

stroca:=UserMatrix[i,2];

l:=length(stroca);

j:=1;

repeat

if j<=l then IDs[(i-1)*10+j]:=stroca[j]

else IDs[(i-1)*10+j]:=' ';

j:=j+1

until j>=11;

i:=i+1

until i>=11;

{заполнение массива PSWs}

i:=1;

repeat

stroca:=UserMatrix[i,3];

l:=length(stroca);

j:=1;

repeat

if j<=l then PSWs[(i-1)*10+j]:=stroca[j]

else PSWs[(i-1)*10+j]:=' ';

j:=j+1

until j>=11;

i:=i+1

until i>=11;

{запись в файл 'password.txt'}

AssignFile(F_PSW,'password.txt');

Rewrite(F_PSW);

{фамилии без преобразования}

j:=1;

repeat

write(F_PSW,Surname[j]);

j:=j+1

until j>=151;

{идентификаторы}

j:=1;

repeat

generator;

ids[j]:=chr((ord(ids[j]))xor(y));

write(F_PSW,IDs[j]);

j:=j+1

until j>=101;

{пароли}

j:=1;

repeat

generator;

PSWs[j]:=chr((ord(PSWs[j]))xor(y));

write(F_PSW,PSWs[j]);

j:=j+1

until j>=101;

CloseFile(F_PSW);

end;

{нажатие кнопки 'очистить'}

procedure TForm2.ButtonDelClick(Sender: TObject);

begin

{очистка таблицы}

i:=1;

repeat

j:=1;

repeat

StringGrid1.Cells[j,i]:='';

j:=j+1

until j>=4;

i:=i+1

until i>=11;

end;

procedure TForm2.Button3Click(Sender: TObject);

begin

close

end;

procedure TForm2.Button1Click(Sender: TObject);

begin

Form4.Visible:=True

end;

end.


unit Unitkurs4;{журнал аудита}

interface

uses

Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

StdCtrls, Grids;

type

TForm4 = class(TForm)

StringGrid1: TStringGrid;

ButtonDel: TButton;

Button2: TButton;

ButtonShow: TButton;

procedure Button2Click(Sender: TObject);

procedure ButtonShowClick(Sender: TObject);

procedure ButtonDelClick(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

procedure Generator;

end;

var

Form4: TForm4;

F_Mag:file of char;{переменная, связанная с файлом 'audit.txt'}

i,j,l,i1:integer;

y:integer;{псевдослучайное число}

ident,psword:string;

xxx:char;

implementation

{$R *.DFM}

{процедура реализующая ЛИНЕЙНЫЙ КОНГУЭНТНЫЙ ГЕНЕРАТОР}

procedure Tform4.Generator;

begin

y:=(31*y+17)mod(257);

end;

procedure TForm4.Button2Click(Sender: TObject);

begin

close

end;

{нажатие кнопки 'показать'}

procedure TForm4.ButtonShowClick(Sender: TObject);

begin

i:=1;

repeat

StringGrid1.Cells[0,i]:=IntToStr(i);

i:=i+1;

until i>=11;

StringGrid1.Cells[1,0]:='идентификатор';

StringGrid1.Cells[2,0]:='пароль';

StringGrid1.Cells[3,0]:='результат';

{чтение информации из файла 'audit.txt'}

{$I-}

AssignFile(F_Mag,'audit');

Reset(F_Mag);

{$I+}

if IOResult=0 then begin

i1:=1;

y:=14;

while not(EoF(F_Mag)) do

begin

j:=1;

repeat

Read(F_Mag,xxx);

generator;

xxx:=chr((ord(xxx))xor(y));

ident:=ident+xxx;

j:=j+1

until j>=11;

i:=1;

repeat

Read(F_Mag,xxx);

generator;

xxx:=Chr((ord(xxx))xor(y));

psword:=psword+xxx;

i:=i+1;

until i>=11;

if StringGrid1.RowCount

then StringGrid1.RowCount:=StringGrid1.RowCount+1;

StringGrid1.Cells[0,i1]:=IntToStr(i1);

StringGrid1.Cells[1,i1]:=ident;

StringGrid1.Cells[2,i1]:=psword;

i:=1;

repeat

Read(F_Mag,xxx);

i:=i+1

until i>=11;

if xxx='y' then StringGrid1.Cells[3,i1]:='допуск'

else StringGrid1.Cells[3,i1]:='отказ';

ident:='';

psword:='';

i1:=i1+1;

end;

CloseFile(F_Mag) end;

end;

{нажатие кнопки 'очистить'}

procedure TForm4.ButtonDelClick(Sender: TObject);

begin

StringGrid1.RowCount:=11;

i:=1;

repeat

StringGrid1.Cells[1,i]:='';

StringGrid1.Cells[2,i]:='';

StringGrid1.Cells[3,i]:='';

i:=i+1

until i>=11;

AssignFile(F_Mag,'audit');

Rewrite(F_Mag);

CloseFile(F_Mag);

end;


end.


Литература:

  1. Белкин П.Ю. , Михальский О.О. , Першаков А.С. и другие “Программно-аппаратные средства обеспечения информационной безопасности: защита программ и данных”.

  2. Зима В.М. и другие “Защита компьютерных ресурсов от несанкционированных действий пользователя”.

  3. Романец Ю.В. , Тимофеев П.А. , Шаньгин В.Ф. “Защита информации в компьютерных системах”.




Министерство образования рф

ТАГАНРОГСКИЙ ГОСУДАРСТВЕННЫЙ РАДИОТЕХНИЧЕСКИЙ УНИВЕРСИТЕТ


КАФЕДРА БИТ


Курсовой проект


По курсу «ПАСОИБ»


на тему «Обнаружение вредоносных закладок»


Выполнил:

__________

__________


Проверили:

_________________________________

_________________________________



Таганрог 2002г.