| SSL and TLS - info | SSL and TLS references and links. |
Contents of this page:
What is SSL? SSL is a protocol using different cryptographic algorithms to implement security using authentication with certificates, session key exchange algorithms, encryption and integrity check. It is a common protocol, often used to ensure that the communication between WWW-server and WWW-client is safe and encrypted. Why SSL? SSL v3.0 is a de facto standard and the Internet Engineering Task Force, IETF, has a group working to develop SSL v3.0 further and the work will lead to a standard. This working group is named Transport Layer Security, TLS, see more below. SSL v3.0 has been developed by Netscape with opinions from several industrial companies and developers. SSL v3.0 contains everything you need to implement security in application where you transfer data. It has authentication of the strong type with certificates, session key exchange algorithms, encryption, integrity checks. If the browser is inactive or if the session takes very long time the session keys, one key per way, can be changed. How does SSL work
?
All the calls from the application layer to the TCP layer are replaced with calls to the SSL layer, and the SSL layer will take care of the communication with the TCP layer. This is how the stack looks like when we have put in SSL into it and as we can see is SSL actually divided into two different layers with the SSL Record layer just on top of the TCP layer: -----------------------------------------------------
Change Cipher Alert Protocol Handshake protocol SSL Record Layer TCP Layer IP Layer
In the SSL Record layer the messages are divided/combined to fit within the payload of SSL records, a MAC is created and then is the whole record layer message encrypted with the secret key algorithm agreed upon. The substance of the SSL records will be: content type, protocol version number, length, data payload, message authentication code( MAC ,provides for dataintegrity). The messages are then sent to the other peer through a TCP/IP connection. An SSL session starts by following a handshake sequence that may vary depending on if the client and server has been in contact with each other before, if certificates are required or not, if an old session is resumed. During the handshake there is a negotiation of what
Cipher Suite to use during data transfer, establishment and sharing of
the session key between the client and server and optionally authentication
of the peers. The Cipher Suite consists of what methods to use for Key
Exchange, Data Transfer and creation of Message Authentication Code, MAC.
In the table below you see what methods are defined in the SSL v3 protocol.
We have seen a description of different cryptographic algorithms earlier
in this report.
Session Key Exchange Algorithms, used during handshake:
Secret Key Algorithms for encryption:
Hash Algorithms for MAC:
Certificates types:
When starting up an SSL connection do the peers not know each other so the encryption and MAC algorithms are set to SSL_NULL_WITH_NULL_NULL, indicating that no encryption or message authentication is performed. The peers will have to agree upon how to do encryption/decryption and how to create a MAC. They exchange a Premastersecret, this is done with any of the key exchange algorithms available: RSA, Diffie-Hellman or Fortezza-DMS. When receiving the PreMastersecret, a Mastersecret is
computed and the PreMastersecret is erased from memory. This MasterSecret
is used to generate key material, which is partitioned to the following
secrets and keys:
There are differenet SSL protcols used during the handshake sequence and all of them can be seen as higher level clients of the SSL Record protocol. Each protocol have specific types of messages that are sent using the record layer. The SSL protocols are: *Handshake protocol
We will take a closer look on these protocols to understand what situations they are used in. The Handshake protocol in use :
The Change cipher specification protocol is used when the handshake is done and the transferrance of data is about to take place. It can also be used when the peers want to change the cipher specification to use, this is good when long time has passed with the same secure channel open. The Alert protocols are used when some peer wants to shut down the connection or if one of the peers has detected some error in the transferrance, authorization or something else. After the handshake does the the actual communication take place, the transferrance of data. A MAC is computed, with master/client MAC write secret, for the data. The record is loaded with: data to send, MAC, sequence number, content type, protocol version number and length. The whole record is encrypted with the server/client write key using any of the secret key algorithms available. The receiver decrypts with client/server read key och computes MAC to check integrity. SSL and firewalls
Layer Client Firewall Server App layer \/ /\>\/ /\
Fig. Traffic flow in an application level firewall
SSL is used to set up a secure channel between a client and a user and to avoid any kind of "man-in-the-middle" attack, se below. If we have a application level firewall with full proxy function, caching and replication, the SSL protocol will shout: "STOP!", as SSL sees the proxy server as a man-in-the-middle. Some proxy firewalls on the market supports the SSL Tunneling CONNECT extension method [ ]. This describes how an SSL connection is set up via normal HTTP, then handshake phase takes place and creates a secure connection via a byte-forwarding tunnel. The proxy has access to the request headers but the traffic in the session is encrypted according to the SSL protocol. Layer Client Firewall Server App layer \/ /\
Fig . Traffic flow in a packet filtering firewall If the firewall works on the network layer, a packet filtering firewall, it will be much easier to set up an SSL connection, but easier often means less secure. This type of firewall is set up to open a reserved and trusted port for the SSL connection, port 443 for SSL with HTTP, port 563 for SSL with NNTP or port 995 for SSL with POP3. All traffic on the port is now allowed to pass through unrestricted. That works fine if there are only SSL capable servers listening on this port , but what will happen if an internal attacker sets up her own connection through this port? There is no way for the firewall to check what type of traffics passing by, a security hole has been opened and the firewall administrator will close this port as soon as he finds out that.
If the Intranet is considered to be very secure,
all users are trustable and all wires are protected so no one can break
in to them, there is another possible solution to implement. Let all traffic
on the go unencrypted and let the firewall have the responsibility to set
up an SSL connection. In this case we miss the peer to peer authentication,
it is only possible for an outsider to authenticate the firewall and thereby
the use of certificates miss some or all of its strength.
Yet another possibility is letting the proxy server hold both client and server keys for its internal clients. When setting up a connection between a client and a server there is actually two SSL connections that are set up, one between client and proxy and on between proxy and server. Now the proxy server can listen to the traffic but just imaging what a delay it means packing up and packing down every single packet passing by. The problem with a firewall between client and server
can, as we have seen, be solved in different ways, none of them is really
the most optimal. We will have to wait and see what future has to show
us.
Implementation libraries
of SSL
· SSLref :[ ] Netscape has developed this reference implementation of the SSL protocol. This software library distributed in ANSIis C source code and can be compiled on several platforms as Win95/NT and Solaris. It is on the market, free for noncommercial use but hard to get for non US citizens as the package falls within the hard export restrictions[ ]. · SSLplus:[ ] When the work with SSLref, se above, was finished the work went on by Consensus Development Corporation and they came with this software implementation package that implements SSLv3. To be able to use SSL plus the user has to purchase a license of RSA BSAFE cryptographic toolkit [ ] and this one falls within the export restrictions. · SSLava: [ ] an implementation package for the Java programming language. · SSLeay:[ ] Freeware, widely available and widely
used. A more exhaustive description below.
SSL is the protocol that we have found out to be the most
convenient. We have here the most important aspects that has made us choose
the SSL protocol.
Disadvantages
Security analysis
of SSL
· Clear Text Attack
Alice
Bob
Trudy Bob
Dictionary This attack is used when Trudy has an idea of what is
sent and whenit was sent. For example, a Telnet connection always start
with "login name:", Trudy snoops the first part of the sent data and identifies
that with the clear text. Trudy gather information in a dictionary, the
data in the dictionary can be used to check what the encrypted data represents
in cleartext and the contents in the dictionary can be extended as time
goes by. When the session key has been identified, the entire message
can be decrypted.
· Replay Attack Alice
Bob
Trudy Bob
As the name and the picture reveals is this attack of
the type where Trudy listens to the communication from Alice to Bob, she
records the message and on a later occasion she replays the message
to Bob. An example of this attack type can be an employee, Trudy, that
wants to have the monthly salary payed twice to her bank account.
· Man In The Middle
Alice Trudy Bob If Trudy cuts the line between Alice and Bob and connects
her self in the middle, she might pretend to be Bob when talking to Alice
and pretend to be Alice when talking to Bob. When Alice is sending confidential
data to Bob, Trudy can intercepts it and change the data to her advantage
and then sends the new data to Bob and does the same thing with traffic
from Bob to Alice, she acts as the man in the middle.
|
SSL drafts:
SSL2.0, HYPERLINK http://www.netscape.com/newsref/std/SSL_old.html SSL3.0 Internet Draft, HYPERLINK http://www.consensus.com/ietf-tls/tls-ssl-version3-00.txt The "SSL Protocol, Version 3.0", HYPERLINK
http://home.netscape.com/eng/ssl3/draft302.txt
SSL information
Phaos, SSL Resource Center, HYPERLINK http://www.phaos.com/sslresource.html SSL-Talk List FAQ v1.0.3 , HYPERLINK http://www.consensus.com/security/ssl-talk-faq.html SSL tunneling CONNECT , HYPERLINK http://www.netscape.com/newsref/std/tunneling_ssl.html
Implementation libraries:
SSLPlus, HYPERLINK http://www.consensus.com/SSLPlus/ BSAFE3.0, used in SSLPlus, HYPERLINK http://www.rsa.com/rsa/prodspec/bsafe/bsafe_3_0_f.htm SSLava, HYPERLINK http://www.phaos.com/solutions.html
Export rules for crypto. Koops, Bert-Jaap, "Crypto Law Survey", version
8.2, May 1997.
Standards: Newsgroups :
<ftp://ftp.consensus.com/pub/security/ssl-talk-faq.txt |
Skapad 980305 av Micke Pettersson, mikael.pettersson@tsl.uu.se,
http://www3.tsl.uu.se/~micke