Разработка программного средства, обеспечивающего криптографическую защиту файлов

Дипломная работа - Компьютеры, программирование

Другие дипломы по предмету Компьютеры, программирование



+buffer);_key.Key_IDEA[3]:=U_key.Key_IDEA[3] xor pl;:=copy(S_key, 88,8);:= StrToInt($+buffer);_key.Key_IDEA[4]:=U_key.Key_IDEA[4] xor pl;

////

// MessageDlg(inttostr(U_key.Key_IDEA[1]) + + inttostr(U_key.Key_IDEA[2]) + + inttostr(U_key.Key_IDEA[3]) + + inttostr(U_key.Key_IDEA[4]), mtWarning, [mbOK],0);

////:=copy(S_key, 96,8);:= StrToInt($+buffer);_key.Key_CONST[1]:=U_key.Key_CONST[1] xor pl;:=copy(S_key, 104,8);:= StrToInt($+buffer);_key.Key_CONST[2]:=U_key.Key_CONST[2] xor pl;:=copy(S_key, 112,8);:= StrToInt($+buffer);_key.Key_CONST[3]:=U_key.Key_CONST[3] xor pl;:=copy(S_key, 120, 8);:= StrToInt($+buffer);_key.Key_CONST[4]:=U_key.Key_CONST[4] xor pl;

// первый блок ключа успешно зашифрован! Мы молодцы!

////////////

//получаем дату

data_:=Date;

DecodeDate(data_, y, m, day);day<10 then str:= str + 0 + inttostr(day);m<10 then str:= str + 0 + inttostr(m);:= str + inttostr(y);_key.data_key:= strtoint(str);

// шифруем вторую часть ключа

// MessageDlg(inttostr(U_key.CRC64_2) , mtWarning, [mbOK],0);:=copy(lite_key, 1,8);:= StrToInt($+buffer);_key.CRC64_2:= U_key.CRC64_2 xor pl;:=copy(lite_key, 8,8);:= StrToInt($+buffer);_key.Key_counter:=U_key.Key_counter xor pl;:=copy(lite_key, 16,8);:= StrToInt($+buffer);_key.data_key :=U_key.data_key xor pl;

//считаем CRC64 от 1 и 2 части ключа уже зашифрованных:

buffer:=;i:=1 to 8 do:= buffer + inttostr(U_key.Key_RC[i]);i:=1 to 4 do:= buffer + inttostr(U_key.Key_IDEA[i]);i:=1 to 4 do:= buffer + inttostr(U_key.Key_CONST[i]);:= buffer + inttostr(U_key.CRC64_2);:= buffer + inttostr(U_key.Key_counter);:= buffer + inttostr(U_key.data_key);_key.CRC64_1:= CRC64_sum(buffer);

//создаем USB-ключ_key.Control_hash:= Control_hash;_key.Familiy:= Form3.Edit1.Text;_key.Name:= Form3.Edit2.Text;

//проверка:

{ MessageDlg(RC6 +inttostr(U_key.Key_RC[1]) + + inttostr(U_key.Key_RC[2]) + + inttostr(U_key.Key_RC[3]) + + inttostr(U_key.Key_RC[4]) + + inttostr(U_key.Key_RC[5]) + + inttostr(U_key.Key_RC[6]) + + inttostr(U_key.Key_RC[7]) + + inttostr(U_key.Key_RC[8]) , mtWarning, [mbOK],0);(IDEA +inttostr(U_key.Key_IDEA[1]) + + inttostr(U_key.Key_IDEA[2]) + + inttostr(U_key.Key_IDEA[3]) + + inttostr(U_key.Key_IDEA[4]), mtWarning, [mbOK],0);(CONST +inttostr(U_key.Key_CONST[1]) + + inttostr(U_key.Key_CONST[2]) + +inttostr(U_key.Key_CONST[3]) + +inttostr(U_key.Key_CONST[4]) , mtWarning, [mbOK],0);(CRC2 + inttostr(U_key.CRC64_2), mtWarning, [mbOK],0);(Счетчик + inttostr(U_key.Key_counter) , mtInformation, [mbOK],0);(Дата + inttostr(U_key.data_key) , mtInformation, [mbOK],0);(Control_hash + Control_hash , mtInformation, [mbOK],0);(FAM + U_key.Familiy , mtInformation, [mbOK],0);(Name + U_key.Name , mtInformation, [mbOK],0);(CRC1 + inttostr(U_key.CRC64_1) , mtInformation, [mbOK],0);

}(fkey, Form3.drivecombobox1.Drive + :\qwallke.qwkey);(fkey);(fkey, U_key);(fkey);(Form3.drivecombobox1.Drive + :\qwallke.qwkey, faHidden);

//делаем его невидимым(USB-ключ успешно создан! , mtInformation, [mbOK],0);.Timer1.Enabled:=true;.Show;.Hide;;

Edit4.Text)thenMessageDlg(!,mtWarning,[mbOK],0)">{===============}TForm3.Button1Click(Sender: TObject);: byte;:=0;(Length(Edit1.Text) Edit4.Text) then MessageDlg(Подтверждение пароля неверно! Повторите попытку, mtWarning, [mbOK],0)

else new_yserkey;

end;

{==================================}

//перехватываем закрытие формы и закрываем прогу

Procedure TForm3.WMGetSysCommand(var Message : TMessage) ;: integer;code=0 then begin(Message.wParam = SC_MINIMIZE)Form1.Visible:=False;(Message.wParam = SC_CLOSE)begin.Terminate; endInherited;;(Message.wParam = SC_CLOSE) and (code=1)Form3.Hide;;

A)and(copy(str,i,1)7 then begin

//PostMessage(ProgressBar1.Handle, $0409, 0, clRed);

//newuser:=true;.Position:=length(str) + k;

//GroupBox3.Enabled:=true;;;TForm3.DriveComboBox1Change(Sender: TObject);: dword;, FSName : array [0..255] of char;,: dword;: boolean;(PChar(drivecombobox1.Drive + :\),, SizeOf(VolumeName),

thenlabel11.Visible:=true;.Font.Color:=clRed;.Enabled:=falseendbegin.Font.Color:=clBlack;.Enabled:=true;;;">@SerialNum,,,, SizeOf(FSName));.Caption:= Имя диска: + VolumeName;_numdisk:=SerialNum;//узнаем id USB:=FileExists(PChar(drivecombobox1.Drive + :\ + qwallke.qwkey));FileEx=true then begin.Caption:=Этот USB уже является ключом!;edit4.text<> then label11.Visible:=true;.Font.Color:=clRed;.Enabled:=false endbegin.Font.Color:=clBlack;.Enabled:=true;;;

{=============================}TForm3.FormCreate(Sender: TObject);: integer;: uInt;

//newuser:=false;

{оставляем только сменные носители}

Drive_Removable)then.DriveComboBox1.Items.Delete(i)(i);;.button1.Enabled:=false;;TForm3.Image1Click(Sender:TObject);">i := 0;i Drive_Removable) then.DriveComboBox1.Items.Delete(i)(i);;.button1.Enabled:=false;;TForm3.Image1Click(Sender: TObject);

MessageDlg(В этом окне вы можете создать USB-ключ. Он понадобится Вам для шифрования и расшифрования файлов и файловых контейнеров. Заполните все поля. ВНИМАНИЕ: запомните введенные ЛОГИН и ПАРОЛЬ - они понадобятся для входа в систему. , mtInformation, [mbOK],0);;.