Public key cryptosystem

SynonymCryptographygenerallyreferstopublickeycryptography.

Publickeycryptography

Introduction

Thisisjustoneaspectofthecurrentcryptographytheme.Theverificationofthetrueidentityofthesenderandreceiveroftheinformation,thenon-repudiationofthesent/receivedinformationafterthefact,andtheprotectionoftheintegrityofthedataareotheraspectsofmoderncryptography.

Thepublickeycryptosystemhasprovidedexcellentanswerstothesetwoissues,andmanynewideasandsolutionsarecontinuingtobeproduced.Inthepublickeysystem,theencryptionkeyisdifferentfromthedecryptionkey.Peoplemaketheencryptionkeypublicandanyonecanuseit;andthedecryptionkeyisonlyknowntothedecryptor.Amongallpublickeycryptosystemssofar,theRSAsystemisthemostfamousandwidelyusedone.

Developmentprocess

In1976,apublickeycryptosystemwasproposed,theprincipleofwhichistoseparatetheencryptionkeyandthedecryptionkey.Inthisway,aspecificusercanpublicizetheencryptionkeyandalgorithmhedesigned,andonlykeepthedecryptionkeysecret.Anyonewhousesthisencryptionkeyandalgorithmtosendencryptedinformationtotheusercanrestoreit.Theadvantageofpublickeycryptographyisthatitdoesnotneedtopassthekeythroughasecurechannel,whichgreatlysimplifieskeymanagement.Itsalgorithmissometimescalledpublickeyalgorithmorpublickeyalgorithmforshort.

In1978,aspecificimplementationplanforpublickeycryptography,theRSAplan,wasproposed.

TheDSAalgorithmproposedin1991isalsoapublickeyalgorithm,whichhasgreaterapplicationadvantagesindigitalsignatures.

Concepts

Somebasicconceptsandstructuralcomponentsinthepublickeyarchitecture.

KeypairInasecuritysystembasedonapublickeysystem,keysaregeneratedinpairs,andeachpairofkeysiscomposedofapublickeyandaprivatekey.Inpracticalapplications,theprivatekeyiskeptbytheowner,whilethepublickeyneedstobepublishedtothepublic.Inordertomakethebusinessbasedonthepublickeysystem(suchase-commerce,etc.)widelyused,afundamentalandkeyissueisthedistributionandmanagementofpublickeys.

Thepublickeyitselfisnotmarked,andtheownerofthepublickeycannotbedistinguishedfromthepublickeyalone.

Inaverysmallarea,suchasasmallgroupoftwopeoplelikeAandB,theytrusteachother,exchangepublickeys,andcommunicateontheInternetwithoutanyproblems.Ifthisgroupisalittlelarger,itmaynotbeaproblemtotrusteachother,butfromalegalperspective,suchtrustisalsoproblematic.Ifitisbigger,thetrustproblembecomesabigproblem.

Certificate

TheusergroupoftheInternetisbynomeansasmallgroupofpeoplewhotrusteachother.Inthisusergroup,fromalegalpointofview,userscannoteasilytrusteachother.Therefore,thepublickeyencryptionsystemhasadoptedanotherapproach,linkingthepublickeywiththenameoftheownerofthepublickey,andthenaskacredible,fairandauthoritativeorganizationthateveryonecantrusttoconfirm,andaddthesignatureofthisauthority.Thisformsthecertificate.

Becausethecertificateissignedbyanauthority,everyonebelievesthatthecontentonthecertificateistrustworthy;andbecausethecertificatehasidentityinformationsuchastheowner’sname,otherscaneasilyknowthepublickeyWhoistheowner.

CA

Theauthoritymentionedaboveistheelectronicvisaauthority,orCA.CA(CertificateAuthority)alsohasacertificate(containingapublickey),ofcourse,italsohasitsownprivatekey,soithastheabilitytosign.OnlinepublicuserstrusttheCA(CertificateAuthority)byverifyingthesignatureoftheCA(CertificateAuthority).Anyoneshouldbeabletoobtainthecertificate(includingthepublickey)oftheCA(CertificateAuthority)toverifythecertificateissuedbyit.

Iftheuserwantstogetacertificateofhisown,heshouldfirstapplytotheCA(CertificateAuthority).AftertheCA(CertificateAuthority)determinestheidentityoftheapplicant,itassignshimapublickey,andtheCA(CertificateAuthority)bindsthepublickeytotheapplicant’sidentityinformationandsignsittoformacertificateTothatuser(applicant).

