ΠŸΠΎΠΌΠΎΡ‰ΡŒ Π² написании студСнчСских Ρ€Π°Π±ΠΎΡ‚
АнтистрСссовый сСрвис

Π‘. Π Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния для ΡˆΠΈΡ„Ρ€ΠΎΠ²Π°Π½ΠΈΡ Π΄Π°Π½Π½Ρ‹Ρ…

Π Π΅Ρ„Π΅Ρ€Π°Ρ‚ΠŸΠΎΠΌΠΎΡ‰ΡŒ Π² Π½Π°ΠΏΠΈΡΠ°Π½ΠΈΠΈΠ£Π·Π½Π°Ρ‚ΡŒ ΡΡ‚ΠΎΠΈΠΌΠΎΡΡ‚ΡŒΠΌΠΎΠ΅ΠΉ Ρ€Π°Π±ΠΎΡ‚Ρ‹

MessageDlg ('Π’ этом ΠΎΠΊΠ½Π΅ Π²Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΡΠΎΠ·Π΄Π°Ρ‚ΡŒ USB-ΠΊΠ»ΡŽΡ‡. Он ΠΏΠΎΠ½Π°Π΄ΠΎΠ±ΠΈΡ‚ся Π’Π°ΠΌ для ΡˆΠΈΡ„Ρ€ΠΎΠ²Π°Π½ΠΈΡ ΠΈ Ρ€Π°ΡΡˆΠΈΡ„рования Ρ„Π°ΠΉΠ»ΠΎΠ² ΠΈ Ρ„Π°ΠΉΠ»ΠΎΠ²Ρ‹Ρ… ΠΊΠΎΠ½Ρ‚Π΅ΠΉΠ½Π΅Ρ€ΠΎΠ². Π—Π°ΠΏΠΎΠ»Π½ΠΈΡ‚Π΅ всС поля. Π’ΠΠ˜ΠœΠΠΠ˜Π•: Π·Π°ΠΏΠΎΠΌΠ½ΠΈΡ‚Π΅ Π²Π²Π΅Π΄Π΅Π½Π½Ρ‹Π΅ Π›ΠžΠ“Π˜Π ΠΈ ΠŸΠΠ ΠžΠ›Π¬ — ΠΎΠ½ΠΈ понадобятся для Π²Ρ…ΠΎΠ΄Π° Π² ΡΠΈΡΡ‚Π΅ΠΌΡƒ. ', mtInformation, 0); MessageDlg ('RC6 ' +inttostr (U_key.Key_RC) + ' ' + inttostr (U_key.Key_RC) + ' ' + inttostr (U_key.Key_RC) + ' ' + inttostr… Π§ΠΈΡ‚Π°Ρ‚ΡŒ Π΅Ρ‰Ρ‘ >

Π‘. Π Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния для ΡˆΠΈΡ„Ρ€ΠΎΠ²Π°Π½ΠΈΡ Π΄Π°Π½Π½Ρ‹Ρ… (Ρ€Π΅Ρ„Π΅Ρ€Π°Ρ‚, курсовая, Π΄ΠΈΠΏΠ»ΠΎΠΌ, ΠΊΠΎΠ½Ρ‚Ρ€ΠΎΠ»ΡŒΠ½Π°Ρ)

unit Unit3;

interface.

uses.

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,.

Dialogs, StdCtrls, ComCtrls, FileCtrl, CryptoAPI, CRC64, ExtCtrls;

type.

USB_key = record.

Key_RC: Array [1.8] of cardinal; //256bit ΠΊΠ»ΡŽΡ‡ ΡˆΠΈΡ„Ρ€ΠΎΠ²Π°Π½ΠΈΡ RC6.

Key_IDEA: Array [1.4] of cardinal;//128bit ΠΊΠ»ΡŽΡ‡ ΡˆΠΈΡ„Ρ€ΠΎΠ²Π°Π½ΠΈΡ IDEA.

Key_CONST: Array [1.4] of cardinal;//128bit Π²Π΅ΠΊΡ‚ΠΎΡ€ ΠΈΠ½ΠΈΡ†ΠΈΠ°Π»ΠΈΠ·Π°Ρ†ΠΈΠΈ.

CRC642: int64; //64bit ΠΊΠΎΠ½Ρ‚ сумма ОВКРЫВЫΠ₯ ΠΏΠΎΠ»Π΅ΠΉ Π²Ρ‹ΡˆΠ΅.

Key_counter: cardinal; //32bit счСтчик — мСняСтся ΠΊΠ°ΠΆΠ΄Ρ‹ΠΉ сСанс Ρ€Π°Π±ΠΎΡ‚Ρ‹ с ΠΊΠ»ΡŽΡ‡ΠΎΠΌ.

data_key: cardinal;//32bit Π΄Π°Ρ‚Π° создания ΠΊΠ»ΡŽΡ‡Π° Π”Π”ΠœΠœΠ“Π“.

Control_hash: string[128]; //512bit.

Familiy: string[60];

Name: string[30];

CRC641: int64;//64.

end;

TForm3 = class (TForm).

Label1: TLabel;

GroupBox1: TGroupBox;

Label2: TLabel;

Label3: TLabel;

Edit1: TEdit;

Label4: TLabel;

Edit2: TEdit;

Label5: TLabel;

Edit3: TEdit;

Label6: TLabel;

Edit4: TEdit;

Label7: TLabel;

Edit5: TEdit;

ProgressBar1: TProgressBar;

Button1: TButton;

GroupBox3: TGroupBox;

Label10: TLabel;

DriveComboBox1: TDriveComboBox;

Label11: TLabel;

Image1: TImage;

Procedure WMGetSysCommand (var Message: TMessage); message WM_SYSCOMMAND;

procedure Button1Click (Sender: TObject);

procedure Edit4Change (Sender: TObject);

procedure DriveComboBox1Change (Sender: TObject);

procedure FormCreate (Sender: TObject);

procedure Image1Click (Sender: TObject);

private.

{ Private declarations }.

public.

{ Public declarations }.

end;

var.

Form3: TForm3;

G_numdisk: cardinal;

function CRC64_sum (str: string): int64;

procedure new_yserkey;

function hexTOdec (str: string):cardinal;

implementation.

uses Unit1, Unit2;

{$R *.dfm}.

{======================================}.

function hexTOdec (str: string):cardinal;

CONST HEX: ARRAY['a'.'f'] OF INTEGER = (10,11,12,13,14,15);

VAR.

Int, i: cardinal;

BEGIN.

str:='ffffffff';

Int := 0;

FOR i := 1 TO Length (str) DO.

IF str[i] < 'A' THEN Int := Int * 16 + ORD (str[i]) — 48.

ELSE Int := Int * 16 + HEX[str[i]];

HexToDec:= int;

end;

{======================================}.

function c_GetTempPath: String; //ΠΏΡƒΡ‚ΡŒ ΠΊ TEMP ΠΏΠ°ΠΏΠΊΠ΅.

var.

Buffer: array[0.1023] of Char;

begin.

SetString (Result, Buffer, GetTempPath (Sizeof (Buffer)-1,Buffer));

end;

{======================================}.

function CRC64_sum (str: string): int64;

var.

InFile: TFileStream;

f1: textfile;

crc: int64;

TempPath: string;

begin.

TempPath:=c_GetTempPath;

assign (f1, TempPath+'+ 'crc.qwl');

rewrite (f1);

write (f1, str);

closefile (f1);

InFile := TFileStream. Create (TempPath+'+ 'crc.qwl', fmShareDenyNone);

crc:=(CRC64Stream (INFILE, SIZEOF (INFILE), 1024));

DeleteFile (TempPath+'+ 'crc.qwl');

CRC64_sum:=crc;

end;

{================}.

procedure new_yserkey;

const.

max = 4 294 967 295;

var.

ret: LongWord;

buffer, d, Control_hash, Lite_key, S_key, str: String;

i: integer;

num_user, pl: cardinal; //Π½ΠΎΠΌΠ΅Ρ€ ΡŽΠ·Π΅Ρ€Π°.

U_key: USB_key;

Fkey: file of USB_key;

data_: TDateTime;

y, m, day: word; //для ΠΏΠ΅Ρ€Π΅Π²ΠΎΠ΄Π° Π΄Π°Ρ‚Ρ‹ Π² Ρ‡ΠΈΡΠ»ΠΎ.

begin.

randomize ();

U_key.Key_counter:= Random (max); //ΠΎΠ΄Π½ΠΎΡ€Π°Π·ΠΎΠ²Ρ‹ΠΉ счСтчик.

//Ρ€Π°Π·ΠΌΠ½ΠΎΠΆΠ°Π΅ΠΌ ΠΈ Π·Π°Π³ΠΎΠ½ΡΠ΅ΠΌ Π² Π±ΡƒΡ„Π΅Ρ€: ΠΏΠ°Ρ€ΠΎΠ»ΡŒ_соль_id USB.

d:='';

buffer:='';

d:= '76' + Form3. edit4.text + '4387swqsalt_ewui3765_saltvlkskl09' + Form3. edit3.text + '438 7654salt_745 963 765_saltvlkrto743' + inttostr (G_numdisk);

for i:=1 to 765 do.

buffer:= buffer + d;

ret := HashStr (HASH_SHA512, buffer, Control_hash); //.

d:='';

buffer:='';

d:= Form3. edit3.text + '4333salt_OUedie437_saltvlkskl09' + Form3. edit4.text + 'AQQQdkwpsalt_07CNJWEKUEk_saltvdw7DH3' + inttostr (G_numdisk);

for i:=1 to 801 do.

buffer:= buffer + d;

ret := HashStr (HASH_SHA512, buffer, Lite_key); //.

{MessageDlg (Control_hash, mtWarning, [mbOK], 0);

MessageDlg (Lite_key, mtWarning, [mbOK], 0);}.

Randomize ();

U_key.Key_RC[1]: = Random (max);

U_key.Key_RC[2]: = Random (max);

U_key.Key_RC[3]: = Random (max);

U_key.Key_RC[4]: = Random (max);

U_key.Key_RC[5]: = Random (max);

U_key.Key_RC[6]: = Random (max);

U_key.Key_RC[7]: = Random (max);

U_key.Key_RC[8]: = Random (max);

U_key.Key_IDEA[1]: =Random (max);

U_key.Key_IDEA[2]: =Random (max);

U_key.Key_IDEA[3]: =Random (max);

U_key.Key_IDEA[4]: =Random (max);

U_key.Key_CONST[1]: =Random (max);

U_key.Key_CONST[2]: =Random (max);

U_key.Key_CONST[3]: =Random (max);

U_key.Key_CONST[4]: =Random (max);

// 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);

// MessageDlg ('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);

// MessageDlg ('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);

//считаСм CRC64 ΠΎΡ‚ ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚Ρ‹Ρ… ΠΊΠ»ΡŽΡ‡Π΅ΠΉ ΠΈ Π²Π΅ΠΊΡ‚ΠΎΡ€Π° ΠΈΠ½ΠΈΡ†ΠΈΠ°Π»ΠΈΠ·Π°Ρ†ΠΈΠΈ:

buffer:='';

for i:=1 to 8 do.

buffer:= buffer + inttostr (U_key.Key_RC[i]);

for i:=1 to 4 do.

buffer:= buffer + inttostr (U_key.Key_IDEA[i]);

for i:=1 to 4 do.

buffer:= buffer + inttostr (U_key.Key_CONST[i]);

U_key.CRC642:= CRC64_sum (buffer);

// MessageDlg (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);

// 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);

// MessageDlg (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);

// MessageDlg (inttostr (U_key.CRC642), mtWarning, [mbOK], 0);

d:='';

buffer:='';

d:= inttostr (U_key.Key_counter) + '56437gc77dg73643276' + Form3. edit3.text + '44322salt_4327h4897d3946f' + Form3. edit4.text + 'Afrejoiewpsalt_04o2hudbuk_salt4222222' + inttostr (G_numdisk);

for i:=1 to 707 do.

buffer:= buffer + d;

ret := HashStr (HASH_SHA512, buffer, S_key); // S_key — ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅Ρ‚ΡΡ для ΡˆΠΈΡ„Ρ€ΠΎΠ²Π°Π½ΠΈΡ ΠΏΠ΅Ρ€Π²ΠΎΠ³ΠΎ Π±Π»ΠΎΠΊΠ° ΠΊΠ»ΡŽΡ‡Π° — ΠΊΠ»ΡŽΡ‡Π΅ΠΉ ΠΈ Π²Π΅ΠΊΡ‚ΠΎΡ€Π° ΠΈΠ½ΠΈΡ†.

buffer:=copy (S_key, 1,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_RC[1]: =U_key.Key_RC[1] xor pl;

buffer:=copy (S_key, 8,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_RC[2]: =U_key.Key_RC[2] xor pl;

buffer:=copy (S_key, 16,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_RC[3]: =U_key.Key_RC[3] xor pl;

buffer:=copy (S_key, 24,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_RC[4]: =U_key.Key_RC[4] xor pl;

buffer:=copy (S_key, 32,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_RC[5]: =U_key.Key_RC[5] xor pl;

buffer:=copy (S_key, 40,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_RC[6]: =U_key.Key_RC[6] xor pl;

buffer:=copy (S_key, 48,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_RC[7]: =U_key.Key_RC[7] xor pl;

buffer:=copy (S_key, 56,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_RC[8]: =U_key.Key_RC[8] xor pl;

//MessageDlg (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);

buffer:=copy (S_key, 64,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_IDEA[1]: =U_key.Key_IDEA[1] xor pl;

buffer:=copy (S_key, 72,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_IDEA[2]: =U_key.Key_IDEA[2] xor pl;

buffer:=copy (S_key, 80,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_IDEA[3]: =U_key.Key_IDEA[3] xor pl;

buffer:=copy (S_key, 88,8);

pl:= StrToInt ('$'+buffer);

U_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);

buffer:=copy (S_key, 96,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_CONST[1]: =U_key.Key_CONST[1] xor pl;

buffer:=copy (S_key, 104,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_CONST[2]: =U_key.Key_CONST[2] xor pl;

buffer:=copy (S_key, 112,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_CONST[3]: =U_key.Key_CONST[3] xor pl;

buffer:=copy (S_key, 120, 8);

pl:= StrToInt ('$'+buffer);

U_key.Key_CONST[4]: =U_key.Key_CONST[4] xor pl;

// ΠΏΠ΅Ρ€Π²Ρ‹ΠΉ Π±Π»ΠΎΠΊ ΠΊΠ»ΡŽΡ‡Π° ΡƒΡΠΏΠ΅ΡˆΠ½ΠΎ Π·Π°ΡˆΠΈΡ„Ρ€ΠΎΠ²Π°Π½! ΠœΡ‹ ΠΌΠΎΠ»ΠΎΠ΄Ρ†Ρ‹!

//ΠΏΠΎΠ»ΡƒΡ‡Π°Π΅ΠΌ Π΄Π°Ρ‚Ρƒ.

data_:=Date;

DecodeDate (data_, y, m, day);

if day<10 then str:= str + '0' + inttostr (day);

if m<10 then str:= str + '0' + inttostr (m);

str:= str + inttostr (y);

U_key.data_key:= strtoint (str);

// ΡˆΠΈΡ„Ρ€ΡƒΠ΅ΠΌ Π²Ρ‚ΠΎΡ€ΡƒΡŽ Ρ‡Π°ΡΡ‚ΡŒ ΠΊΠ»ΡŽΡ‡Π°.

// MessageDlg (inttostr (U_key.CRC642), mtWarning, [mbOK], 0);

buffer:=copy (lite_key, 1,8);

pl:= StrToInt ('$'+buffer);

U_key.CRC642:= U_key.CRC642 xor pl;

buffer:=copy (lite_key, 8,8);

pl:= StrToInt ('$'+buffer);

U_key.Key_counter:=U_key.Key_counter xor pl;

buffer:=copy (lite_key, 16,8);

pl:= StrToInt ('$'+buffer);

U_key.data_key :=U_key.data_key xor pl;

//считаСм CRC64 ΠΎΡ‚ 1 ΠΈ 2 части ΠΊΠ»ΡŽΡ‡Π° ΡƒΠΆΠ΅ Π·Π°ΡˆΠΈΡ„Ρ€ΠΎΠ²Π°Π½Π½Ρ‹Ρ…:

buffer:='';

for i:=1 to 8 do.

buffer:= buffer + inttostr (U_key.Key_RC[i]);

for i:=1 to 4 do.

buffer:= buffer + inttostr (U_key.Key_IDEA[i]);

for i:=1 to 4 do.

buffer:= buffer + inttostr (U_key.Key_CONST[i]);

buffer:= buffer + inttostr (U_key.CRC642);

buffer:= buffer + inttostr (U_key.Key_counter);

buffer:= buffer + inttostr (U_key.data_key);

U_key.CRC641:= CRC64_sum (buffer);

//создаСм USB-ΠΊΠ»ΡŽΡ‡.

U_key.Control_hash:= Control_hash;

U_key.Familiy:= Form3. Edit1.Text;

U_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);

MessageDlg ('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);

MessageDlg ('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);

MessageDlg ('CRC2 ' + inttostr (U_key.CRC642), mtWarning, [mbOK], 0);

MessageDlg ('Π‘Ρ‡Π΅Ρ‚Ρ‡ΠΈΠΊ ' + inttostr (U_key.Key_counter), mtInformation, [mbOK], 0);

MessageDlg ('Π”Π°Ρ‚Π° ' + inttostr (U_key.data_key), mtInformation, [mbOK], 0);

MessageDlg ('Control_hash ' + Control_hash, mtInformation, [mbOK], 0);

MessageDlg ('FAM ' + U_key.Familiy, mtInformation, [mbOK], 0);

MessageDlg ('Name ' + U_key.Name, mtInformation, [mbOK], 0);

MessageDlg ('CRC1 ' + inttostr (U_key.CRC641), mtInformation, [mbOK], 0);

}.

assign (fkey, Form3. drivecombobox1.Drive + ':qwallke.qwkey');

rewrite (fkey);

write (fkey, U_key);

closefile (fkey);

FileSetAttr (Form3.drivecombobox1.Drive + ':qwallke.qwkey', faHidden);

//Π΄Π΅Π»Π°Π΅ΠΌ Π΅Π³ΠΎ Π½Π΅Π²ΠΈΠ΄ΠΈΠΌΡ‹ΠΌ.

MessageDlg ('USB-ΠΊΠ»ΡŽΡ‡ ΡƒΡΠΏΠ΅ΡˆΠ½ΠΎ создан!', mtInformation, [mbOK], 0);

Form2.Timer1.Enabled:=true;

Form2.Show;

Form3.Hide;

end;

{===============}.

procedure TForm3. Button1Click (Sender: TObject);

var.

j: byte;

begin.

j:=0;

if (Length (Edit1.Text)<7) then MessageDlg ('ПолС Π²Π²ΠΎΠ΄Π° «Π€Π°ΠΌΠΈΠ»ΠΈΡ» Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ‚ Π±Ρ‹Ρ‚ΡŒ мСньшС 7 символов!', mtWarning, [mbOK], 0).

else if (Length (Edit2.Text)<2) then MessageDlg ('ПолС Π²Π²ΠΎΠ΄Π° «Π˜ΠΌΡ» Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ‚ Π±Ρ‹Ρ‚ΡŒ мСньшС 2 символов!', mtWarning, [mbOK], 0).

else if (Length (Edit5.Text)<8) then MessageDlg ('ПолС Π²Π²ΠΎΠ΄Π° «ΠŸΠ°Ρ€ΠΎΠ»ΡŒ доступа» Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ‚ Π±Ρ‹Ρ‚ΡŒ мСньшС 8 символов!', mtWarning, [mbOK], 0).

else if (Length (Edit4.Text)<8) then MessageDlg ('ПолС Π²Π²ΠΎΠ΄Π° «ΠŸΠΎΠ΄Ρ‚Π²Π΅Ρ€Π΄ΠΈΡ‚Π΅ ΠΏΠ°Ρ€ΠΎΠ»ΡŒ» Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ‚ Π±Ρ‹Ρ‚ΡŒ мСньшС 8 символов!', mtWarning, [mbOK], 0).

else if (Length (Edit3.Text)<5) then MessageDlg ('ПолС Π²Π²ΠΎΠ΄Π° «Π›ΠΎΠ³ΠΈΠ½» Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ‚ Π±Ρ‹Ρ‚ΡŒ мСньшС 5 символов!', mtWarning, [mbOK], 0).

else if (Edit5.Text Edit4. Text) then MessageDlg ('ΠŸΠΎΠ΄Ρ‚Π²Π΅Ρ€ΠΆΠ΄Π΅Π½ΠΈΠ΅ пароля Π½Π΅Π²Π΅Ρ€Π½ΠΎ! ΠŸΠΎΠ²Ρ‚ΠΎΡ€ΠΈΡ‚Π΅ ΠΏΠΎΠΏΡ‹Ρ‚ΠΊΡƒ', mtWarning, [mbOK], 0).

else new_yserkey;

end;

{==================================}.

//ΠΏΠ΅Ρ€Π΅Ρ…Π²Π°Ρ‚Ρ‹Π²Π°Π΅ΠΌ Π·Π°ΠΊΡ€Ρ‹Ρ‚ΠΈΠ΅ Ρ„ΠΎΡ€ΠΌΡ‹ ΠΈ Π·Π°ΠΊΡ€Ρ‹Π²Π°Π΅ΠΌ ΠΏΡ€ΠΎΠ³Ρƒ.

Procedure TForm3. WMGetSysCommand (var Message: TMessage) ;

var.

s: integer;

Begin.

if code=0 then begin.

IF (Message.wParam = SC_MINIMIZE).

Then Form1. Visible:=False;

IF (Message.wParam = SC_CLOSE).

Then begin.

Application.Terminate; end.

Else Inherited;

End;

if (Message.wParam = SC_CLOSE) and (code=1).

Then Form3. Hide;

end;

{======================================}.

procedure TForm3. Edit4Change (Sender: TObject);

var.

str, h: string;

i, k: integer;

begin.

str:=edit4.Text;

k:=0;

for i:=1 to length (str) do begin.

if (copy (str, i, 1)>'A') and (copy (str, i, 1)<'Z') then inc (k);

if (copy (str, i, 1)>'0') and (copy (str, i, 1)<'9') then inc (k);

end;

if length (str)>7 then begin.

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

//newuser:=true;

progressbar1.Position:=length (str) + k;

//GroupBox3.Enabled:=true;

end;

end;

procedure TForm3. DriveComboBox1Change (Sender: TObject);

var.

SerialNum: dword;

VolumeName, FSName: array [0.255] of char;

MaximumFNameLength,.

FileSystemFlags: dword;

FileEx: boolean;

begin.

GetVolumeInformation (PChar (drivecombobox1.Drive + ':),.

VolumeName, SizeOf (VolumeName),.

@SerialNum,.

MaximumFNameLength,.

FileSystemFlags,.

FSName, SizeOf (FSName));

label11.Caption:= 'Имя диска: ' + VolumeName;

G_numdisk:=SerialNum;//ΡƒΠ·Π½Π°Π΅ΠΌ id USB.

FileEx:=FileExists (PChar (drivecombobox1.Drive + ': + 'qwallke.qwkey'));

if FileEx=true then begin.

label11.Caption:='Π­Ρ‚ΠΎΡ‚ USB ΡƒΠΆΠ΅ являСтся ΠΊΠ»ΡŽΡ‡ΠΎΠΌ!';

if edit4. text'' then label11. Visible:=true;

label11.Font.Color:=clRed;

Button1.Enabled:=false end.

else begin.

label11.Font.Color:=clBlack;

Button1.Enabled:=true;

end;

end;

{=============================}.

procedure TForm3. FormCreate (Sender: TObject);

var.

i: integer;

DriveType: uInt;

begin.

//newuser:=false;

{оставляСм Ρ‚ΠΎΠ»ΡŒΠΊΠΎ смСнныС носитСли}.

i := 0;

while i <= Form3. DriveComboBox1.Items.Count — 1 do.

begin.

DriveType := GetDriveType (PChar (Form3.DriveComboBox1.Items[i][1] + ':));

if (DriveType Drive_Removable) then.

Form3.DriveComboBox1.Items.Delete (i).

else.

inc (i);

end;

Form3.button1.Enabled:=false;

end;

procedure TForm3. Image1Click (Sender: TObject);

begin.

MessageDlg ('Π’ этом ΠΎΠΊΠ½Π΅ Π²Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΡΠΎΠ·Π΄Π°Ρ‚ΡŒ USB-ΠΊΠ»ΡŽΡ‡. Он ΠΏΠΎΠ½Π°Π΄ΠΎΠ±ΠΈΡ‚ся Π’Π°ΠΌ для ΡˆΠΈΡ„Ρ€ΠΎΠ²Π°Π½ΠΈΡ ΠΈ Ρ€Π°ΡΡˆΠΈΡ„рования Ρ„Π°ΠΉΠ»ΠΎΠ² ΠΈ Ρ„Π°ΠΉΠ»ΠΎΠ²Ρ‹Ρ… ΠΊΠΎΠ½Ρ‚Π΅ΠΉΠ½Π΅Ρ€ΠΎΠ². Π—Π°ΠΏΠΎΠ»Π½ΠΈΡ‚Π΅ всС поля. Π’ΠΠ˜ΠœΠΠΠ˜Π•: Π·Π°ΠΏΠΎΠΌΠ½ΠΈΡ‚Π΅ Π²Π²Π΅Π΄Π΅Π½Π½Ρ‹Π΅ Π›ΠžΠ“Π˜Π ΠΈ ΠŸΠΠ ΠžΠ›Π¬ — ΠΎΠ½ΠΈ понадобятся для Π²Ρ…ΠΎΠ΄Π° Π² ΡΠΈΡΡ‚Π΅ΠΌΡƒ. ', mtInformation, [mbOK], 0);

end;

end.

ΠŸΠΎΠΊΠ°Π·Π°Ρ‚ΡŒ вСсь тСкст
Π—Π°ΠΏΠΎΠ»Π½ΠΈΡ‚ΡŒ Ρ„ΠΎΡ€ΠΌΡƒ Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΉ Ρ€Π°Π±ΠΎΡ‚ΠΎΠΉ