Leanpub Header

Skip to main content

Private Computing with Homomorphic Encryption

From Foundations to Production for Software Engineers

This book is 100% completeLast updated on 2026-08-16

What if your software could compute on sensitive data without ever seeing it? Private Computing with Homomorphic Encryption takes you from the core ideas to working, production-minded systems. Learn the math, schemes, libraries and design patterns you need to build with HE, judge its tradeoffs and know when it is the right tool for the job.

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
212
Pages
About

About

About the Book

This book takes software engineers from zero knowledge of homomorphic encryption to advanced production-ready competence. You will learn the mathematical foundations, master the major schemes and libraries, design HE-compatible algorithms and architectures, build working applications, and reason intelligently about security and performance. By the end, you can evaluate whether HE fits a real system, select an appropriate scheme and implementation, take prototypes toward production, and know when another technology is a better choice.

Author

About the Author

Steve Publications

Steve is a technology professional with more than 20 years of experience in software development, server infrastructure, cybersecurity, vulnerability research and reverse engineering. Throughout his career, he has designed, secured, analyzed and tested complex software and infrastructure, with a particular focus on understanding how systems fail and how they can be made more secure.

Outside of work, Steve enjoys sharing knowledge with the technology community. He collaborates with researchers, industry experts and technology professionals to write practical books covering software development, cybersecurity, cloud computing, networking, DevOps, artificial intelligence and enterprise technologies. His books focus on practical learning through clear explanations, real-world examples and hands-on exercises. With more than two decades of industry experience, his goal is to help IT professionals, students and technology enthusiasts build useful skills and stay current in a rapidly changing industry.

We believe readers deserve to know how our books are created. Most of our authors are not native English speakers, so we use AI to help translate, proofread manuscripts, fix grammar, improve sentence structure and make technical explanations easier to read. AI is used as an editing tool only. It does not replace the research, technical knowledge or hands-on experience behind our books. Some of our authors also prefer to remain anonymous for privacy or professional reasons. In those cases, we publish their work under a different name. The author's name may be different, but the quality of the content and our review process remain the same.

Every book is written, reviewed and maintained by experienced technology professionals, with contributions from our private technical community of more than 420 engineers and researchers. We spend far more time validating technical accuracy and keeping our content up to date than generating text. We are always interested in working with experienced professionals who have deep expertise in a particular technology or domain. If you would like to publish a book with us or help review an existing manuscript, we'd love to hear from you. Send us a message describing your area of expertise. We are especially interested in niche technologies, specialized skills and emerging topics that are underrepresented in existing technical literature.

If you look through the contents of our books, you'll see practical examples, detailed explanations and material that is regularly updated. Our goal is to publish books that professionals can actually rely on, not low-effort AI-generated content. If you ever feel that one of our books does not meet that standard, Leanpub offers a 60-day money-back guarantee. Feel free to request a refund if you are not satisfied with your purchase.

Contents

Table of Contents

From Foundations to Production for Software Engineers

Introduction

Chapter 1: The Promise and Limits of Private Computation

  1. A Day in the Life of Sensitive Data
  2. Trust Problems and Why Encryption Alone Is Not Enough
  3. Threat Models That Matter
  4. The Privacy-Preserving Computation Landscape
  5. When Homomorphic Encryption Is the Right Tool
  6. How This Book Is Organized

Chapter 2: Cryptographic Prerequisites for Software Engineers

  1. What Modern Encryption Actually Guarantees
  2. Symmetric and Asymmetric Cryptography in One Page Each
  3. Semantic Security and Indistinguishability
  4. Computational Hardness Assumptions
  5. Randomness and Entropy in Cryptographic Systems
  6. The Gap Between Textbook and Real-World Cryptography

Chapter 3: Number Theory Foundations — Modular and Polynomial Arithmetic

  1. Integers Modulo N
  2. Extended Euclidean Algorithm and Its Role in Cryptography
  3. Polynomial Arithmetic Over Finite Rings
  4. Cyclotomic Polynomials and Why They Matter for HE
  5. Number Theoretic Transform — the Fast Way to Multiply Polynomials
  6. Computational Complexity of Polynomial Operations

Chapter 4: Lattices, Learning With Errors, and the Hard Problems Behind HE

  1. What Is a Lattice?
  2. Hard Problems on Lattices
  3. Learning With Errors — the Core Assumption
  4. Ring-LWE — Polynomials Make It Efficient
  5. Why Lattices Resist Quantum Attacks
  6. Security Levels and Parameter Choices

Chapter 5: Homomorphic Encryption — Core Concepts and Mechanics

  1. The Basic Idea
  2. Partially, Somewhat, Fully — Levels of Homomorphism Defined
  3. Noise as the Fundamental Resource
  4. Ciphertext Expansion and Why Encrypted Data Is Big
  5. Keys in HE
  6. The Basic Operations: Encrypt, Decrypt, Add, Multiply

Chapter 6: Advanced HE Operations — Depth, Levels, and Management Techniques

  1. Multiplicative Depth and Computational Levels
  2. Relinearization — Keeping Ciphertexts Manageable After Multiplication
  3. Rescaling — Making Room for More Computation
  4. Modulus Switching — Reducing Noise Without Bootstrapping
  5. Rotations and Permutations — Moving Data Within Encrypted Vectors
  6. SIMD Batching and Vectorization — Doing Many Computations at Once

