.

Защита информации в ПЭВМ. Шифр Плейфера

Язык: русский
Формат: реферат
Тип документа: Word Doc
0 1279
Скачать документ

Iineianeee ainoaea?noaaiiue Aaeaoeeiiiue einoeooo

(oaoie/aneee oieaa?neoao)

Eaoaae?a 403

“aeai?eoie/aneea ycuee e i?ia?aiie?iaaiea”

?an/aoii a?aoe/aneay ?aaioa

ia oaio

(
(

Caueoa eioi?iaoeee a IYAI (

Oeo? Ieyeoa?a
(

nooaeaio a?. 04-109

AUTHOR \* MERGEFORMAT Aeieo?ee Ao?aieia

Iao/iue ?oeiaiaeeoaeue

Eioaeueeiaa E.A.

Iineaa DATE \@ “aaaa” \* MERGEFORMAT 2000 aiae

Iaeaaeaiea

TOC \o “1-3” Caueoa eioi?iaoeee a IYAI GOTOBUTTON _Toc487821074
PAGEREF _Toc487821074 3

E?eioia?aoe/aneea iaoiaeu caueou eioi?iaoeee GOTOBUTTON _Toc487821075
PAGEREF _Toc487821075 4

Iiaeaeue iaeiieeth/aaie e?eioinenoaiu aeey ia?aaea/e niiauaiee
GOTOBUTTON _Toc487821076 PAGEREF _Toc487821076 5

Oeo? i?inoie iiaenoaiiaee. GOTOBUTTON _Toc487821077 PAGEREF
_Toc487821077 6

Oeo? ia?anoaiiaee (o?ainiiceoeee) n oeene?iaaiiui d (aeie d -a?oiia
neiaieia). GOTOBUTTON _Toc487821078 PAGEREF _Toc487821078 6

Oeo? Aeaeeia?a GOTOBUTTON _Toc487821079 PAGEREF _Toc487821079 6

Oeo?iaaiea n iiiiuueth aeao/eea neo/aeiuo /enae (IN*) GOTOBUTTON
_Toc487821080 PAGEREF _Toc487821080 7

OEO? IEYEOA?A GOTOBUTTON _Toc487821081 PAGEREF _Toc487821081 8

Aeie noaiu GOTOBUTTON _Toc487821082 PAGEREF _Toc487821082 8

II SHIFR_PLEYFER GOTOBUTTON _Toc487821083 PAGEREF _Toc487821083 8

IO SHIFR_TXT GOTOBUTTON _Toc487821084 PAGEREF _Toc487821084 9

IO DESHIFR_TXT GOTOBUTTON _Toc487821085 PAGEREF _Toc487821085 11

INIIAIAss I?IA?AIIA GOTOBUTTON _Toc487821086 PAGEREF _Toc487821086
13

I?ia?aiia GOTOBUTTON _Toc487821087 PAGEREF _Toc487821087 14

?acoeueoaou GOTOBUTTON _Toc487821088 PAGEREF _Toc487821088 18

NIENIE EEOA?AOO?U GOTOBUTTON _Toc487821089 PAGEREF _Toc487821089
19

Caueoa eioi?iaoeee a IYAI

Oneiaeiaiea iaoiaeia e n?aaenoa i?aaiecaoeee iaoeiiie ia?aaioee
eioi?iaoeee, a oaeaea oe?ieia eniieueciaaiea au/eneeoaeueiuo naoae
i?eaiaeeo e oiio, /oi eioi?iaoeey noaiiaeony ana aieaa oycaeiie.

A nayce n yoei caueoa eioi?iaoeee a i?ioeanna aa nai?a, o?aiaiey e
ia?aaioee i?eia?aoaao eneeth/eoaeueii aaaeiia cia/aiea (iniaaiii a
eiiia?/aneeo e aiaiiuo iaeanoyo).

Iiae caueoie eioi?iaoeee iiieiaaony niaieoiiinoue ia?ii?eyoee, iaoiaeia
e n?aaenoa, iaania/eaathueo ?aoaiea neaaeothueo iniiaiuo caaea/:

– i?iaa?ea oeaeinoiinoe eioi?iaoeee;

-eneeth/aiea ianaieoeeiie?iaaiiiai aeinooia e ?ano?nai IYAI e o?aiyueiny
a iae i?ia?aiiai e aeaiiui (n oeaeueth nio?aiaiey o?ao iniiaiuo naienoa
caueuaaiie eioi?iaoeee: oeaeinoiinoe, eiioeaeaioeeaeueiinoe,
aioiaiinoe);

– eneeth/aiea ianaieoeeiie?iaaiiiai eniieueciaaiey o?aiyueony a IYAI
i?ia?aii (o.a. caueoa i?ia?aii io eiie?iaaiey).

Aiciiaeiua eaiaeu ooa/ee eioi?iaoeee, iicaieythuea ia?ooeoaeth iieo/eoue
aeinooi e ia?aaaouaaaiie eee o?aiyuaeny a IYAI eioi?iaoeee, i?eiyoi
eeanneoeoee?iaaoue ia o?e a?oiiu, a caaeneiinoe io oeia n?aaenoaa,
yaeythuaainy iniiaiui i?e iieo/aiee eioi?iaoeee. ?acee/atho 3 oeia
n?aaenoa: /aeiaae, aiia?aoo?a, i?ia?aiia.

N ia?aie a?oiiie, a eioi?ie iniiaiui n?aaenoaii yaeyaony /aeiaae,
naycaiu neaaeothuea iniiaiua aiciiaeiua ooa/ee:

– /oaiea eioi?iaoeee n ye?aia iinoi?iiiei eeoeii;

– ?anoeo?iaea i?ia?aiiie caoeo?iaaiiie eioi?iaoeee;

– oeuaiea iineoaeae eioi?iaoeee (iaaieoiuo aeeneia, aeeneao, eaio e o.
ae.).

Ei aoi?ie a?oiia eaiaeia, a eioi?uo iniiaiui n?aaenoaii yaeyaony
aiia?aoo?a, ioiinyony neaaeothuea aiciiaeiua eaiaeu ooa/ee:

– iiaeeeth/aiea e IYAI niaoeeaeueii ?ac?aaioaiiuo aiia?aoiuo n?aaenoa,
iaania/eaathueo aeinooi e eioi?iaoeee;

– eniieueciaaiea niaoeeaeueiuo oaoie/aneeo n?aaenoa aeey ia?aoaaoa

yeaeo?iiaaieoiuo eceo/aiee oaoie/aneeo n?aaenoa IYAI. A a?oiia eaiaeia,
a eioi?uo iniiaiui n?aaenoaii yaeyaony i?ia?aiia, iiaeii auaeaeeoue
neaaeothuea aiciiaeiua eaiaeu ooa/ee:

– ianaieoeeiie?iaaiiue aeinooi i?ia?aiiu e eioi?iaoeee;

– ?anoeo?iaea i?ia?aiiie caoeo?iaaiiie eioi?iaoeee;

– eiie?iaaiea i?ia?aiiie eioi?iaoeee n iineoaeae.

Aoaeai ?anniao?eaaoue n?aaenoaa caueou, iaania/eaathuea cae?uoea
aiciiaeiuo eaiaeia ooa/ee, a eioi?uo iniiaiui n?aaenoaii yaeyaony
i?ia?aiia. Caiaoei, /oi oaeea n?aaenoaa a ?yaea neo/aaa iicaieytho
aeinoaoi/ii iaaeaaeii cae?uoue iaeioi?ua aiciiaeiua eaiaeu ooa/ee ec
ae?oaeo a?oii. Oae, e?eioia?aoe/aneea n?aaenoaa iicaieytho iaaeaaeii
cae?uoue eaiae, naycaiiue n oeuaieai iineoaeae eioi?iaoeee.

Iaci? iaoiaeia caueou eioi?iaoeee

I?iaeaiu caueou eioi?iaoeee i?ia?aiiiiai iaania/aiey eiatho oe?ieee
aeeaiacii: io caeiiiaeaoaeueiuo aniaeoia caueou eioaeeaeooaeueiie
nianoaaiiinoe (i?aa aaoi?a) aei eiie?aoiuo oaoie/aneeo ono?ienoa.

N?aaenoaa caueou iiaeii iiae?acaeaeeoue ia neaaeothuea eaoaai?ee:

– n?aaenoaa nianoaaiiie caueou;

– n?aaenoaa caueou a ninoaaa au/eneeoaeueiie nenoaiu;

– n?aaenoaa caueou n cai?inii eioi?iaoeee;

– n?aaenoaa aeoeaiie caueou;

– n?aaenoaa ianneaiie caueou.

Eeanneoeeaoeey n?aaenoa caueou eioi?iaoeee

Nianoaaiiie caueou A ninoaaa AN N cai?inii eioi?iaoeee Aeoea iua
Ianneaiua

– aeieoiaioaoeey

– iaoeiiue eiae

– nii?iaiaeaeaiea

– aaoi?neia i?aai

– caeaciia i?iaeoe?iaaiea – caueoa iaaieoiuo aeeneia

– niaoeeaeueiay aiia?aoo?a

– caiee caueou

– eciaiaiey ooieoeee – ia?iee

– oeo?u

– neaiaoo?a

– aiia?aoo?a caueou (ICO, i?aia?aciaaoaee) aaia?aoi? neo/aeiuo /enae –
caiee caueou

(a?aiy, aeaiiua)

– eneaaeaiiua i?ia?aiiu

(i?ia?aiiu

ae?onu, eneaaeaiea ooieoeee) – neaiae o?aaiae

– caione ii eeth/ai

– aaoi?neay ynoaoeea – eaeaioeoeeaoeey i?ia?aii

– /anoioiue aiaeec

– ei??aeyoeeiiiue aiaeec

– «?iaeeiua iyoia»

– ono?ienoai eiio?iey

Iaeaieaa iaaeaaeiuie yaeythony e?eioia?aoe/aneea iaoiaeu caueou
eioi?iaoeee, ioiinyueany e eeanno n?aaenoa caueou n cai?inii
eioi?iaoeee.

E?eioia?aoe/aneea iaoiaeu caueou eioi?iaoeee

1. Iniiaiua ii?aaeaeaiey

E?eioieiaey (io a?a/aneeo ei?iae: cryptos-oaeiue e logos-neiai) eae
iao/iay aeenoeeieeia ioi?ieeanue a 1949 a. n iiyaeaieai ?aaiou Oaiiiia,
a eioi?ie onoaiaaeeaaeanue naycue e?eioieiaee n oai?eae eioi?iaoeee.
E?eioieiaey aeeth/aao aeaa iai?aaeaiey: e?eioia?aoeth e e?eioiaiaeec.
Caaea/a e?eioia?aoa – iaania/eoue eae iiaeii aieueoea nae?aoiinoue e
aooaioe/iinoue (iiaeeeiiinoue) ia?aaeaaaaiie eioi?iaoeee.
E?eioiaiaeeoee, iai?ioea, “aceaiuaaao ” nenoaio caueou, iuoaynue
?ane?uoue caoeo?iaaiiue oaeno eee auaeaoue iiaeaeaeueiia niiauaiea ca
ianoiyuaa.

E?eioia?aoe/aneay caueoa – yoi caueoa aeaiiuo n iiiiuueth
e?eioia?aoe/aneiai i?aia?aciaaiey, iiae eioi?ui iiieiaaony
i?aia?aciaaiea aeaiiuo oeo?iaaieai e (eee) au?aaioeie eieoianoaaee.

*oiau ne?uoue niune ia?aaeaaaaiuo niiauaiee i?eiaiythony aeaa oeia
i?aia?aciaaiee: eiaee?iaaiea e oeo?iaaiea. Aeey eiaee?iaaiey
eniieuecoaony eiaee?iai/iua eieae e oaaeeoeu, niaea?aeauea iaai?u /anoi
eniieuecoaiuo o?ac, eaaeaeie ec eioi?uo niioaaonoaoao eiaeiaia neiai.
Aeey aeaeiaee?iaaiey eniieuecoaony oaeay aea eieaa.

Aoi?ie oei e?eioia?aoe/aneiai i?aia?aciaaiey – oeo?iaaiea -i?aaenoaaeyao
niaie i?ioeaaeo?o (aeai?eoi) i?aia?aciaaiey neiaieia enoiaeiiai oaenoa a
oi?io, iaaeinooiioth aeey ?aniiciaiiay (caoeo?iaaiiue oaeno).

Iiae oeo?ii iiieiaaony niaieoiiinoue ia?aoeiuo i?aia?aciaaiee iiiaeanoaa
ioe?uouo aeaiiuo ia iiiaeanoai caoeo?iaaiiuo aeaiiuo, caaeaiiuo
aeai?eoiii e?eioia?aoe/aneiai i?aia?aciaaiey. A oeo?a anaaaea ?acee/atho
aeaa yeaiaioa: aeai?eoi e eeth/.

I?ioeann ia?aaea/e niiauaiee eniieuecoao 2 aeai?eoia: oeo?iaaiey
E-Encipherment e aeaoeo?iaaiey D-Decipherment, a eioi?uo aeey
i?aia?aciaaiey eniieuecoaony eeth/ E.

Eeth/ – eiie?aoiia nae?aoiia ninoiyiea iaeioi?uo ia?aiao?ia aeai?eoia
e?eioia?aoe/aneiai i?aia?aciaaiey aeaiiuo, iaania/eaathuaa auai? iaeiiai
aa?eaioa ec niaieoiiinoe anaaiciiaeiuo aeey aeaiiiai aeai?eoia.

Eieoianoaaea – yoi iineaaeiaaoaeueiinoue aeaiiuo oeene?iaaiiie aeeeiu,
iieo/aiiay ii ii?aaeaeaiiiio i?aaeeo ec ioe?uouo aeaiiuo e eeth/a,
eioi?ay eniieuecoaony aeey caueou io iaaycuaaiey eiaeiuo aeaiiuo.

E?eioinoieeinoueth iacuaaaony oa?aeoa?enoeea oeo?a, ii?aaeaeythuay aai
noieeinoue e aeaoeo?iaaieth, eioi?ay iau/ii ii?aaeaeyaony iaiaoiaeeiui
aeey yoiai ia?eiaeii a?aiaie.

E?eioinenoaiu n cae?uoui eeth/ii (iaeiieeth/aaua)

Iiaeaeue iaeiieeth/aaie e?eioinenoaiu aeey ia?aaea/e niiauaiee

naieoeeiie?iaaiiue iieo/aoaeue

O O = Ae(O) O= De(O)

enoiaeiue

oaeno R E E

caueuaiiue

eaiae nayce aeey ia?aaea/e eeth/a.

Enoi/iee niiauaiey ia?aaeaao “ioe?uoue oaeno” X, a ?aiaeiiecaoi?
oi?ie?oao ?aiaeiiece?othooth iineaaeiaaoaeueiinoue R. Caaea/a
?aiaeiiecaoi?a ninoieo a oii, /oiau au?iaiyoue /anoiou iiyaeaiey
neiaieia enoi/ieea niiauaiey iooai ia?aoiaea e aeoaaeoo aieueoaai
iauaia. Enoi/iee eeth/a aaia?e?oao iaeioi?ue eeth/ E, a oeo?aoi?
i?aia?acoao ioe?uoue oaeno O a oeo?ioaeno (e?eioia?aiio), eioi?ue
yaeyaony iaeioi?ie ooieoeeae X, a eiie?aoiue aeae e?eioia?aiiu
ii?aaeaeyaony nae?aoiui eeth/ii e ?aiaeiiece?othuae
iineaaeiaaoaeueiinoueth.

Oeo?ioaeno ia?aaeaaony ii iacaueuaiiiio eaiaeo nayce, e
ianaieoeeiie?iaaiiue iieo/aoaeue eiaao ana oaoie/aneea aiciiaeiinoe aeey
aa ia?aoaaoa. A niioaaonoaee n ecaanoiui a e?eioieiaee “i?aaeeii
Ea?oeiooa” i?aaeiieaaaaony, /oi aeai?eoi i?aia?aciaaiey ecaanoai
i?ioeaieeo, e iaaeaaeiinoue oeo?a ii?aaeaeyaony oieueei eeth/ii.

Aeaoeo?aoi? naieoeeiie?iaaiiiai iieo/aoaey, ciay nae?aoiue eeth/,
ainnoaiaaeeaaao ioe?uoue oaeno.

I?e ?ac?aaioea i?aeoe/aneeo oeo?ia eniieuecothony aeaa i?eioeeia,
eioi?ua auaeaeee Oaiiii: ?annaeaaiea e ia?aiaoeaaiea. ?annaeaaieai ii
iacaae ?ani?ino?aiaiea aeeyiey iaeiiai ciaea ioe?uoiai oaenoa ia
iiiaeanoai ciaeia oeo?ioaenoa, /oi iicaieyao ne?uoue noaoenoe/aneea
naienoaa ioe?uoiai oaenoa. Iiae ia?aiaoeaaieai Oaiiii iiieiae
eniieueciaaiea oaeeo oeo?othueo i?aia?aciaaiee, eioi?ua oneiaeiytho
ainnoaiiaeaiea acaeiinayce noaoenoe/aneeo naienoa ioe?uoiai e
oeo?iaaiiiai oaenoa. Iaeiaei oeo? aeieaeai ia oieueei cao?oaeiyoue
?ane?uoea, ii e iaania/eaaoue eaaeinoue oeo?iaaiey e aeaoeo?iaaiey i?e
ecaanoiii nae?aoiii eeth/a. Iiyoiio auea i?eiyoa eaeay eniieueciaaoue
i?iecaaaeaiea i?inouo oeo?ia, eaaeaeue ec eioi?uo aiineo iaaieueoie
aeeaae a cia/eoaeueiia noiia?iia ?annaeaaiea e ia?aiaoeaaiea. ?anniio?ei
i?eia?u oeo?iaaiey.

Oeo? i?inoie iiaenoaiiaee.

Yoi i?inoaeoee iaoiae oeo?iaaiey, aai iacuaatho oaeaea iiiiaeoaaeoiie
iiaenoaiiaeie. Eeth/ii yaeyaony ia?anoaaeaiiue aeoaaeo, aoeaaie eioi?iai
caiaiytho aoeau ii?iaeueiiai aeoaaeoa. Iai?eia?, eaaeaeay aoeaa
caiaiyaony ia aoeao, noiyuoth ia 3 iiceoeee aia?aaee: A(D, B(E e o.ae.
Oiaaea oaeno AAN caiaiyaony ia DEF. Ana iiiiaeoaaeoiua iiaenoaiiaee
iiaeii i?aaenoaaeoue a aeaea:

Y, = a oi + b( mod g),

a – iaeioi?ue iinoiyiiue aeanyoe/iue eiyooeoeeaio;

b – eiyooeoeeaio naeaeaa;

g – aeeeia eniieuecoaiiai aeoaaeoa;

oi -i-e neiaie ioe?uoiai oaenoa (iiia? aoeau a aeoaaeoa). Iniiaiui
iaaeinoaoeii ?anniio?aiiiai iaoiaea yaeyaony oi, /oi noaoenoe/aneea
naienoaa ioe?uoiai oaenoa (/anoiou iiaoi?aiey aoea) nio?aiythony e a
oeo?ioaenoa.

Oeo? ia?anoaiiaee (o?ainiiceoeee) n oeene?iaaiiui d (aeie d -a?oiia
neiaieia).

Yoi aei/iue iaoiae. Oaeno aeaeyo ia aeiee e a eaaeaeii i?iecaiaeeony
ia?anoaiiaea neiaieia ioe?uoiai oaenoa. I?aaeei ia?anoaiiaee caaeaaony
nae?aoiui eeth/ii. Ionoue ia?anoaiiaea caaeaaony oaaeeoeae:

123456

316524

Oiaaea ioe?uoue oaeno i?aia?acoaony a caeiaee?iaaiiue oae: ia?aue neiaie
noaiiaeony aoi?ui, aoi?ie – iyoui e oae aeaeaa

MICROC OMPUTE R – ioe?uoue oaeno

CMCOIR POETMU R – caeiaee?iaaiiue oaeno

A neo/aa ia?anoaiiaee ia?anoaaeythony ia aoeau aeoaaeoa, a aoeau a
niiauaiee ioe?uoiai oaenoa. ?ani?aaeaeaiea /anoio ioaeaeueiuo neiaieia
ieacuaaaony a oeo?iaaiiii oaenoa oaeei aea, /oi e a ioe?uoii oaenoa,
iaeiaei ?ani?aaeaeaiey aieaa aunieeo ii?yaeeia ieacuaathony
ia?aiaoaiiuie, /oi oeo/oaao e?eioinoieeinoue aeaiiiai oeo?a ii
n?aaiaieth n i?inoie iiaenoaiiaeie.

Oeo? Aeaeeia?a

Oeo?, caaeaaaaiue oi?ioeie

oi = oi + ki(mod g),

aaea ki – i-y aoeaa eeth/a, a ea/anoaa eioi?iai eniieuecoaony neiai eee
o?aca, iacuaaaony oeo?ii Aeaeeia?a. Ainiieuecoainy oaaeeoeae
eiaee?iaaiey aoea ?onneiai aeoaaeoa:

Aoeaa A A A A Ae A AE 3 E E E E

Eiae 01 02 03 04 05 06 07 08 09 10 11 12

Aoeaa I I I I ? N O O O X Oe *

Eiae 13 14 15 16 17 18 19 20 21 22 23 24

Aoeaa O U U U Ue Y TH ss (i?iaae)

Eiae 25 26 27 28 29 30 31 32 33

Ionoue eiaaony ioe?uoue oaeno “CAIAIA” e iiaenoaiiaea oeo?a Aeaeeia?a
caaeaia oaaeeoeae:

3 A I A I A

E E TH * E E

Ii oi?ioea oeo?a Aeaeeia?a iaoiaeei:

Y1= 8 + ll (mod33) = 19 ( T;

Y2= l + 12 (mod33) = 13 ( M;

Y3= 13 + 31 (mod 33) = 11 ( E;

Y4= 6 + 24 (mod 33) = 30 ( TH;

Y5= 14 + 11 (mod 33) = 25 ( O;

Y6 = 1 + 12 (mod 33) = 13 ( I.

Oeo?ioaeno: “OIEYOI”.

Oeo?u Aioi?a eniieuecotho oi?ioeu:

yi = ki – xi(mod g) e

yi = Xi – ki(mod g).

Aiiioiie/aneay caiaia iaeiiio neiaieo ioe?uoiai oaenoa noaaeo a
niioaaonoaea ianeieueei neiaieia oeo?ioaenoa. Yoio iaoiae i?eiaiyaony
aeey eneaaeaiey noaoenoe/aneeo naienoa oaenoa.

Oeo?iaaiea n iiiiuueth aeao/eea neo/aeiuo /enae (IN*)

Yoi aeiaieueii ?ani?ino?aiaiiue e?eioia?aoe/aneee iaoiae, i?eioeei
eioi?iai caeeth/aaony a aaia?aoeee aaiiu oeo?a n iiiiuueth aeao/eea IN*
e iaeiaeaiee iieo/aiiie aaiiu ia ioe?uoua aeaiiua ia?aoeiui ia?acii
(iai?eia?, i?e eniieueciaaiee eiae/aneie iia?aoeee “eneeth/athuaa IEE”).

I?ioeann ?anoeo?iaaiey aeaiiuo naiaeeony e iiaoi?iie aaia?aoeee aaiiu
oeo?a i?e ecaanoiii eeth/a e iaeiaeaieth oaeie aaiiu ia caoeo?iaaiiua
aeaiiua. Iieo/aiiue caoeo?iaaiiue oaeno aeinoaoi/ii o?oaeai aeey
?ane?uoey a oii neo/aa, eiaaea aaiia oeo?a ia niaea?aeeo iiaoi?ythueony
aeoiauo iineaaeiaaoaeueiinoae. Oaeoe/anee anee ia?eiae aaiiu i?aauoaao
aeeeio anaai caoeo?iaaiiiai oaenoa e iaecaanoia ieeaeay /anoue
enoiaeiiai oaenoa, oi oeo? iiaeii ?ane?uoue oieueei i?yiui ia?aai?ii
(iiaeai?ii eeth/a).

Ia iniiaa oai?ee a?oii ?ac?aaioaii ianeieueei oeiia aeao/eeia IN*.
Iaeaieaa aeinooiiu e yooaeoeaiu eiia?oyioiua aaia?aoi?u IN*. Iai?eia?,
eeiaeiue eiia?oyioiue aeao/ee IN* au?aaaouaaao iineaaeiaaoaeueiinoe
inaaaeineo/aeiuo /enae T(i), iienuaaaiua niioiioaieai

T(i+l) = [AT(i) + C]mod M,

Aaea A e N – eiinoaiou; O(0) – enoiaeiay aaee/eia, aua?aiiay a ea/anoaa
ii?iaeaeathuaai /enea.

Oaeie aeao/ee IN* aaia?e?oao inaaaeineo/aeiua /enea n ii?aaeaeaiiui
ia?eiaeii iiaoi?aiey, caaenyuei io aua?aiiuo cia/aiee A e N. Cia/aiea I
iau/ii onoaiaaeeaaaony ?aaiui 25, aaea b – aeeeiia neiaa YAI a aeoao.

Iaeiieeth/aaay iiaeaeue eniieuecoao aeey oeo?iaaiey e aeaoeo?iaaiey
iaeei e oio aea nae?aoiue eeth/, eioi?ue aeieaeai auoue iaecaanoai
e?eioiaiaeeoeeo i?ioeaieea. Iiyoiio oaeay nenoaia iacuaaaony
iaeiieeth/aaie e?eioinenoaiie n nae?aoiuie eeth/aie. I?iaeaia
?ani?ino?aiaiey yoeo nae?aoiuo eeth/ae yaeyaony iaeiie ec aeaaiuo
o?oaeiinoae i?e i?aeoe/aneii eniieueciaaiee oaeie e?eioinenoaiu. Aeey
?ani?ino?aiaiey nae?aoiuo eeth/ae o?aaothony caueoiua eaiaeu nayce.
Noieiinoue e neiaeiinoue ?ani?ino?aiaiey yoeo eeth/ae ieacuaathony
i/aiue aieueoeie.

OEO? IEYEOA?A

Aeie noaiu

II SHIFR_PLEYFER

II SHIFR_PLEYFER aeey ii?aaeaeaiey eii?aeeiao neiaieia iao?eoeu
Ieyeoa?a.

SHIFR_PLEYFER(Alfavit, INDEX)

Nienie oi?iaeueiuo ia?aiao?ia:

Alfavit, INDEX

Aoiaeiua ia?aiao?u:

INDEX – iao?eoea neiaieia Ieyeoa?a, aaee/eia neiaieueiay.

Auoiaeiua ia?aiao?u:

Alfavit – o?aieo eii?aeeiaou neiaieia iao?eoeu Ieyeoa?a, aaee/eiu
oeaeiai oeia.

Aeai?eoi

Ia/aei II SHIFR_PLEYFER (Alfavit, INDEX)

Iienaiea ianneaia: Alfavit[255], INDEX[6, 6]

I = 1

iao

I IO SHIFR_TXT IO SHIFR_TXT i?iecaiaeeo oeo?iaaiea no?iee ioe?uoiai oaenoa.

SHIFR_TXT(Str, Alfavit, INDEX)

Nienie oi?iaeueiuo ia?aiao?ia:

Str, Alfavit, INDEX

Aoiaeiua ia?aiao?u:

Str – no?iea ioe?uoiai oaenoa, aaee/eia no?iea.

Alfavit – o?aieo eii?aeeiaou neiaieia iao?eoeu Ieyeoa?a, aaee/eiu
oeaeiai oeia.

INDEX – iao?eoea neiaieia Ieyeoa?a, aaee/eia neiaieueiay.

Auoiaeiua ia?aiao?u:

SHIFR_TXT – i?eieiaao cia/aiea caoeo?iaaiiie no?iee, aaee/eiu no?iea.

Iaicia/aiey

1. Iienaiea ianneaia Alfavit, INDEX.

2 .. 7 A ioe?uoii oaenoa anoaaeyaony “-”iaaeaeo iaeeiaeiauie neiaieaie.

8 .. 9 Aeiaaaeaiea “-” a eiiaoe ioe?uoiai oaenoa, a neo/aa ia/ao. eie-aa
neiaieia a no?iea .

10 .. 13 I?aaiecaoeey ii ia?iiai ia?aai?a neiaieia no?iee ioe?uoiai
oaenoa.

14 .. 15 Ia?a neiaieia iaoiaeeony a iaeiie no?iea iao?eoeu aeoaaeoa
Ieyeoe?a.

16 .. 17 Ia?a neiaieia iaoiaeeony a iaeiii noieaoea iao?eoeu aeoaaeoa
Ieyeoa?a.

18. Ia?a neiaieia iaoiaeeony a ?aciuo no?ieao e noieaoeao iao?eoeu
aeoaaeoa Ieyeoa?a.

19. I?enaaeaaiea IO SHIFR_TXT cia/aiey iiaie no?iee

I?iaeieaeaiea neaaeoao(

Aeai?eoi

Ia/aei IO SHIFR_TXT (Str, Alfavit, INDEX)

Iienaiea ianneaia: Alfavit[255], INDEX[6, 6]

New = “, Dlina_str = Length(Str), I = 1

iao

I IO DESHIFR_TXT IO DESHIFR_TXT i?iecaiaeeo ?anoeo?aoeeth no?iee ioe?uoiai oaenoa.

DESHIFR_TXT(Str, Alfavit, INDEX)

Nienie oi?iaeueiuo ia?aiao?ia:

Str, Alfavit, INDEX

Aoiaeiua ia?aiao?u:

Str – no?iea ioe?uoiai oaenoa, aaee/eia no?iea.

Alfavit – o?aieo eii?aeeiaou neiaieia iao?eoeu Ieyeoa?a, aaee/eiu
oeaeiai oeia.

INDEX – iao?eoea neiaieia Ieyeoa?a, aaee/eia neiaieueiay.

Auoiaeiua ia?aiao?u:

DESHIFR_TXT- i?eieiaao cia/aiea ?anoeo?iaaiiie no?iee, aaee/eiu no?iea.

Iaicia/aiey

1. Iienaiea ianneaia Alfavit, INDEX.

2 .. 5 I?aaiecaoeey ii ia?iiai ia?aai?a neiaieia no?iee ioe?uoiai
oaenoa.

6 .. 7 Ia?a neiaieia iaoiaeeony a iaeiie no?iea iao?eoeu aeoaaeoa
Ieyeoe?a.

8 .. 9 Ia?a neiaieia iaoiaeeony a iaeiii noieaoea iao?eoeu aeoaaeoa
Ieyeoa?a.

10. Ia?a neiaieia iaoiaeeony a ?aciuo no?ieao e noieaoeao iao?eoeu
aeoaaeoa Ieyeoa?a.

11 .. 15 Ec ?anoeo?iaaiiie no?iee nicaeaaony iiaay no?iea
aac niaoe. ciae “-”.

16. I?enaaeaaiea IO DESHIFR_TXT cia/aiey iiaie no?iee

I?iaeieaeaiea neaaeoao(

Aeai?eoi

Ia/aei IO DESHIFR_TXT (Str, Alfavit, INDEX)

Iienaiea ianneaia: Alfavit[255], INDEX[6, 6]

New = “, Dlina_str = Length(Str)div 2, I = 1

iao

I INIIAIAss I?IA?AIIA Aeai?eoi Ia/aei iniiaiiai aeiea i?ia?aiiu Iienaiea ianneaia: Alfavit[255], INDEX[6, 6] Auaiae: “Auaa?eoa (S)OEO?IAAOUe eee (D)AeAOEO?IAAOUe” iao Aaiae: K iao UpCase(K) = ‘S’ UpCase(K) = ‘D’ Auaiae: “Iooue e oaeeo: ” Aaiae: Name1 Assign (Var_file1, Name1) Reset (Var_file1) iao IOResult = 0 Auaiae: “Nio?aieoue eae: ” Aaiae: Name2 iao Length(Name2) ( 0 Assign (Var_file2, Name2) ReWrite (Var_file2) SHIFR_PLEYFER(ALFAVIT, INDEX) iao NOT EOF(Var_file1) Aaiae ec oaeea Var_file1: Str iao aea UpCase(K) = ‘S’ Str = DESHIFR_TXT(Str, ALFAVIT, INDEX) Str = SHIFR_TXT(Str, ALFAVIT, INDEX) Auaiae a oaee Var_file2: Str Close (Var_file1) Close (Var_file2) Eiiaoe iniiaiiai aeiea i?ia?aiiu Iaicia/aiey 1. Iienaiea ianneaia Alfavit, INDEX. 2 .. 5 Auai? oeo?iaaiea eee ?anoeo?aoeey oaeea. 6 .. 9 Ii?aaeaeaiea oaeea aaiaea aeaiiuo. 10 .. 13 Ii?aaeaeaiea oaeea auaiaea iieo/aiiuo ?acoeueoaoia. 14. Ia?auaiea e II SHIFR_PLEYFER(ALFAVIT, INDEX). 15 .. 16 Ia?aai? no?ie ec oaeea Var_file1. 17. Auai? aeaenoaee oeo?iaaiea eeai ?anoeo?aoeey no?iee .

18. Ia?auaiea e IO DESHIFR_TXT(Str, ALFAVIT, INDEX).

19. Ia?auaiea e IO SHIFR_TXT(Str, ALFAVIT, INDEX).

20. Auaiae ?acoeueoaoa a oaee Var_file2.

21. Cae?uoea oaeeia aaiaea e auaiaea.

I?ia?aiia

PROGRAM SHIFR_PLEYFERA;

USES Crt;

TYPE

path = STRING[14];

Stroca = STRING[255];

Simvol = array [1..6, 1..6] of CHAR;

MATR = array [1..255] of RECORD

STROK, STOLB: Byte;

END;

CONST INDEX: Simvol = ((‘A’, ‘AE’, ‘A’, ‘I’, ‘Oe’, ‘A’),
{oeiece?iaaiiua eiinoaiou aeey iao?eoeu Ieyeoa?a}

(‘*’, ‘A’, ‘I’, ‘O’, ‘Ae’, ‘I’),

(‘A’, ‘U’, ‘ , ‘, ‘O’, ‘O’, ‘I’),

(‘ . ‘, ‘C’, ‘U’, ‘?’, ‘E’, ‘E’),

(‘N’, ‘Ue’, ‘E’, ‘Y’, ‘O’, ‘E’),

(‘TH’, ‘ss’, ‘ ‘, ‘U’, ‘O’, ‘-‘));

VAR

Var_file1 ,Var_file2: Text;

Name1, Name2: path;

ALFAVIT: MATR;

Str: Stroca;

K: Char;

{Ii?aaeaeaiea eii?aeeiao neiaieia iao?eoeu Ieyeoa?a}

PROCEDURE SHIFR_PLEYFER(Var ALFAVIT: MATR; INDEX: Simvol);

VAR I, J: Byte; {I, J – n/ao/eee oeeeeia}

BEGIN {Ia/aei iniiaiiai aeiea II SHIFR_PLEYFER}

FOR I:= 1 TO 6 DO for J:= 1 to 6 do

WITH ALFAVIT[Ord(INDEX[I, J])] DO

begin

STROK:= I; {no?iea neiaiea}

STOLB:= J; {noieaaoe neiaiea}

end;

END; {Eiiaoe iniiaiiai aeiea II SHIFR_PLEYFER}

{I?iecaiaeeony oeo?iaaiea no?iee ioe?uoiai oaenoa}

FUNCTION SHIFR_TXT(Str: Stroca; Alfavit: MATR; INDEX: Simvol): Stroca;

VAR {Iauyaeaiea ia?aiaiiuo}

SIM1, SIM2: Char;

New: STRING;

I, Dlina_str, Dlina_new: Byte; {I – n/ao/ee oeeeea}

BEGIN {Ia/aei iniiaiiai aeiea IO SHIFR_TXT}

{A ioe?uoii oaenoa anoaaeyaony niaoe. ciae “-” iaaeaeo iaeeiaeiauie
neiaieaie}

New:= ”;

Dlina_str:= Length(Str);

FOR I:= 1 TO Dlina_str DO IF (Str[I] = Str[I+1]) THEN New:= (New +
Str[I] + ‘-‘) ELSE New:= (New + Str[I]);

{Aeiaaaeaiea niaoe. ciaea “-” a eiiaoe ioe?uoiai oaenoa a neo/aa
ia/aoiiai eiee/anoaa neiaieia a no?iea }

IF Odd(Length(Str)) = TRUE THEN New:= New + ‘-‘;

{Oeo?iaaiea ioe?uoiai oaenoa ii iao?eoea aeoaaeoa Ieyeoa?a}

Str:= ”;

Dlina_new:= Length(New)div 2;

FOR I:= 1 TO Dlina_new DO

begin

SIM1:= New[2*I – 1];

SIM2:= New[2*I];

IF (ALFAVIT[Ord(SIM1)].STROK = ALFAVIT[Ord(SIM2)].STROK) THEN

{Ia?a neiaieia iaoiaeyony a iaeiie no?iea iao?eoeu}

Str:= Str + INDEX[(ALFAVIT[Ord(SIM1)].STROK),
((ALFAVIT[Ord(SIM1)].STOLB mod 6) + 1)]

+ INDEX[(ALFAVIT[Ord(SIM2)].STROK), ((ALFAVIT[Ord(SIM2)].STOLB mod 6)
+ 1)]

ELSE

IF (ALFAVIT[Ord(SIM1)].STOLB = ALFAVIT[Ord(SIM2)].STOLB) THEN

{Ia?a neiaieia iaoiaeyony a iaeiii noieaoea iao?eoeu}

Str:= Str + INDEX[((ALFAVIT[Ord(SIM1)].STROK mod 6) + 1),
(ALFAVIT[Ord(SIM1)].STOLB)]

+ INDEX[((ALFAVIT[Ord(SIM2)].STROK mod 6) + 1),
(ALFAVIT[Ord(SIM2)].STOLB)]

ELSE

{Ia?a neiaieia iaoiaeyony a ?aciuo no?ieao e noieaoeao iao?eoeu}

Str:= Str + INDEX[(ALFAVIT[Ord(SIM2)].STROK),
(ALFAVIT[Ord(SIM1)].STOLB)]

+ INDEX[(ALFAVIT[Ord(SIM1)].STROK), (ALFAVIT[Ord(SIM2)].STOLB)];

end;

SHIFR_TXT:= Str;

END; {Eiiaoe iniiaiiai aeiea IO SHIFR_TXT}

{I?iecaiaeeony ?anoeo?aoeey no?iee }

FUNCTION DESHIFR_TXT(Str: Stroca; Alfavit: MATR; INDEX: Simvol): Stroca;

VAR {Iauyaeaiea ia?aiaiiuo}

SIM1, SIM2: Char;

NEW: STRING;

I, Dlina_str, Dlina_new: Byte; {I – n/ao/ee oeeeea}

BEGIN {Ia/aei iniiaiiai aeiea IO DESHIFR_TXT}

{Aeaoeo?iaaiea ioe?uoiai oaenoa ii iao?eoea aeoaaeoa Ieyeoa?a}

New:= ”;

Dlina_str:= Length(Str)div 2;

FOR I:= 1 TO Dlina_str DO

begin

SIM1:= Str[2*I – 1];

SIM2:= Str[2*I];

IF (ALFAVIT[Ord(SIM1)].STROK = ALFAVIT[Ord(SIM2)].STROK) THEN

{Ia?a neiaieia iaoiaeyony a iaeiie no?iea iao?eoeu}

New:= New + INDEX[(ALFAVIT[Ord(SIM1)].STROK),
(((ALFAVIT[Ord(SIM1)].STOLB + 4) mod 6) + 1)]

+ INDEX[(ALFAVIT[Ord(SIM2)].STROK), (((ALFAVIT[Ord(SIM2)].STOLB + 4)
mod 6) + 1)]

ELSE

IF (ALFAVIT[Ord(SIM1)].STOLB = ALFAVIT[Ord(SIM2)].STOLB) THEN

{Ia?a neiaieia iaoiaeyony a iaeiii noieaoea iao?eoeu}

New:= New + INDEX[(((ALFAVIT[Ord(SIM1)].STROK + 4) mod 6) + 1),
(ALFAVIT[Ord(SIM1)].STOLB)]

+ INDEX[(((ALFAVIT[Ord(SIM2)].STROK + 4) mod 6) + 1),
(ALFAVIT[Ord(SIM2)].STOLB)]

ELSE

{Ia?a neiaieia iaoiaeyony a ?aciuo no?ieao e noieaoeao iao?eoeu}

New:= New + INDEX[(ALFAVIT[Ord(SIM2)].STROK),
(ALFAVIT[Ord(SIM1)].STOLB)]

+ INDEX[(ALFAVIT[Ord(SIM1)].STROK), (ALFAVIT[Ord(SIM2)].STOLB)];

end;

{A ioe?uoii oaenoa oae?aaony niaoe. ciae “-”}

Str:= ”;

Dlina_new:= Length(New);

FOR I:= 1 TO Dlina_new DO IF (New[I] ‘-‘) THEN Str:= (Str + New[I]);

DESHIFR_TXT:= Str;

END; {Eiiaoe iniiaiiai aeiea IO DESHIFR_TXT}

{Ia/aei iniiaiiai aeiea i?ia?aiiu}

BEGIN

ClrScr;

{Auai? oeo?iaaiea eee aeaoeo?iaaiea oaeea}

WriteLn (‘Auaa?e: (S)OEO?IAAOUe eee (D)AeAOEO?IAAOUe ?’);

REPEAT

K:= ReadKey;

UNTIL (UpCase(K) = ‘S’) OR (UpCase(K) = ‘D’);

{Ii?aaeaeaiea oaeea aaiaea}

{$I-}

REPEAT

Write (‘Iooue e oaeeo: ‘);

ReadLn (Name1);

Assign (Var_file1, Name1);

Reset (Var_file1);

UNTIL (IOResult = 0);

{$I+}

{Ii?aaeaeaiea oaeea auaiaea}

REPEAT

Write (‘Nio?aieoue eae: ‘);

ReadLn (Name2);

UNTIL (Length(Name2) 0);

Assign (Var_file2, Name2);

Rewrite(Var_file2);

{Ia?auaiea e II SHIFR_PLEYFER}

SHIFR_PLEYFER(ALFAVIT, INDEX);

{Oeeee ia?aai?a no?ie ioe?uoiai oaenoa}

WHILE NOT EOF(Var_file1) DO

begin

ReadLn (Var_file1, Str);

{Ia?auaiea e IO SHIFR_TXT eeai IO DESHIFR_TXT}

IF UpCase(K) = ‘S’ THEN Str:= SHIFR_TXT(Str, Alfavit, INDEX) ELSE
Str:= DESHIFR_TXT(Str, Alfavit, INDEX);

WriteLn (Var_file2, Str);

end;

Close (Var_file2); {Cae?uoea oaeea Name2}

Close (Var_file1); {Cae?uoea oaeea Name1}

END. {Eiiaoe iniiaiiai aeiea i?ia?aiiu}

?acoeueoaou

{test.txt} – enoiaeiue ioe?uoue oaeno.

OEO? IEYEOA?A

IAEUe*EE IA EOOIA OENON IAOAE.

N *AEIIE *AOEIE E AeAAeO I?EOAE.

AeAAeOOEA, IEEAIUeEEE, NAeAEAE AEIOIE…

NOA?AIUeEEE AeAAeOOEA IA IIE IIOAE.

{test.plf} – caoeo?iaaiiue oaee (test.txt)

?AeEU,-NO-E.OTHA

AUNAANOUA,THA,OO,TH,O,AOTHEA*O*EN

ETHITH.AO*-UA*YIIEA IO*OO,EOAe?NITHE

IO*OAeOANUA?OeINEAUOIUETHO*AN-UUeIEAeEITHETHETHE

ETHOeNO.EAUO-UO*OEYITHAA*,-I-,-EAeN,THE

{test.new} – ?anoeo?iaaiiue oaee (test.plf)

OEO? IEYEOA?A

IAEUe*EE IA EOOIA OENON IAOAE.

N *AEIIE *AOEIE E AeAAeO I?EOAE.

AeAAeOOEA, IEEAIUeEEE, NAeAEAE AEIOIE…

NOA?AIUeEEE AeAAeOOEA IA IIE IIOAE.

NIENIE EEOA?AOO?U

Caueoa eioi?iaoeee a ia?niiaeueiuo YAI/ A.A.Nianeaoeaa, A.A.Aaaia?,
A.TH.E?ooyeia e ae?. – I.: ?aaeei e naycue, II ‘Aanoa’,1993.

3aueoa i?ia?aiiiiai iaania/aiey: Ia?aaiae n aiaeeeneiai./ Iiae
?aaeaeoeeae Ae.A?ioaa?a. – I.: Ie? 1992.

?iuei A.A.Yeaiaiou e?eioicaueou eioi?iaoeee: O/aaiia iiniaea. – I.:
Ecaeaoaeuenoai IAE, 1995.

A.A.Iao?aeia. Caueoa e io?aia ee/iinoe, nianoaaiiinoe, eioi?iaoeee:
Ni?aaiia iiniaea. – I.: ?aaeei e naycue, 1997.

PAGE

PAGE 18

PAGE

Enoi/iee niiauaiey

i?eaiiee niiauaiee

Aeaoeo?aoi?

D

Oeo?aoi?

A

?aiaeiiecaoi?

Enoi/iee

eeth/a

Нашли опечатку? Выделите и нажмите CTRL+Enter

Похожие документы
Обсуждение

Оставить комментарий

avatar
  Подписаться  
Уведомление о
Заказать реферат!
UkrReferat.com. Всі права захищені. 2000-2020