explaingit

nakov/practical-cryptography-for-developers-book

3,799CSSAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A free, open-source book teaching practical cryptography for software developers, covering hashing, encryption, digital signatures, key exchange, and elliptic curves with Python code examples throughout.

Mindmap

mindmap
  root((crypto book))
    What it does
      Free crypto textbook
      Python code examples
      Developer focused
    Topics
      Hashing and MACs
      Symmetric encryption
      Public key crypto
      Digital signatures
      Elliptic curves
    Audience
      Software developers
      Security learners
    License
      MIT open source
      Free to copy
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Learn how to hash and safely store passwords using key derivation functions, with Python code examples you can run immediately.

USE CASE 2

Implement digital signatures in Python to prove a message came from a specific sender.

USE CASE 3

Understand elliptic curve cryptography well enough to use it correctly in a real project.

USE CASE 4

Choose the right symmetric encryption algorithm for a data-at-rest or data-in-transit use case using the book's comparison chapters.

Tech stack

PythonMarkdownCSS

Getting it running

Difficulty · easy Time to first run · 5min
Free to read, copy, and modify for any purpose, just keep the copyright notice.

In plain English

This repository is the source for a free, open-source book called "Practical Cryptography for Developers," written by Svetlin Nakov. The book is aimed at software developers who want to understand how cryptography actually works in practice rather than in theory, and it includes code examples in Python and other languages throughout. The topics covered span a broad range of modern cryptographic techniques. These include hashing (turning data into a fixed-length fingerprint), message authentication codes (verifying that data has not been tampered with), key derivation functions (safely turning a password into a cryptographic key), and key exchange protocols (two parties agreeing on a shared secret without sending it directly). The book also covers symmetric encryption (where both sides use the same key), public key cryptography (where each party has a public and a private key), elliptic curve cryptography, and digital signatures (proving that a message came from a specific person). There is also a section on generating secure random numbers and a brief look at quantum-resistant approaches. The book is published under the MIT license, meaning it is free to read, copy, and modify. It has an official website at cryptobook.nakov.com where you can read it online. The README notes that the book was not fully complete at the time of writing and that some chapters were still being worked on. This GitHub repository hosts the content files for the book rather than a software application. If you are a developer curious about encryption, signing, or authentication and want practical examples rather than academic papers, this book is designed for you.

Copy-paste prompts

Prompt 1
I am reading the Practical Cryptography for Developers book and I want to implement bcrypt password hashing in Python. Show me the code based on the key derivation functions chapter and explain the cost factor parameter.
Prompt 2
Using the digital signatures chapter from practical-cryptography-for-developers-book, show me how to sign a JSON payload with an ECDSA private key in Python and verify it with the public key.
Prompt 3
I need to implement AES-256-GCM encryption in Python for storing secrets at rest. Walk me through the approach described in the symmetric encryption chapter, including how to handle the IV and authentication tag.
Prompt 4
Explain Diffie-Hellman key exchange from the practical-cryptography-for-developers-book in plain English, then show me a Python code example of two parties agreeing on a shared secret without sending it over the network.
Prompt 5
I want to generate cryptographically secure random tokens for API keys in Python. What does the practical cryptography book recommend and what function should I use?
Open on GitHub → Explain another repo

← nakov on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.