Chapter 7: Exact Arithmetic Schemes — BFV and BGV

  1. The BFV Scheme End-to-End
  2. The BGV Scheme and How It Differs from BFV
  3. Parameter Selection for Exact Arithmetic
  4. Encoding Integers and Vectors in BFV/BGV
  5. Noise Budget Analysis for Exact Schemes
  6. Practical Performance Characteristics

Chapter 8: Approximate Arithmetic — The CKKS Scheme for Real and Complex Numbers

  1. Why Approximate? Motivation from ML and Scientific Computing
  2. The CKKS Construction End-to-End
  3. Encoding Real and Complex Numbers — Scaling and Precision
  4. How Rescaling Works in CKKS — the Key to Multiplicative Depth
  5. Managing Precision Loss Across Computation
  6. Choosing Parameters for Target Accuracy

Chapter 9: Boolean and Circuit-Oriented HE — TFHE

  1. Why Boolean Circuits? Comparison with Arithmetic Circuits
  2. The TFHE Construction at a High Level
  3. Gate Bootstrapping — How TFHE Refreshes Ciphertexts
  4. NAND Gates, Multiplexers, and Building Complex Functions
  5. Performance Characteristics of TFHE

Chapter 10: Scheme Comparison and Selection Framework

  1. Decision Tree for Scheme Selection
  2. Comprehensive Scheme Comparison Table
  3. Library Landscape
  4. Interoperability and Standardization Efforts
  5. Migration Between Schemes and Libraries
  6. Future-Proofing Your HE Choices

Chapter 11: Encoding, Key Management, and Core Operations

  1. Plaintext Encoding Strategies
  2. Key Generation in Practice
  3. Encryption and Decryption Implementation Walkthrough
  4. Basic Homomorphic Operations — Addition, Multiplication, Negation
  5. Serialization and Storage of Keys and Ciphertexts
  6. Debugging Your First HE Program

Chapter 12: Circuit Design and Algorithm Transformation for HE

  1. Analyzing Algorithms for HE Compatibility
  2. Arithmetic Circuits vs Boolean Circuits — Choosing Representation
  3. Minimizing Multiplicative Depth — Algebraic Tricks and Approximations
  4. Handling Conditionals and Branching in HE
  5. Exploiting SIMD/Batching for Parallel Workloads
  6. Approximating Non-Polynomial Functions — ReLU, Sigmoid, Division

Chapter 13: End-to-End Implementations — From Prototype to Working System

  1. Implementation 1: Encrypted Arithmetic Calculator
  2. Implementation 2: Private Aggregation and Analytics Pipeline
  3. Implementation 3: Encrypted Database-Style Queries
  4. Implementation 4: Private ML Inference Service
  5. Testing, Validation, and Correctness Verification Strategies

Chapter 14: Architecture, Performance, and Operations in Production

  1. Client/Server Architectures for HE Systems
  2. Multi-User and Federated Scenarios
  3. Performance Profiling and Optimization
  4. Bandwidth Management for Large Ciphertexts
  5. Observability, Logging, and Monitoring Without Leaking Secrets
  6. Key Rotation, Versioning, and Long-Term Maintenance

Chapter 15: Bootstrapping — Theory, Practice, and Trade-offs

  1. Why Bootstrapping Is Necessary — the Noise Exhaustion Problem
  2. How Bootstrapping Works Conceptually — Evaluate Decryption on Encrypted Data
  3. Mathematical Details of Bootstrapping in Different Schemes
  4. Performance Cost — Why It Is Expensive and When You Can Avoid It
  5. Leveled HE vs Fully Homomorphic HE in Practice
  6. Emerging Optimizations and Hardware Acceleration

Chapter 16: Security Considerations — What HE Protects and What It Does Not

  1. Honest-but-Curious vs Malicious Adversaries — What Each Scheme Assumes
  2. Metadata Leakage — Sizes, Timing, Access Patterns
  3. Side Channels in HE Implementations
  4. Integrity and Authentication Limitations
  5. Common Security Mistakes and Anti-Patterns
  6. Defense-in-Depth with HE — Combining with TLS, MACs, and Other Mechanisms

Chapter 17: Comparing Technologies and Hybrid Architectures

  1. Trusted Execution Environments — When They Beat HE
  2. Secure Multi-Party Computation — Collaboration Without a Server
  3. Zero-Knowledge Proofs — Verification Without Disclosure
  4. Differential Privacy — Aggregate Privacy vs Individual Encryption
  5. Hybrid Architectures — HE + TEE, HE + MPC, HE + ZKP
  6. Technology Selection Framework for Real Projects

Chapter 18: The Evolving Ecosystem and Future Directions

  1. Standardization Landscape — NIST, IETF, ISO, Industry Consortia
  2. Hardware Acceleration — FPGAs, GPUs, ASICs for HE
  3. Emerging Research Directions
  4. Framework for Evaluating New HE Schemes and Libraries
  5. Practical Readiness Assessment — Is HE Ready for Your Use Case?

Conclusion

  1. The Path from Understanding to Production
  2. Final Checklist Before Deploying HE
  3. Resources for Continued Learning

Glossary

Notation Reference

Scheme Comparison Reference

Parameter Selection Reference

Troubleshooting Guide

Architectural Decision Guide

References

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub