Book Image

Demystifying Cryptography with OpenSSL 3.0

By : Alexei Khlebnikov
Book Image

Demystifying Cryptography with OpenSSL 3.0

By: Alexei Khlebnikov

Overview of this book

Security and networking are essential features of software today. The modern internet is full of worms, Trojan horses, men-in-the-middle, and other threats. This is why maintaining security is more important than ever. OpenSSL is one of the most widely used and essential open source projects on the internet for this purpose. If you are a software developer, system administrator, network security engineer, or DevOps specialist, you’ve probably stumbled upon this toolset in the past – but how do you make the most out of it? With the help of this book, you will learn the most important features of OpenSSL, and gain insight into its full potential. This book contains step-by-step explanations of essential cryptography and network security concepts, as well as practical examples illustrating the usage of those concepts. You’ll start by learning the basics, such as how to perform symmetric encryption and calculate message digests. Next, you will discover more about cryptography: MAC and HMAC, public and private keys, and digital signatures. As you progress, you will explore best practices for using X.509 certificates, public key infrastructure, and TLS connections. By the end of this book, you’ll be able to use the most popular features of OpenSSL, allowing you to implement cryptography and TLS in your applications and network infrastructure.
Table of Contents (20 chapters)
1
Part 1: Introduction
3
Part 2: Symmetric Cryptography
8
Part 3: Asymmetric Cryptography and Certificates
12
Part 4: TLS Connections and Secure Communication
16
Part 5: Running a Mini-CA

What is OpenSSL?

OpenSSL is an open source software toolkit that includes a cryptography and SSL/TLS library, as well as command-line utilities that use the library to provide some useful functionality on the command line, such as generating encryption keys and X.509 certificates. The main part of OpenSSL is its library, which means that OpenSSL is mainly useful for software developers. However, system administrators and DevOps specialists will also find OpenSSL’s command-line utilities very useful.

SSL stands for Secure Sockets Layer. It is a protocol designed to provide secure communications over insecure computer networks. An insecure computer network means a network where the transmitted data can be read or even changed by a malicious intermediate network node. An example of such an insecure network is the internet. Secure communication is where transmitted data cannot be read or changed. SSL achieves communication security by using symmetric and asymmetric cryptography. The SSL protocol was invented in 1995 by the Netscape Communications Corporation and was deprecated in 2015 in favor of its successor, the TLS protocol. TLS stands for Transport Layer Security.

The OpenSSL toolkit was created before the SSL protocol became deprecated, so it contains “SSL” instead of “TLS” in its name.

OpenSSL was historically licensed under the BSD-style license, but since version 3.0, it is licensed under Apache 2.0 license, which is also BSD-style. This license allows OpenSSL to be used in both open source and closed source applications.

OpenSSL supports a lot of cryptographic algorithms, among which are algorithms for symmetric and asymmetric encryption, digital signatures, message digests, and key exchange. OpenSSL supports X.509 certificates, SSL, TLS, and DTLS protocols, as well as other cryptography-related technologies that are less popular.

OpenSSL has been around for a while and during its development, it gained support for a lot of operating systems. OpenSSL was originally developed for Unix-like operating systems. Up until now, OpenSSL supports different variations of Unix, including GNU/Linux, BSDs, and old and new commercial Unixes, such as IBM AIX and macOS. OpenSSL also supports popular non-Unix operating systems such as Microsoft Windows, mobile OSes such as Android and iOS, and even old and exotic OSes such as MS-DOS and VMS.

Through many years of OpenSSL development, the library has received numerous optimizations, including assembly optimizations for the most popular CPU architectures, such as x86, x86_64, and ARM. OpenSSL is currently one of the fastest existing crypto and TLS libraries.

Because of its universality, support for a lot of algorithms and operating systems, and because of its speed, OpenSSL has become the de facto industry standard. OpenSSL is so popular that other TLS libraries make so-called OpenSSL compatibility layers so that those libraries can be used via OpenSSL application programming interfaces (APIs).

OpenSSL is quite a popular library but what did its path to the widespread adoption look like? Let’s find out by walking through the OpenSSL history.