Share E-Book

Explore Go Cryptography (John Arundel)(Z-Library)

Author John Arundel

Go
Language English

Go 1.24 edition Can you keep a secret? I hope so, because much of the modern world is built on cryptography: the art of secret messages. This book will show you what it’s all about and how it really works, with dozens of example programs in Go. About the book Have you ever wondered how passwords are stored securely? What makes a good password? How codes and ciphers are designed—and broken? Where random numbers come from, and what makes them random? What are the connections between lava lamps, space games, digital signatures, black holes, and Bitcoin? Let's find out. Join Alice, Bob, Eve, and Mallory as we learn about the fundamental principles of cryptography and digital security, from brute force and blockchains to keyspaces and hashing. We'll build a cipher system in Go from scratch, with step-by-step instructions and code examples at each stage (also available on GitHub). Starting with the simplest cipher imaginable, we'll gradually improve the system by attacking it, adding sophisticated features like block chaining, padding, digests, and authentication. Along the way, you'll develop a powerful intuitive understanding of ciphers and keys, what makes them strong (or weak), and how to use them securely. We'll see how state-of-the-art modern algorithms like AES, SHA-256, Diffie-Hellman, and RSA work under the hood, and how to integrate them into real-world Go tools. This book is essential reading for all Go programmers who have to deal with encryption, authentication, and security... in other words, all of us! What you’ll learn: By reading through this book and completing the challenges, you’ll learn about: The fundamental principles of codes and ciphers Building software test-first in Go How to write useful command-line tools Password security, keyspaces, and cracking Blocks, streams, chains, and cipher modes Padding, number bases, and endianness Pseudo-random and true random number generators Entropy, complexity, and quantum

Format EPUB
Size 6.2 MB
180
Views
0
Downloads
0.00
Total Donations

AI Guide

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

Full assistant
AI guide
# Explore Go Cryptography — Reading Guide ## 【One-Line Pitch】 A hands-on, test-first journey through cryptography fundamentals, where you build a working cipher system in Go from scratch—perfect for Go programmers who want to understand encryption, authentication, and security without drowning in math. ## 【Book Arc】 - **Opening (~0%–15%)**: Introduces why cryptography matters, sets up the learning philosophy (build simple → attack → improve), and establishes the cast of characters (Alice, Bob, Eve, Mallory). The book promises a gradual climb from toy ciphers to modern algorithms like AES, SHA-256, and RSA. - **Early (~15%–33%)**: Covers the foundations—what codes and ciphers are, how they differ, and why the shift (Caesar) cipher is the perfect starting point. Includes setup instructions for a Go project and the first test-driven development cycle. - **Middle (~33%–52%)**: Implements the shift cipher in Go, byte by byte. Introduces the "spherical cow" problem-solving technique, test-first development, and the core `Encipher` function. This is where you write your first real cryptographic code and tests. - **Middle (~52%–70%)**: Expands into keys, keyspaces, and cracking. Covers multi-byte keys, crib-based attacks, password security, and the mathematics of key strength. Includes building command-line cracking tools and understanding why some keys are weak. - **Late (~70%–90%)**: Moves to block ciphers, cipher modes (CBC, GCM), padding, and the `cipher.Block` and `cipher.BlockMode` interfaces. Introduces enumeration, benchmarking, and the practical limits of brute-force cracking. - **Ending (~90%–100%)**: Covers entropy, information theory, hashing, authentication (HMAC), key exchange (Diffie-Hellman-Merkle), public-key cryptography (RSA), and a brief tour of AES internals. Ends with quantum computing and post-quantum cryptography. ## 【Key Takeaways】 - **Cryptography is learnable by building** (Early): The book's core method is to implement a toy cipher, attack it, and improve it—this builds intuition far better than abstract theory alone. - **Test-first development is essential for crypto code** (Middle): Writing tests before implementation catches subtle bugs that could make your cipher insecure. The book models this discipline throughout. - **Keyspace size determines practical security** (Middle): A key's strength comes from the number of possible keys an attacker must try. The book shows how to calculate keyspace and why longer keys matter. - **Cracking is a design tool, not just an attack** (Middle): By writing a cracker for your own cipher, you learn what makes ciphers weak—and how to design against those weaknesses. - **Block ciphers need modes and padding** (Late): Raw block encryption isn't enough; you need cipher modes (CBC, GCM) and padding schemes to handle arbitrary data securely. The book implements these from scratch. - **Entropy is the measure of unpredictability** (Late): Randomness and entropy are the foundation of secure key generation. The book connects information theory to practical key generation. - **Modern algorithms are built on simple principles** (Ending): AES, RSA, and Diffie-Hellman are complex in detail but follow the same fundamental patterns you've been building—confusion, diffusion, and one-way functions. - **Don't roll your own crypto for production** (Early): The book is explicit that its toy ciphers are for learning only. Real security requires battle-tested libraries and protocols. ## 【Reading Tips】 - **Do the challenges**: The book is structured around coding exercises. Set up the Go project as described and work through each challenge—this is where the real learning happens. - **Skim the math, focus on principles**: If equations look intimidating, don't worry. The author explicitly says you can understand the general principles without the math. Focus on the conceptual explanations and code. - **Deep-read the cracking chapters**: The sections on keyspace, cribs, and brute-force attacks are where you'll develop the most intuition about why cryptography works (or fails). - **Treat the final chapters as a survey**: AES internals and quantum cryptography are covered with more hand-waving and less detail. Read these for awareness, not implementation. - **Use the GitHub code**: The book references code available on GitHub. If you get stuck, look at the reference implementation—but try to solve each challenge yourself first. ## 【Coverage Limits】 This guide covers the book's structure and key concepts based on available excerpts. The later chapters on AES implementation details, quantum computing, and post-quantum cryptography are only briefly represented in the source material. ##

Passage locations

Excerpt 1
s, and cipher modes Padding, number bases, and endianness Pseudo-random and true random number generators Entropy, complexity, and quantum Explore Go: Crypto...
View in text
Excerpt 2
in surprising and thought-provoking ways. Highly enjoyable. —Cuong Quoc As a software engineer who works on a security product (I won’t say which one), I’ve...
View in text
Excerpt 3
test your understanding of the concepts you’ve just learned. If you get stuck on any of these, or just want to check your results, each challenge is accompan...
View in text
Excerpt 4
value as input, what should the function return as a result? This step forces us to clarify our ideas, makes our assumptions explicit, and gives us a way of...
View in text

Recommended for You

Loading recommended books...
Failed to load, please try again later

Tip the Site

Scan the WeChat Pay or Alipay code to tip. No login required.

WeChat Pay
Alipay
Back to List