Ifauserwantstoverifytheauthenticityofanothercertificate,hewillusetheCA’spublickeytoverifythesignatureonthatcertificate(asmentionedabove,theCAsignatureisactuallypassedbytheCA(CertificateAuthority)Informationencryptedbytheprivatekey,theprocessofsignatureverificationisaccompaniedbytheprocessofdecryptingusingtheCA(CertificateAuthority)publickey).Oncetheverificationispassed,thecertificateisconsideredvalid.

Inadditiontoissuingcertificates,CA(CertificateAuthority)hasanotherimportantroleinthemanagementofcertificatesandkeys.

Itcanbeseenthatthecertificateistheuser’selectronicpersonalIDcardontheInternet,whichhasthesamefunctionasthepersonalIDcardusedindailylife.CA(CertificateAuthority)isequivalenttotheonlinepublicsecuritybureau,whichspecializesinissuingandverifyingIDcards.

Algorithm

Introduction

ThepublickeyalgorithmwasdevelopedbyDiffieandHellmanatStanfordUniversityin1976.Thetwofirstinventedit(thesis"NewDirectioninCryptography").ButcurrentlythemostpopularRSAwasjointlydevelopedbyMITprofessorsRonaldL.Rivest,AdiShamirandLeonardM.Adlemanin1977,andwascomposedofthefirstlettersofthenamesofthreemathematicians.

Theideaof​​thepublickeycryptosystemproposedin1976isdifferentfromthetraditionalsymmetrickeycryptosystem.Itrequireskeystoappearinpairs,oneistheencryptionkey(e),andtheotheristhedecryptionkey.(d),anditisimpossibletodeduceonefromtheother.Since1976,avarietyofpublic-keycryptographicalgorithmshavebeenproposed,manyofwhichareinsecure,someareconsideredsecureandmanyarenotpractical.Theyareeitherthekeyistoolarge,ortheciphertextisveryextended.serious.Thesecurityfoundationofmostcryptographicalgorithmsisbasedonsomemathematicalproblems,whichexpertsbelievecannotbesolvedinashortperiodoftime.Becausesomeproblems(suchasfactorizationproblems)havebeenthousandsofyearsold.

Publickeyencryptionalgorithm,alsocalledasymmetrickeyalgorithm,usestwopairsofkeys:apublickeyandaprivatekey.Theusermustensurethesecurityoftheprivatekey;thepublickeycanbereleased.Publickeyandprivatekeyarecloselyrelated.Informationencryptedwithpublickeycanonlybedecryptedwithprivatekey,andviceversa.Sincethepublickeyalgorithmdoesnotrequireanonlinekeyserverandthekeydistributionprotocolissimple,thekeymanagementisgreatlysimplified.Inadditiontoencryptionfunctions,publickeysystemscanalsoprovidedigitalsignatures.

RSA

ThemostwidelyusedpublickeyencryptionalgorithmisRSA.RSAusestwokeys,apublickeyandaprivatekey.Ifoneisusedforencryption,theothercanbeusedfordecryption.Thekeylengthisvariablefrom40to2048bits.Theplaintextisalsodividedintoblocksduringencryption.Theblocksizeisvariablebutcannotexceedthelengthofthekey.TheRSAalgorithmdivideseachblockofplaintextConvertedintoaciphertextblockwiththesamelengthasthekey.Thelongerthekey,thebettertheencryptioneffect,butthecostofencryptionanddecryptionisalsogreater,sotheremustbeacompromisebetweensecurityandperformance.Generally,64-bitismoreappropriate.Awell-knownapplicationofRSAisSSL.IntheUnitedStatesandCanada,the128-bitRSAalgorithmisusedforSSL.Duetoexportrestrictions,the40-bitversioniscommonlyusedinotherregions(includingChina).

TheoriginalconceptandgoalofRSAalgorithmdevelopmentistomaketheInternetsafeandreliable,aimingtosolvetheproblemoftheuseofopenchanneltransmissionanddistributionofthesecretkeyoftheDESalgorithm.Theactualresultsnotonlysolvethisproblemwell;RSAcanalsobeusedtocompletethedigitalsignatureofthemessagetoresistthedenialanddenialofthemessage;atthesametime,thedigitalsignaturecanbeusedtoeasilydetecttheillegaltamperingofthemessagebytheattacker.Toprotecttheintegrityofdatainformation.

Informationsecuritygoals

Generally,thegoalsofinformationsecuritycanbesummarizedassolvingthefollowingproblemsofinformation:

Confidentialityensuresthatinformationisnotleakedtounauthorizedpersons.Anyoneauthorized.

Integritypreventsinformationfrombeingtamperedwithbyunauthorizedpersons.

Availabilityguaranteesthatinformationandinformationsystemsareindeedusedbyauthorizedpersons.

