07.07.2023 Views

Implementing-cryptography-using-python

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

xiv

Contents

Pseudorandomness115

Breaking C’s rand() Function 116

Solving Systems of Linear Equations 117

Frequency Analysis 120

Cryptanalysis with Python 123

Using an Online Word List 125

Determining the Frequency 126

Breaking the Vigenère Cipher 129

Summary138

Chapter 5 Stream Ciphers and Block Ciphers 139

Convert between Hexdigest and Plaintext 140

Use Stream Ciphers 141

ARC4147

Vernam Cipher 148

Salsa20 Cipher 149

ChaCha Cipher 151

Use Block Ciphers 156

Block Modes of Operations 158

ECB Mode 158

CBC Mode 159

CFB Mode 160

OFB Mode 162

CTR Mode 163

Tricks with Stream Modes 164

DIY Block Cipher Using Feistel Networks 165

Advanced Encryption Standard (AES) 167

Using AES with Python 167

File Encryption Using AES 169

File Decryption Using AES 169

Summary169

Chapter 6 Using Cryptography with Images 171

Simple Image Cryptography 171

Images and Cryptography Libraries 174

Understanding the Cryptography Library 174

Understanding the Cryptosteganography Library 175

Image Cryptography 175

File Cryptography Using Fernet 176

Image Cryptography Using Fernet 179

AES and Block Modes of Operations 180

Exploring a Simple ECB Mode Example 181

Exploring a Simple CBC Mode Example 185

Applying the Examples 186

Steganography187

Storing a Message Inside an Image 188

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!