Implementing Cryptography Using Python

Rs. 12,425
  • Author: Shannon W. Bray
  • ISBN: 9781119612209
  • Publisher: Wiley Publishing
  • Publication Date: September 28, 2020
  • Format: Paperback – 304 pages
  • Language: English

SKU 9781119612209 Category Tag


Share
Description

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
Table of Contents
  1. Introduction xvii
  2. Chapter 1 Introduction to Cryptography and Python 1
    1. Exploring Algorithms 2
    2. Why Use Python? 2
    3. Downloading and Installing Python 3
    4. Installing on Ubuntu 4
    5. Installing on macOS 4
    6. Installing on Windows 4
    7. Installing on a Chromebook 4
    8. Installing Additional Packages 5
    9. Installing Pip, NumPy, and Matplotlib 6
    10. Installing the Cryptography Package 7
    11. Installing Additional Packages 8
    12. Testing Your Install 9
    13. Diving into Python Basics 9
    14. Using Variables 10
    15. Using Strings 11
    16. Introducing Operators 11
    17. Understanding Arithmetic Operators 11
    18. Understanding Comparison Operators 13
    19. Understanding Logical Operators 13
    20. Understanding Assignment Operators 14
    21. Understanding Bitwise Operators 15
    22. Understanding Membership Operators 15
    23. Understanding Identity Operators 16
    24. Using Conditionals 16
    25. Using Loops 17
    26. for 17
    27. while 18
    28. continue 18
    29. break 18
    30. else 18
    31. Using Files 19
    32. Understanding Python Semantics 20
    33. Sequence Types 20
    34. Introducing Custom Functions 26
    35. Downloading Files Using Python 27
    36. Introducing Python Modules 28
    37. Creating a Reverse Cipher 29
    38. Summary 30
  3. Chapter 2 Cryptographic Protocols and Perfect Secrecy 31
    1. The Study of Cryptology 32
    2. Understanding Cryptography 32
    3. Cryptography’s Famous Family: Alice and Bob 33
    4. Diffie-Hellman 34
    5. Data Origin Authentication 34
    6. Entity Authentication 35
    7. Symmetric Algorithms 36
    8. Asymmetric Algorithms 36
    9. The Needham-Schroeder Protocols 36
    10. The Otway-Rees Protocol 38
    11. Kerberos 39
    12. Multiple-Domain Kerberos 40
    13. X.509 41
    14. Formal Validation of Cryptographic Protocols 46
    15. Configuring Your First Cryptographic Library 47
    16. Understanding Cryptanalysis 47
    17. Brute-Force Attacks 47
    18. Side-Channel Attacks 48
    19. Social Engineering 48
    20. Analytical Attacks 48
    21. Frequency Analysis 48
    22. Attack Models 49
    23. Shannon’s Theorem 50
    24. One-Time Pad 51
    25. XOR, AND, and OR 51
    26. One-Time Pad Function 56
    27. One-Way Hashes 58
    28. Cryptographic One-Way Hashes 59
    29. Message Authentication Codes 60
    30. Perfect Forward Secrecy 60
    31. Published and Proprietary Encryption Algorithms 61
    32. Summary 62
    33. References 62
  4. Chapter 3 Classical Cryptography 65
    1. Password Best Practices 66
    2. Password Storage 66
    3. Hashing Passwords 67
    4. Salting Passwords 67
    5. Stretching Passwords 68
    6. Password Tools 68
    7. Obfuscating Data 69
    8. ASCII Encoding 70
    9. Base64 Encoding Text 70
    10. Binary Data 72
    11. Decoding 72
    12. Historical Ciphers 72
    13. Scytale of Sparta 73
    14. Substitution Ciphers 73
    15. Caesar Cipher 74
    16. ROT-13 76
    17. Atbash Cipher 77
    18. Vigenère Cipher 77
    19. Playfair 79
    20. Hill 2×2 83
    21. Column Transposition 87
    22. Affine Cipher 90
    23. Summary 93
  5. Chapter 4 Cryptographic Math and Frequency Analysis 95
    1. Modular Arithmetic and the Greatest Common Devisor 96
    2. Prime Numbers 97
    3. Prime Number Theorem 98
    4. School Primality Test 98
    5. Fermat’s Little Theorem 100
    6. Miller-Rabin Primality Test 100
    7. Generate Large Prime Numbers 104
    8. Basic Group Theory 106
    9. Orders of Elements 107
    10. Modular Inverses 109
    11. Fermat’s Little Theorem to Find the Inverse 110
    12. Extending the GCD 111
    13. Euler’s Theorem 111
    14. Pseudorandomness 115
    15. Breaking C’s rand() Function 116
    16. Solving Systems of Linear Equations 117
    17. Frequency Analysis 120
    18. Cryptanalysis with Python 123
    19. Using an Online Word List 125
    20. Determining the Frequency 126
    21. Breaking the Vigenère Cipher 129
    22. Summary 138
  6. Chapter 5 Stream Ciphers and Block Ciphers 139
    1. Convert between Hexdigest and Plaintext 140
    2. Use Stream Ciphers 141
    3. ARC4 147
    4. Vernam Cipher 148
    5. Salsa20 Cipher 149
    6. ChaCha Cipher 151
    7. Use Block Ciphers 156
    8. Block Modes of Operations 158
    9. ECB Mode 158
    10. CBC Mode 159
    11. CFB Mode 160
    12. OFB Mode 162
    13. CTR Mode 163
    14. Tricks with Stream Modes 164
    15. DIY Block Cipher Using Feistel Networks 165
    16. Advanced Encryption Standard (AES) 167
    17. Using AES with Python 167
    18. File Encryption Using AES 169
    19. File Decryption Using AES 169
    20. Summary 169
  7. Chapter 6 Using Cryptography with Images 171
    1. Simple Image Cryptography 171
    2. Images and Cryptography Libraries 174
    3. Understanding the Cryptography Library 174
    4. Understanding the Cryptosteganography Library 175
    5. Image Cryptography 175
    6. File Cryptography Using Fernet 176
    7. Image Cryptography Using Fernet 179
    8. AES and Block Modes of Operations 180
    9. Exploring a Simple ECB Mode Example 181
    10. Exploring a Simple CBC Mode Example 185
    11. Applying the Examples 186
    12. Steganography 187
    13. Storing a Message Inside an Image 188
    14. Storing a Binary File Inside an Image 192
    15. Working with large images 195
    16. Summary 197
  8. Chapter 7 Message Integrity 199
    1. Message Authentication Codes 200
    2. Hash-based Message Authentication Code 201
    3. Using HMAC to Sign Message 202
    4. Message Digest with SHA 203
    5. Binary Digests 204
    6. NIST Compliance 205
    7. CBC-MAC 206
    8. Birthday Attacks 207
    9. Crafting Forgeries 209
    10. The Length Extension Attack 209
    11. Setting Up a Secure Channel 210
    12. Communication Channels 211
    13. Sending Secure Messages over IP Networks 212
    14. Create a Server Socket 212
    15. Create a Client Socket 213
    16. Create a Threaded Server with TCP 214
    17. Adding Symmetric Encryption 215
    18. Concatenate Message and MAC 218
    19. Summary 221
    20. References 222
  9. Chapter 8 Cryptographic Applications and PKI 223
    1. The Public-Key Transformation 224
    2. Exploring the Basics of RSA 226
    3. Generating RSA Certificates 229
    4. Constructing Simple Text Encryption and Decryption with RSA Certificates 231
    5. Constructing BLOB Encryption and
    6. Decryption with RSA Certificates 232
    7. The El-Gamal Cryptosystem 235
    8. Elliptic Curve Cryptography 238
    9. Generating ECC Keys 240
    10. Key Lengths and Curves 241
    11. Diffie-Hellman Key Exchange 242
    12. Summary 245
  10. Chapter 9 Mastering Cryptography Using Python 247
    1. Constructing a Plaintext Communications Application 248
    2. Creating a Server 248
    3. Creating the Client 250
    4. Creating the Helper File 251
    5. Execution 252
    6. Installing and Testing Wireshark 253
    7. Implementing PKI in the Application Using RSA Certificates 255
    8. Modifying the Server 256
    9. Modifying the Client 257
    10. Modifying the Helper File 258
    11. Execution 259
    12. Implementing Diffie-Hellman Key Exchange 261
    13. Modifying the Server File 262
    14. Modifying the Client File 264
    15. Modifying the Helper File 266
    16. Creating the Diffie-Hellman Class File 270
    17. Execution 275
    18. Wrapping Up 276
    19. Index 277
Author Biography

SHANNON W. BRAY CASP, Security +, CISM is the Virtual CISO at Secured Systems providing clients guidance on establishing and maintaining information security plans, policies, procedures, standards, and guidelines using accepted frameworks. He has worked in this roles and others in corporations and federal agencies. Shannon has an MS in Cybersecurity from the University of Delaware. Prior to transitioning to cybersecurity, he was a well known IT expert with several successful books about Microsoft SharePoint.

Additional information
Weight0.510 kg
Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.