天才一秒记住【狂风中文网】地址:https://www.kfzw.net
Chapter4Cryptography:thesecretlifeofprimes
banner"
>
Thereaderreciatethattheofumbershas,fromtheearliesttimes,beenreizedastherepositoryofriddlesas,manyofwhieverbeehisday.Formanyofus,thisisenoughtojustifytheuedseriousstudyofhersmaytakeadifferentattitude.Intriguinganddifficultasthesesmaybe,itmightbeimagiheyhavelittlebeariofhumanwisdoButthatwouldbeamistake.
&helastfewdecadesithasemergedthatordihekindsweallindulgeinfromtimetotime,becodedassebers.Thishasintopradourmostprecioussecrets,whethertheybeerilitary,personalorfinancial,politicalhtsdalous,allbeprotetheIbymaskingthemusiordinaryumbers.
&uronumbers
Hoossible?Anyinformatiobeapoemoraba,ablueprintforaonoraputerprogram,bedeswords.Wemay,however,oaugmethatisusedtomakeupourwordsbeyondtheordihealphabet.Wemayinumbersymbols,punbolsingspecialsymbolsforspaordinarywords,butitishecasethatalltheinformatiootransfer,instrusfpiddiagrams,beexpressedusingwordsfromaussay,hahousandsymbols.Wetthesesymbolsaeachsymboluniquelyasanumber.Sinumbersarediible,itmaybettousenumbersallwiththesamenumberofdigitsforthispurpose(so,forexample,everysymbolresentedusitPIringthesymbolstogetherasrequiredtogiveonebiglooldtheeory.Weworkinbinaryifwewishandsodeviseawayanyinformatioringof0sand1s.Everymessagewemighteverwanttosendbecodedasabinarystringatheotherendbyasuitablyprogrammedputer,tobepiledinethatrehend.Thistherealizatiooseweenonepersonaisenough,bothintheoryandiobeabletosendnumbersfromooanother.
Turnionumbers,however,isnotthebigidea.Tobesure,theexactprocessbywhichalltheinformationisdigitizedmaybehiddenfromthegeneralpubliethelessisnotthesourceofproteeavesdroppers.Ihepointofviewraphy,wemayidentifyaheso-calledplaihtherepresentsitahinkofthatheplaiisassumedthatanyonehasaccesstothewherewithalthatwillalloworaheother.Seesontotheslaihothernumbers.
&roduceyoutothefictitiouscharactersthatpopulatethevarioussariraphy,whichisthestudyofciphers(secretcodes).WeimagineAlidBob,whowanttouheachother,withoutbeiheeavesdropper,Eve.Instinctively,wemightsympathizewithAlidBEveasuptonogood,butofcoursethereversemaybetrue,withEverepresentinganoblepoligauthtoprotectusallfromtheevilplotsof BobandAlice.
&hemoralstandiits,thereisanage-oldapproachthatAliploytocutEveoutoftheversationeveerceptsmessagesthatpassbetweeheycryptthedatausihatisknownonlytoAlidBob.Whattheymayarraodoistomeetinaseviroheyexgewithoheraseumber(letussay57)aurimees,AlicewillwanttoseoBoband,justtoillustratethepoint,supposethatmessageberepresentedbyasibetween1and9.Onthebigday,AlitstoseoBob.Shetakeshermessageandaddsthesegredient,thatistosayshemasksitstruevaluebyadding57ahemessagetoBob,ainseel,of8+57=65.BobreceivesthismessageandsubtractstheseumbertoretrieveAlitext65-57=8.
ThenefariousEve,hoodideawhatthesettoandindeeddoesmaercepttheencipheredmessage,65.Butwhatshedowithit?ShemaykAlitoheninepossiblemessages1,2,3,…,9toBobandalsoknowsthatshehasebyaddihemessage,whichmustthereforeliebetween65-9=55and65-1=64.However,becausesheottellwhichoftheseninemaskingnumbershasbeei),sheishewiserastotheactualplaihatAlittoBob,whichisstilljustaslikelytobeaheninepossibilities.AllsheknowsisthatAlitamessagetoBobbuthasis.
ItmightseemthatAlidBobareothemaliceofEveanduhimpunityusingthemagiumber57todisguisealltheyhavetosay.That,however,isn'tquitethecase.Theywouldbewelladvisedtogethatnumber,iteroffusiimebecauseiftheydon't,thesystemwillbegintoleakinformationtoEve.Forexample,sayinafutureweekAlitstosendtoBobthesamemessagenumber8.EverythingwouldrunasbeforeandonEvewouldihemysteriousnumber65fromtheairwaves,butthistimeitwouldtellhersomething.Evehateverthismessageis,itisthesamemessagethatAlittoBobiweek–thisisjustthesAlidBobwouldoknow.
This,however,lookstobenobigproblemforAlidBob.Whemeetupto'exgekeys',insteadonumber,AlicecouldprovideBobwithaloofthousaobeusedoher,thusavoidingthepossibilityofmeaningfultheirpubliclyavailableunis.
Andthisisiisdoice.Thiskiemisknowradeasaohesenderaheirplaihasingle-usehe‘pad’.Thatleafofthepadisthehthesenderahemessagehasbeeaheoimepadrepresentsapletelysecuresysteminthattheihattravelsinthepubliainoinformationaboutthetoftheplaiodecipherit,theiorholdofthatpadiaiioionkey.
Keysandkeyexge
Itwouldseemthenthattheproblemofseunipletelysolvedbytheoimepadand,inaway,thatistrue.Thedifficultywithciphersliketheoimepad,however,isthattheyrequirethepartitstoexgeakeyiousetheIakesalotofeffh-levelunis,suchasthosebetweeeHouseandtheKremlin,moneyishenecessaryexgesarecarriedoutuionsofmaximumsetheeverydayworldoherhand,allsortsofpeopleandinstitutioouhoheriialfashioitsotaffordthetimeandeosecurekeyexd,evenifthiswerearrarustedthirdparty,itexpensivebusiness.
Theondrahersthathadbeehousandsofyearsupuntilthe1970swasthattheywereallsymmetricciphers,meaningthattheenaioiallythesame.Whetheritwasthesimplealphabet-shiftcipherofJuliusplexEnigmaCipheroftheSedWorldWar,theyallsufferedfromtheoonadversarylearnedhowyouwereenessages,theyjustaswellasyou.Iomakeuseofasymmetriccipher,theunigpartoexgethecipherkeyinasecure>
&ohavebeentacitlyassumedthatthiswasanunavoidableprincipleofsecretcodes–foraciphertobeusedthepartnersneeded,somehoworother,toexgethekeytothedtokeepitsetheehismightberegardedasmathemationsense.
Thisisthekindofassumptionthatmakesamathematisuspiciwithwhatisessentiallyamathematicalsituation,soosuciple’tobewellfoundedaedbysomeformofmathemati.Yettherewasnosu,atherewasnosurinciplesimplyisnotvalid,asthefollowingthoughtexperimeransmissionefromAlicetoBobdoesnotinitselfheexgeofthekeytoacipher,fortheyproceedasfollows.AlicewritesherplaimessageforBob,ainaboxthatshesecureswithherownpadlolyAlicehasthekeytothislock.ShethenpoststheboxtoBob,whoof.Bob,however,thenaddsasedpadlocktothebox,forossessesthekey.TheboxistheoAliovesherownlodsendstheboxforaseetoBob.Thistime,BobmayunlocktheboxandreadAlice’smessage,sethekhemeddlingEveothavepeekedatthetsduringthedeliveryprothisway,asecretmessagemaybesetonaninseelwithoutAlidBihisimaginarysarioshowsthatthereisnolawthatsaysthatakeymustdsintheexgees.Iem,AlidBob’s‘locks’mightbetheirownessageratherthanaphysicaldeviceseparatingthewould-beeavesdropperfromtheplai.Aliaythehisiosetupanordiriccipherthatwouldbeusedtomaskalltheirfutureuni.
&hisisthewayaseunielisofteablishedintherealwphysigdevicesbyperso,however,soeasytodo.UheengsofAliayihoher,makingtheunsg(thatis,theunlog)thatiscarriedoutrstbyAlidthenbyBobunworkable.However,thatthismethodbeeffectiveublistratedbyWhiteldDifeandMartinHellmanin1976.
Asedrelatedapproachistheideaofasymmetricorpublickeycryptographyinwhiepublishestheirownpublickeythatistheesmeantforthatperson.Hoersonalsoholdsaprivatekey,withoutwhichthemessageseheirownuniquepubliotberead.Ihepadlockmetaphor,AliceprovidesBobwithaboxinwhichtoplacehisplaiogetheradlock(herpublickey)towhichshealohekey(herprivatekey).
Aublickeysystemmightseemtoomuchtoaskforasthetwisofsedeaseofuseseemtofiict.Fast,safeenis,however,availabletothegeneralpublitheIheybarelyrealizethatitisthere,safeguardierests.Anditisalldowntonumbers,andprimehat.
Howsecretprimesprotectoursecrets
&everyplaimessageisregardedjustasasiisnaturaltotrytomaskthisnumberusingotherhemostonwaytodothisisthroughemployingtheso-calledRSAengprocess,publishedin1978byitsfounders,Ro,AdiShamir,andLeonardAdleman.InRSA,ea’sprivatekeysistsofthreenumbers,p,q,andd,wherepandqare(verylarge)primehethirdidisAlice’ssecretdegheroleofwhichwillbeexplainedinduecourse.Aliceprovidesthepubli=pq,theproductofhertwosecretprimes,andanengnumbere(whiordinarywholenumber,inothespestaionedinChapter2).
AsimpleexampleforthepurposesofillustrationwouldbeforAlicetohavetheprimesp=5andq=13sothatn=5×13=65.IfAlicesetsherengobee=11,thenherpublickeywouldbe(n,e)=(65,11).Toencryptamessagem,BobonlyneedsnaodeciphertheencryptedmessageE(m)thatBobtransmitstoAlicerequiresthedegnumberd,whithissouttobed=35,asweshallshowalittlefurtheroicsthatallowsdtobecalculatedrequiresthattheprimespandqareknown.Inthistoyexample,giventhatn=65,anyonewouldsoop=5andq=13.However,iftheprimesparemelylarge(typicallytheyarehunderedsofdigitsihistaskbeesapracticalimpossibilityforalmostaem,atleastinareasonablyshorttime,suchastwoorthreeweeks.Insummary,theRSAsystemofengisbasedontheempiricalfactthatitisprohibitivelydifficulttofindtheprimefactorsofavery,verylargehecleverpart,whichlainintheremaihechapter,liesindevisingawaythatthemessagenumbermcipheredjustusingthepublibers,inpractice,degrequirespossessionoftheprimefa.
HereishohatBobsendsthroughtheetherisheremainderwhenmeisdividedbyheakingthisremainderrandsimilarlygtheremainderwhenrdisdividedbyn.TheunderlyiisuresthattheouteforAliceistheinalmessagem,whitheoordinaryplaibyAliputersysteThisis,ofcourse,happeningseamlesslybehindthesesforanyreal-lifeAlidBob.
ItwouldseemthattheonlythingthatEvelacksthatreallymattersisthisdegnumberd.IfEvek,shecoulddecipherthemessagejustaswellasAlice.Itturnsoutthatdisasolutioaiion.SolviionisputationallyquiteeasyaheEuAlgorithm,publishedintheBooksofEu300BC.Thatisnotthedifficulty.Thetroubleisthatitisnotpossibletofilywhatequationtosolveunlessyoukoheprimespandq,andthatistheobstaclethatstopsEveiracks.
laihowthenumbersinvolvedinallthisworkieFirst,thereisapparentlyquiteaproblemwithBob’sinitialtask.Thenumbermisbig,thenumbernismonstrous(oftheorderof200digits)andevehatlarge,thenumbermeisgoiremelylargeaswell.Aftergit,wehavetodividemebythetheremainderr,whichrepresentsthee.Itmightseemthatthecalsaretoouobepractical.Weshouldbeawarethateventhoughmodernputersareextremelypowerful,theyyethavetheirlimitations.Whencalsinvhpowers,theyexceedtheputersysteWelyethatanypracticalcalthatwesetforaputereinashortperiodoftime.
ThesavinggraceforBobisthatitispossibletofindtherequiredremaihoutdoingthelongdivisionatall.Iheremaidependonremainders,andhereisaoillustratethepoint.Whatarethefinaltwodigitsof739?(Thatistosay,whatistheremaihisnumberisdividedby100?)Ioahisquestiobeginbygthefirstfewpowersof7:71=7,72=49,73=343,74=2,401,75=16,807,….Itwillsoonbeeclear,however,thatthesheersizeofthesenumbersisgoingtobeanageablewellbefetanywherenear739.Oherhaeoeranother,atterhekeyobservationisthat,aswecalculatesugpowers,thefinaltwodigitsoftheanswerdependowodigitsnumber,aswhenweultipli,digitsinthehundredsnandbeyondhaveonisandtensns.
Whatismore,since74has01asthefinaldigitpair,thefourpowerswillendin07,49,43,andthen01again.Heesugpowers,thepatterwodigitswillsimplyrepeatthiscygthfour,overandaihequestioninhand,since39=4×9+3,wewillpassthroughthisfour-etimesahreemorestepsingthefinaltwodigitsof739,whichmustthereforebe43.Andthisworksquitegenerally.Iheremainderwhensomepowerabisdividedbynsay,weaketheremainderrwhenaisdividedbyraaindersaswetakesuccessivepowersofr.iththeremainderr,whichwillbeaheraoissaythatwearewmodulaiplesofnthatmayarise,astheyleavearemainderof0whendividedbyn,andsotributetothevalueofthenalremainderr.
YoumightstillsuspectthatIhaveriggedtheevidencebyganexamplewhereaverysmallpowerleftaremainderof1–inthisinstance74was1morethanamultipleofn=100.This,however,isonlypartlytrue.Itturnsoutthat,ifwetakeanytwonumbers,aandonfactoris1(wesaysuumbersaremutuallye),thenthereisalowertsuchthatatequals1modulon,thatistosayleavesaremainderof1whendividedbyn.Fromthispoint,theremaindersofsuccessivepowersfollowacygtht.It,however,behardtopredictwhatisthevalueoft,butitisknownthattmustalwaysequalorbeafabertraditionallywrittenasφ(n),thevalueoftheEulerphifun.
whichisthesameastheresultthatweobtailyfromthedefinition.Usihod,youmightliketocheckyourselfthatφ(100)=40,andso,forihenfollowsthat740equals1modulo100.However,aswehavealreadyseepowerof7thatyieldsaremainderof1isnot40butitsdivisor4.
本章未完,请点击下一章继续阅读!若浏览器显示没有新章节了,请尝试点击右上角↗️或右下角↘️的菜单,退出阅读模式即可,谢谢!