Controllability(Controllability)implementssecuritymonitoringofinformationandinformationsystemstopreventillegaluseofinformationandinformationsystems.

Passwordisakindoftransformation.Theuseofpasswordtransformationtoprotectinformationsecretsisthemostprimitiveabilityofpasswords.However,withthedevelopmentofinformationandinformationtechnology,moderncryptographyisnotonlyusedtosolvetheproblemofinformationConfidentiality,butalsousedtosolvetheintegrity,availabilityandcontrollabilityofinformation.Itcanbesaidthatpasswordisthemosteffectivemeanstosolveinformationsecurity,andpasswordtechnologyisthecoretechnologytosolveinformationsecurity.

Theadvantageofpublickeysisthatyoumaynotknowanentity,butaslongasyourserverbelievesthattheentity’sCAisreliable,youcancommunicatesecurely.ThisisexactlywhatWebcommerceis.Requiredforsuchabusiness.Forexample,creditcardshopping.TheservicepartycanauthorizeitsownresourcesaccordingtothereliabilityoftheissuingorganizationoftheclientCA.Atpresent,thereisnoCAthatcanbewidelytrustedathomeandabroad.TheproductsofAmericanNatescapeCompanysupportpublickey,butNatescapeCompanyisregardedastheCA.ItisunthinkableinChinathataforeigncompanyactsasaCA.

Theprocessingspeedofthepublickeyschemeisslowerthanthatofthesecretkeyscheme.Therefore,thepublickeyandtheprivatekeytechnologyareusuallycombinedtoachievethebestperformance.Thatis,thepublickeytechnologyisusedtotransfertheprivatekeybetweenthecommunicationparties,andtheprivatekeyisusedtoencryptanddecrypttheactualdatatransmitted.Inaddition,publickeyencryptionisalsousedtoencryptprivatekeys.

Amongthesesafeandpracticalalgorithms,somearesuitableforkeydistribution,somecanbeusedasencryptionalgorithms,andsomeareonlyusedfordigitalsignatures.Mostalgorithmsrequirelargenumberoperations,sotheimplementationspeedisveryslowandcannotbeusedforfastdataencryption.Thefollowingwillintroduceatypicalpublickeycryptographicalgorithm-RSA.

RSAalgorithmcompletesthedigitalsignatureofthemessageverywelltoresistthedenialanddenialofthedata;itiseasiertofindtheillegaltamperingofthemessagebytheattackerbyusingthedigitalsignaturetoprotecttheintegrityofthedatainformation.Sofar,manyencryptiontechnologiesuseRSAalgorithm,suchasPGP(PrettyGoodPrivacy)encryptionsystem,whichisatoolsoftwarethatcanbeusedtoencrypt,decryptordigitallysignfilesafterregisteringwiththecertificationcenter.PGPusesRSAalgorithm.ItcanbeseenthatRSAhasverygoodapplications.

Generate

1.Choosetwolargeprimenumbers,pandq,andcalculaten=qp,whereniscalledthemodulusoftheRSAalgorithm.pandqmustbekeptsecret.Generally,pandqarerequiredtobesecureprimenumbers,andthelengthofnisgreaterthan1024bits.ThisismainlybecausethesecurityoftheRSAalgorithmreliesontheproblemoffactoringlargenumbers.

2.CalculatetheEulernumberofn

φ(n)=(p-1)(q-1)

φ(n)isdefinedasThenumberofnumbersthatdonotexceednandarerelativelyprimeton.

3.Thenrandomlyselecttheencryptionkeye,andselectanumberethatisrelativelyprimetoφ(n)from[0,φ(n)-1]asthepublicencryptionindex.

4.Finally,theEuclidalgorithmisusedtocalculatethedecryptionkeyd,whichsatisfiesde≡1(modφ(n)).Amongthem,nanddshouldalsoberelativelyprime.Thenumberseandnarepublickeys,anddistheprivatekey.Thetwoprimenumberspandqarenolongerneededandshouldbediscardedwithoutlettinganyoneknow.

5.Gettherequiredpublickeyandsecretkey:

Publickey(ieencryptionkey)PK=(e,n)

Secretkey(decryptionkey)SK=(d,n)

Encryptionanddecryption

1.Whenencryptinginformationm(binaryrepresentation),firstdividemintoequal-lengthdataBlockm1,m2,...,mi,blocklengths,where2^s<=n,sisaslargeaspossible.

2.Thecorrespondingciphertextis:ci≡mi^e(modn)(a)

3.Calculateasfollowswhendecrypting:mi≡ci^d(modn)(b)RSAcanbeusedfordigitalsignatures,theschemeistouse(a)signatureand(b)verification.

Related Articles
TOP