您好,欢迎访问三七文档
Internet安全协议与标准第八章SSL/TLS协议张保稳2020/2/8本次课程教学安排Web安全问题SSLWTLSWEB安全Web服务器易于使用但正确配置比较复杂容易成为攻击目标Web安全问题威胁后果反对措施IntegrityModificationofDataTrojanhorsesLossofInformationCompromiseofMachineMACsandHashesConfidentialityEavesdroppingTheftofInformationLossofInformationPrivacyBreachEncryptionDoSStoppingFillingupDisksandResourcesStoppedTransactionsAuthenticationImpersonationDataForgeryMisrepresentationofUserAcceptfalseDataSignatures,MACs不同协议层的安全TCPIP/IPSECHTTPFTPSMTPTCPIPHTTPFTPSMTPSSL/TLSTCPIPS/MIMEPGPUDPKerberosSMTPSETHTTPAttheNetworkLevelAttheTransportLevelAttheApplicationLevelSSL概念SecureSocketsLayer:由Netscape于1994年始创,用于加固http层安全。Version3ofSSLwasreleasedin1995ItiswhatwethinkofwhenwesaySSLSlightvariationbecameTransportLayerSecurity(TLS)andwasacceptedbytheIETFin1999TLSisbackwardcompatiblewithSSLv3目的是使得TCP实现可靠、端对端的服务SSLconsistsoftwosublayers:SSLRecordProtocol(wherealltheactiontakesplace)SSLManagement:(Handshake/CipherChange/AlertProtocols)SSL\TLS的安全性TLSisusedconnection-orientedtransport,typicallyTCP.TLS可做到:Authentication以public/Privatekey方式來做Confidentiality利用一sessionkey,来encode和decode资料Integrity检查MAC(MessageAuthenticationCode),确认是否被篡改不同的SSL版本1.SSL(SecureSocketLayer)是netscape公司设计的主要用于web的安全传输协议。这种协议在WEB上获得了广泛的应用。2.IETF()将SSL作了标准化,即RFC2246,并将其称为TLS(TransportLayerSecurity),从技术上讲,TLS1.0与SSL3.0的差别非常微小。由于本文中没有涉及两者间的细小差别,本文中这两个名字等价。3.在WAP的环境下,由于手机及手持设备的处理和存储能力有限,wap论坛()在TLS的基础上做了WTLS协议(WirelessTransportLayerSecurity),以适应无线的特殊环境。SSL资料EvolvedthroughUnreleasedv1(Netscape)Flawed-but-usefulv2Version3fromscratchStandardTLS1.0SSL3.0withminortweaks,henceVersionfieldis3.1DefinedinRFC2246,Open-sourceimplementationat体系RecordProtocoltotransferapplicationandTLSinformationAsessionisestablishedusingaHandshakeProtocolTLSRecordProtocolHandshakeProtocolAlertProtocolChangeCipherSpecSSL在应用中的位置SSL基本过程建立一个会话AgreeonalgorithmsSharesecretsPerformauthentication传输应用数据Ensureprivacyandintegrity握手协议SSL的核心协议部分完成在传输应用数据之前进行的准备工作.相互认证协商加密算法建立共享密钥TheHandshakeProtocolconsistsofmessagesconsistingofthreefields:Type(1byte):Indicatestypeofthemessage.Thereare10types.Length(3bytes)Content:Thepayloadexchangedineachmessage握手协议NegotiateCipher-SuiteAlgorithms对称密钥密钥交换方法消息摘要函数握手协议基本过程Hello消息证书和密钥交换ChangeCipherSpecandFinishedmessages握手过程(1)}CompChoice,CiphChoice,SessID,r,#vers{:AG.2}CompList,CiphList,SessID,r,#vers{:GA.1GA•rAisanoncemadeof4bytesoftimestampand28bytesofrandom#.SimilarlyforrG.•SessID:0ifnewsession,elseisthesessionIDofanexistingsession(andtheHandshakewillupdateparameters)•CiphListisalistofalgorithmssupportedbytheclientinanorderofdecreasingpreference(KeyExchangeandEncryptionCipher)•CiphChoice:TheciphersuitechosenbytheServer.握手过程(2)服务器认证和密钥交换ServerbeginsbysendingitsX.509cert(andassociatedcertchain)Next,apublickeyissentServermayRequestaCertfromtheClientServersendsendround2message握手过程(2)}EndHello{:AG.6}uthoritiesValidCertA||CertType{:AG.5))e,n(||r||r(hashE||)e,n(:AG.4}Cert509X_G{:AG.3GGGAKGGGKGistheprivatekey,andhenceEKGisasignatureoperationbytheServerValidCertAuthoritiesidentifiestheauthoritiestheserverwillaccept证书SequenceofX.509certificatesServer’s,CA’s,…X.509CertificateassociatespublickeywithidentityCertificationAuthority(CA)createscertificateAdherestopoliciesandverifiesidentitySignscertificateUserofCertificatemustensureitisvalid证书校验问题MustrecognizeacceptedCAincertificatechainOneCAmayissuecertificateforanotherCAMustverifythatcertificatehasnotbeenrevokedCApublishesCertificateRevocationList(CRL)握手过程(3)客户机认证和密钥交换ClientverifiesthattheServer’sCertisvalid,andchecksthatparameterssentarevalidIfacertwasrequested,thentheClientsendsoneServergeneratesaPreMasterSecretsPM握手过程(3)GAPMPMGAPMPMGAPMPMAGPMKr||r||s||'CCC'1SHA||s5MD||r||r||s||'BB'1SHA||s5MD||r||r||s||'A'1SHA||s5MDMS))r||MS||8to1Messages(hash||r||MS(hash:GA.9sE:GA.8}Cert509X_A{:GA.7G+KGisthepublickey,andhenceE+KGisaencryptionusingthepublickeygainedfromthecertificateMessages1to8istheconcatenationoffirst8messagesMSismastersecretandStep9isforverification握手过程(3)ClienttellsServertochangecipher(viatheChangeCipherProtocol).ServerrespondswithitsownchangedciphermessageFinishedMessagearehashesforverification)r||MS||Server||9to1Messages(hash||r||MShash:AG.13}gedCipherChan{:AG.12)r||MS||Client||9to1Messages(hash||r||MShash:GA.11}erChangeCiph{:GA.10AGAGChangeCipherSpecAsinglebyteissentafternewcipherparametershavebeenagreedupon.“Pending”parametersbecomeactivated.SSLAlertProtocolSignalsthatunusualconditionshavebeenencountered.Eachmessageconsistsoftwobytes.Firstbyteisa(1)ifawarningora(2)ifafatalerror.Iferrorisfatal,theconnectionisterminated(otherconnectionsmaycontinue…).Secondbytesaysthetypeoferror.Unexpected_Message:FatalBad_Record_MAC:FatalDecompression_Failure:FatalHandshake_Failure:FatalAndmanymore…SSL加密MastersecretGeneratedbybothpartiesfrompremastersecretandrandomvaluesgeneratedbybothclientandserverKeymaterialGen
本文标题:协议_SSL
链接地址:https://www.777doc.com/doc-3555624 .html