Implementing Cryptography Using Python
eBook - ePub

Implementing Cryptography Using Python

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Implementing Cryptography Using Python

About this book

Learn to deploy proven cryptographic tools in your applications and services

Cryptography is, quite simply, what makes security and privacy in the digital world possible. Tech professionals, including programmers, IT admins, and security analysts, need to understand how cryptography works to protect users, data, and assets. Implementing Cryptography Using Python will teach you the essentials, so you can apply proven cryptographic tools to secure your applications and systems. Because this book uses Python, an easily accessible language that has become one of the standards for cryptography implementation, you'll be able to quickly learn how to secure applications and data of all kinds.

In this easy-to-read guide, well-known cybersecurity expert Shannon Bray walks you through creating secure communications in public channels using public-key cryptography. You'll also explore methods of authenticating messages to ensure that they haven't been tampered with in transit. Finally, you'll learn how to use digital signatures to let others verify the messages sent through your services.

  • Learn how to implement proven cryptographic tools, using easy-to-understand examples written in Python
  • Discover the history of cryptography and understand its critical importance in today's digital communication systems
  • Work through real-world examples to understand the pros and cons of various authentication methods
  • Protect your end-users and ensure that your applications and systems are using up-to-date cryptography

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Implementing Cryptography Using Python by Shannon Bray in PDF and/or ePUB format, as well as other popular books in Computer Science & Cryptography. We have over one million books available in our catalogue for you to explore.

Information

Publisher
Wiley
Year
2020
Print ISBN
9781119612209
eBook ISBN
9781119615453

CHAPTER 1
Introduction to Cryptography and Python

Cryptography is one of the most important tools we have at our disposal as information security professionals. It provides us with the ability to protect sensitive information from unauthorized disclosure through encryption. Cryptography is the use of mathematical algorithms that can be used to transform data either into an encrypted form (ciphertext) or into its decrypted form (plaintext). The purpose of these algorithms can be quite complicated. The goal of this book is to help simplify the use of cryptography using the available libraries in Python, so you will begin your journey into cryptography by setting up a Python environment. You'll also get a review of using Python, and then you'll write your first cipher using Python. Specifically, you'll do the following:
  • Gain an understanding of algorithms
  • Explore various Python installations
  • Set up Python 3 on various machines
  • Explore the basics of the Python language
  • Write your first cipher using Python

Exploring Algorithms

The algorithms you will explore in this book can be quite sophisticated, but most of the logic is encapsulated into little black boxes that allow you to interface with the algorithms using functions. In the programming or mathematical world, a function is merely a way to enter values and receive output. When using algorithms in cryptography, we generally have two inputs for encryption and two inputs for decryption:
  • The encryption process will take the plaintext message (P) along with an encryption key (K) and then run the plaintext through encryption algorithms, which will return ciphertext (C).
  • On the decryption side, the ciphertext (C) will be supplied along with the encryption key (K), which will produce the plaintext (P) message.
As you study various encryption themes throughout this book, you will find that they are described by three algorithms: GEN for key generation, ENC for the encryption algorithm, and DEC for the decryption algorithm. You'll revisit this concept at the end of this chapter when you learn how to create a Python function.
Encryption themes described by three algorithms: GEN for key generation, ENC for the encryption algorithm, and DEC for the decryption algorithm.

Why Use Python?

Using Python for cryptography is simpler than using languages such as C or C++; while free libraries such as OpenSSL are available, their use can be quite complex. Python removes these complexities with many built-in libraries that aid in cryptography scripting. It is also a great choice because Python is free in terms of license. Python can be described as an open-source, general-purpose language that is object oriented, functional, and procedural, and it allows for the interface with C/ObjC/Java/Fortran and even .NET. A number of versions are available, from 2.5.x through 3.x. Currently, 3.x is becoming more popular as new libraries are introduced. Python comes preinstalled with Linux and macOS, and you can install it on Windows as well. You will learn how to install Python in each of these environments later in this chapter.
Because Python is available for Windows, Linux/Unix, Mac, and Chromebooks, among others, the lessons you learn here will be portable to several environments. Python has proven to be quite powerful in information security and can be used to quickly script solutions to help you become a better security practitioner. I...

Table of contents

  1. Cover
  2. Table of Contents
  3. Introduction
  4. CHAPTER 1: Introduction to Cryptography and Python
  5. CHAPTER 2: Cryptographic Protocols and Perfect Secrecy
  6. CHAPTER 3: Classical Cryptography
  7. CHAPTER 4: Cryptographic Math and Frequency Analysis
  8. CHAPTER 5: Stream Ciphers and Block Ciphers
  9. CHAPTER 6: Using Cryptography with Images
  10. CHAPTER 7: Message Integrity
  11. CHAPTER 8: Cryptographic Applications and PKI
  12. CHAPTER 9: Mastering Cryptography Using Python
  13. Index
  14. End User License Agreement