Book description
Use OpenSSL to add security features to your application, including cryptographically strong symmetric and asymmetric encryption, digital signatures, SSL/TLS connectivity, and PKI handling
Key Features
Book Description
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.
What you will learn
- Understand how to use symmetric cryptography
- Get to grips with message digests, MAC, and HMAC
- Discover asymmetric cryptography and digital signatures
- Focus on how to apply and use X.509 certificates
- Dive into TLS and its proper usage
- Manage advanced and special usages of TLS
- Find out how to run a mini certificate authority for your organization
Who this book is for
This book is for software developers, system administrators, DevOps specialists, network security engineers, and analysts, or anyone who wants to keep their applications and infrastructure secure. Software developers will learn how to use the OpenSSL library to empower their software with cryptography and TLS. DevOps professionals and sysadmins will learn how to work with cryptographic keys and certificates on the command line, and how to set up a mini-CA for their organization. A basic understanding of security and networking is required.
Table of contents
- Demystifying Cryptography with OpenSSL 3.0
- Foreword
- Contributors
- About the author
- About the reviewer
- Preface
- Part 1: Introduction
- Chapter 1: OpenSSL and Other SSL/TLS Libraries
- Part 2: Symmetric Cryptography
-
Chapter 2: Symmetric Encryption and Decryption
- Technical requirements
- Understanding symmetric encryption
- An overview of the symmetric ciphers supported by OpenSSL
- Block cipher modes of operation
- Padding for block ciphers
- How to generate a symmetric encryption key
- Downloading and installing OpenSSL
- How to encrypt and decrypt with AES on the command line
- Initializing and uninitializing OpenSSL library
- How to compile and link with OpenSSL
- How to encrypt with AES programmatically
- How to decrypt with AES programmatically
- Summary
-
Chapter 3: Message Digests
- Technical requirements
- What are message digests and cryptographic hash functions?
- Why are message digests needed?
- Assessing the security of cryptographic hash functions
-
Overview of the cryptographic hash functions supported by OpenSSL
- Reviewing the SHA-2 family of hash functions
- Reviewing the SHA-3 family of hash functions
- Reviewing the SHA-1 and SHA-0 hash functions
- Reviewing the MD family of hash functions
- Reviewing the BLAKE2 family of hash functions
- Reviewing less popular hash functions supported by OpenSSL
- Which cryptographic hash function should you choose?
- How to calculate a message digest on the command line
- How to calculate the message digest programmatically
- Summary
- Chapter 4: MAC and HMAC
- Chapter 5: Derivation of an Encryption Key from a Password
- Part 3: Asymmetric Cryptography and Certificates
-
Chapter 6: Asymmetric Encryption and Decryption
- Technical requirements
- Understanding asymmetric encryption
- Understanding a Man in the Middle attack
- What kind of asymmetric encryption is available in OpenSSL?
- Understanding a session key
- Understanding RSA security
- How to generate an RSA keypair
- How to encrypt and decrypt with RSA on the command line
- How to encrypt with RSA programmatically
- Understanding the OpenSSL error queue
- How to decrypt with RSA programmatically
- Summary
- Chapter 7: Digital Signatures and Their Verification
-
Chapter 8: X.509 Certificates and PKI
- Technical requirements
- What is an X.509 certificate?
- Understanding certificate signing chains
- How are X.509 certificates issued?
- What are X509v3 extensions?
- Understanding X.509 Public Key Infrastructure
- How to generate a self-signed certificate
- How to generate a non-self-signed certificate
- How to verify a certificate on the command line
- How to verify a certificate programmatically
- Summary
- Part 4: TLS Connections and Secure Communication
-
Chapter 9: Establishing TLS Connections and Sending Data over Them
- Technical requirements
- Understanding the TLS protocol
- The history of the TLS protocol
- Establishing a TLS client connection on the command line
- Preparing certificates for a TLS server connection
- Accepting a TLS server connection on the command line
- Understanding OpenSSL BIOs
- Establishing a TLS client connection programmatically
- Accepting a TLS server connection programmatically
- Summary
- Chapter 10: Using X.509 Certificates in TLS
- Chapter 11: Special Usages of TLS
- Part 5: Running a Mini-CA
-
Chapter 12: Running a Mini-CA
- Technical requirements
- Understanding the openssl ca subcommand
- Generating a root CA certificate
- Generating an intermediate CA certificate
- Generating a certificate for a web server
- Generating a certificate for a web and email client
- Revoking certificates and generating CRLs
- Providing certificate revocation status via OCSP
- Summary
- Index
- Other Books You May Enjoy
Product information
- Title: Demystifying Cryptography with OpenSSL 3.0
- Author(s):
- Release date: October 2022
- Publisher(s): Packt Publishing
- ISBN: 9781800560345
You might also like
book
Implementing SSL/TLS Using Cryptography and PKI
Hands-on, practical guide to implementing SSL and TLS protocols for Internet security If you are a …
book
Applied Cryptography: Protocols, Algorithms and Source Code in C, 20th Anniversary Edition
From the world's most renowned security technologist, Bruce Schneier, this 20th Anniversary Edition is the most …
book
Network Security with OpenSSL
Most applications these days are at least somewhat network aware, but how do you protect those …
book
Real-World Cryptography
An all-practical guide to the cryptography behind common tools and protocols that will help you make …