Implementation of TLS 1.2

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Implementation of TLS 1.

2 by applying Open SSL


Ch.Nishant , J.Parthasarathy , P.Pawan Arsh
Abstract
The TLS Protocol provides security while
OpenSSL is the most credible and usable version of
connecting which has three basic properties: -
SSL/TLS. The main advantage of TLS we are using are:
It fixes all the flaws from it’s previous versions and to
- The identity of the users can be authenticated
create more advanced software. It also provides support
using public key or asymmetric key
to additional cryptographic algoritms and provides a
cryptography. The authentication can be
better picture on those algorithms. OpenSSL is a very
applied based on the user but when there is a
useful package which is used by many huge
communication between two users, one user
conglomerates and also available most widely in the
should need authentication.
market. However, OpenSSL does not support TLS 1.2. In
this, we are going to show how it will support TLS 1.2.
- The negotiation is secured by having secret
key, the negotiated secret key is unavailable to
hackers who eavesdrops and for any connection
Keywords
which is authenticated, the secret key cannot be
Public key cryptography, Message integrity, Symmetric obtained even by a hacker who can interrupt
cryptography, TLS, OpenSSL. the connection.

- The negotiation made between the peer's is


1.Introduction reliable, where no attacker can modify the
negotiation made between the users without
Data integrity and confidentiality between
being detected by the parties while making the
communicating applications can be achieved using
communication.
the TLS protocol. The protocol is stacked with two
layers: namely the TLS Record and Handshake
The main advantage of TLS is that it’s
protocols. These protocols are, layered on top of
independent application and high-level
some reliable transport protocol (e.g., TCP [1]). The
protocols can be placed on other TLS protocol
TLS Record Protocol provides security while
transparently.
making connection which comprises of two basic
The decisions made on to initiate TLS
properties:
handshaking and interpretation of the
The confidential connection is established and exchanging the authentication certificates are
encryption is done through various algorithms of left to the judgment of the designers and
cryptography. For each connection, an unique key protocols implementers which will run on top
is established and these unique keys are generated of TLS.
through different protocols and these keys
generated are called as secret keys.
The connection established is secured and each 2. TLS 1.2 Comparison with TLS 1.1
message sent will undergo an integrity check using
MAC (Medium Access Control). For computing
MAC, secure hash functions are used.
TLS 1.2 gives added advantage to TLS 1.1with its also helps to authenticate themselves in the
flexibility in parleying of various crypto algorithms. network.
Some vital differences are:
TLS 1.2 API Module: Additional user interface
 MD-5 and SHA-1 merge in the PRF which for TLS 1.2 is provided by the TLS 1.2 API
was restored with SHA-256. Module.
 Cipher Suite hashing algorithms is a new
TLS 1.0 Module: Provides working of TLS 1.2
kind of option instigated into SHA-256.
 Differentiation of the corresponding hash Fig 1.
and its signature in the clients and servers
 With the expansion of encryption we made
us of GCM(Galois Counter Mode) as a
mode of encryption in AES.
 With the encrypted PreMasterSecret version
numbers, it helps in providing verification.
3. OpenSSL Basics
OpenSSL present in the market is free of cost S2 and S3 Module: These modules help in the
and its full purpose is available with C and C++ working of SSL 2.0 and SSL 3.0 concurrently.
programming languages. Its first version was
supported by UNIX operating system. In late S23 Module: It assures the compatibility of SSL
1990s there’s work called SSLeay which 2.0 and SSL 3.0
supported SSL, after its defuncting, the first
SSL ciphersuite module: Helps in providing all
version of SSL was released into the market as
the TLS 1.2 cipher suites.
0.9.1c. Apache-style holds the license for
OpenSSl toolkit. This basically free and was SSL PKI Handle module: Helps in providing
tended to use for both commercial and non certificates i.e Public Key Infrastructure.
commercial activities. OpenSSL was majorly
SSL error handle and log module: Helps in
built on two tools: Cryptographic Library and
avoiding all error messages.
SSL tool kit. Despite of years passing there’s no
other SSL implementations using C in the SSL socket module: Helps in combining socket
market which is free of cost. to SSL object.
4. System Design SSL Cryptography module: Helps in providing
with different cryptographic operations.
Below Fig.1 gives us a brief idea of TLS 1.2.
Secure communications with 2 parties can be
achieved using TLS 1.2 protocol that is part of
the library of OpenSSL. The Data of the client
is passed through the dependable transport
protocol eg. TCP.
TLS 1.2 Module: While there are various peers
in the network, this module helps to lay an
agreement upon the security parameters. This
The TLS Handshaking is done in 4 phases:
 Establishing Securing Capabilities certificates are verified and signed with server
 Server Authentication and Key exchange supported signature/hash algorithms.
 Client Authentication and Key 5. Implementation
Exchange
 Finalizing Handshake Protocol 1)Initializing the OpenSSL Library

High level changes in OpenSSL library Int SSL_Library_init(void)

 SHA – 256 is imbibed in the cryptography 2)We’ll define constructor for the SSLv2 using
library SSL_METHOD structure for combined client
 When using TLS 1.2 we should always use and server
SHA-256 in the PRF *SSLv23_method(void)
 New TLS 1.2 which is based on CipherSuite
should be added. 3)SSL_CTX object is created as a framework to
 Protocol Negotiation must imbibe TLS 1.2 establish TLS/SSL connection.
version checking. SSL_CTX_NEW(SSL_METHOD* method)
Certificate type and CA Check in Certificate 4)We need to create a TCP socket Connection
Request:
imp=accept(s,(structsockaddr*)&form,
TLS 1.2 is responsible for Certificate type and (void*)&len);
CA checks as it’s a part of client side. If the
Certificate Authority list the message is not 5)We create a new SSL Structure which is
empty, then the certificate is issued by them. needed to hold the data for a TLS/SSL
connection. This is also called context structure.
Signature/ Hash Algorithms extended in
Certificate request SSL *SSL_new(SSL_CTX *ctx)

TLS 1.2 adds signature algorithms as a part of 6)We need our certificate and private key into
certificate request the context connection.

1. In culmination to cert types, server adds the SSL_CTX_use_certificate_chainfile(ctx,keyfile


Hash and Signature algorithm pairs );
supporting the certificate request SSL_CTX_usecertificate_file(ctx,keyfile,SSL_
2. The public key has to be well-suited with FILETYPE_PEM);
the certificate types listed in certificate
request. Afterwards, the certificates must be 7)We also need to set the descriptor fd as the
signed using a credible hash/signature input/output facility for the TLS/SSL
algorithm pair. (encrypted) side of ssl, fd will typically be the
3. Client’s job is to send its selected certificate, socket file descriptor of a network connection.
if there’s no match, it must correspondingly 8)Start creating I/O Abstraction for the socket
send the client certificate message
containing empty certificate. Sbio = BIO_new_socket((int) serverSocket,
BIO_NOCLOSE);
4. It’s the responsibility of the server to verify
the client certificate chain. In this process, the 9)After calling the fd descriptor it checks
whether it’s a client or server application
10)If it’s a server application [4] Ashutosh Satapathy,Jenila Livingston L. M., “A Comprehensive
Survey on SSL/ TLS and their Vulnerabilities” , International Journal of
Computer Applications (0975 – 8887) Volume 153 – No5, November
int SSL_accept(SSL *ssl) – waits for TLS/SSL 2016.
client to initiate handshake
[5] Pavithra S, Sheeba Pari, “SSL/TLS SECURITY POSTURE
IDENTIFIER”, IJCSMC, Vol. 4, Issue. 4, April 2015.
11)If it’s a client application
[6] Karthikeyan Bhargavan,Ricardo Corin, Cedric Fournet, Eugen
int SSL_connect(SSL *ssl) – initiates TLS/SSL Zalinescu , “Verified Cryptographic Implementations for TLS”, ACM
Journal Name, Vol. V, No. N, March 2010.
handshake with the server
[7] Hugo Krawczyk,Kenneth G. Paterson,Hoeteck Wee,”On the Security
12)After the successful initiation of of the TLS Protocol: A Systematic Analysis”, International Association
for Cryptologic Research 2013.
handshaking, to write data
[8] Platon Kotzias,Abbas Razaghpanah,Johanna Amann,Kenneth G.
int SSL_write(SSL *ssl, count void *buf, int Paterson,Narseo Vallina-Rodriguez,Juan Caballero, “Coming of Age: A
Longitudinal Study of TLS Deployment”, IMC ’18, October 31-
num) November 2, 2018, Boston, MA.

13)To read data after handshaking [9] Martin Husak, Milan ´ Cerm ˇ ak, Tomas Jirsık, Pavel Celeda,
“Network-based HTTPS Client Identification Using SSL/TLS
Fingerprinting”,Proceedings of the IEEE (P IEEE) (2015).
int SSL_read(SSL *ssl, count void *buf, int
num) [10] Nimrod Aviram , Sebastian Schinzel , Juraj Somorovsky , Nadia
Heninger , Maik Dankel , Jens Steube, Luke Valenta , David Adrian , J.
Alex Halderman , Viktor Dukhovni , Emilia Käsper , Shaanan Cohney ,
14)To send a close signal to the connection Susanne Engels , Christof Paar and Yuval Shavitt, “DROWN: Breaking
TLS using SSLv2”, Proceedings of the 25th USENIX Security
int SSL_shutdown(SSL *ssl) Symposium, August 2016

15)To close the connection and free the context


int SSL_free(SSL *ssl)
Conclusion
SSL/TLS are the best security protocols for
providing secrecy, integrity and authentication.
OpenSSL is a basically a library used to help in
supporting cryptography in the programs
developed by the developers. Computation of
hash file contents is easily performed with the
help of CLI commands. OpenSSL is licensed
with Apache and its free to use. In this paper
we’ve shown how can TLS 1.2 be supported in
OpenSSL.
References
[1] Jim Roskind,Michael Sabin,Dan Simon, Tom Weinstein,Tim
Wright, “A Survey on TLS 1.0”, Proceedings of the IEEE (PIEEE)
(2008).

[2] Homin K. Lee,Tal Malkin,Erich Nahum,“Cryptographic Strength of


SSL/TLS Servers: Current and Recent Practices”, Proceedings of the
IEEE (P IEEE) (2010).

[3] Christopher Meyer, Jorg Schwenk, “Lessons Learned From Previous


SSL/TLS Attacks A Brief Chronology Of Attacks And Weaknesses”,
Chair for Network and Data Security Ruhr-University Bochum.

You might also like