The Imposters Handbook, Season 2
by Rob Conery and Scott Hanselman. Edited by Dian M. Faye .
2018 Big Machine, Inc. All rights reserved.
ISBN-13: 978-0-578-43817-7
All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed Attention: Rob at the address below.
Publication date: DECEMBER 2018
Publishers version: 1.0.0
Table of Contents
Changelog
0.0.1: Initial pre-release
0.0.2: (June 2018) Added chapter 15, Error Correction. Also added summary, interview question and conversational notes at the top of existing chapters. Fixed reversed (wrong) sample of Implication in the Boolean Algebra chapter.
0.0.3: (August 2018) Expanded on Shannons theories, added chapters on Error Correction, Encryption basics, mod vs. remainder, Diffies Key exchange
0.1.0: (October 2018) Added chapters on RSA, Common encryption algorithms, Cipher/Hash Cracking, Cryptocurrency and Blockchain theory, creating your own blockchain. Draft is complete No more chapters will be added unless you demand it .
1.0.0: Formatting, complete technical and copy edit. Ready to go!
Technical Feedback
There will be plenty of this, Im sure. Weve done a load of research but there will be times where we miss the mark. If you find something you disagree with, please let us know by filing an issue at our GitHub repository . Before you do, we need to ask a favor.
Working through these issues takes time, and we need to be sure we understand what it is youre trying to tell us. So: please , tell us what page you saw the problem (using the PDF), what the problem is, and what you expected to see. Just those 3 things will cut down on the back and forth questions which are typically what do you mean it doesnt work.
With regards to general comments , whether theyre supportive or not, please use email for that. You can email me directly at with your feedback and Ill respond (if warranted).
Preface
Nothing sits quite as restless in your gut as writing a book that you know is unfinished. When I wrote the first Imposters Handbook , I knew quite a few things were missing. I also knew that adding those things meant investing another year plus.
I didnt expect the first book to be as popular as it has become. I thought it might make a bit of a rumble, but the energy behind the release of that book is something Ill never forget.
Still it wasnt done .
I wanted to dive into a subject that I knew so very little about: encryption . I wanted to understand how SHA256 worked and why its used everywhere. I wanted to know why my SSH keys look the way they do and how a machine bits of silica and precious metals can count . Ive never really understood that last bit. Electricity over wires where do the numbers come from?
Now I know. I started researching this book in May of 2017, right after the first season (as my co-author, Scott Hanselman, now refers to it). I was preparing for an interview at Google and one of the prep questions was this little devil:
Create a routine that adds two positive integers without using any mathematical operators.
Some of you reading this will undoubtedly say well of course you just plug in a bitwise XOR and off you go! Me, a year ago, would have had no idea what you were talking about.
This doesnt make me a dumb person, even though I feel that way when I cant answer what seems to be a basic thing. Learning about it, as I have, also does not make me an expert .
How, then, am I writing a book on these subjects if you're not an expert?!?! Ive been asked that a lot.
What youre about to read, once again, is my journey . A programmers travelogue, written along the way, documenting discoveries, linking unknown things together, discovering people and their work that have blown my mind.
For instance: I had no idea who Claude Shannon was before writing this book. I might have heard his name once or twice, which is a damn shame because this man shaped the world you and I live in like no other, save maybe Alan Turing or John von Neumann.
I had no idea that my SSH key contains two massively large prime numbers, using an algorithm that solved a problem that was thousands of years old and thought to be completely unsolvable: secure key transmission .
I didnt know that the much-maligned/ultra-hyped blockchain idea is really just a Git repository for currency transactions. Literally .
I remember being quite excited when I finished the first season of this book. I felt like I finally filled giant gaps in my knowledge! Only to find out, as Ive finished this one, that I had no idea just how much I didnt know. And that horizon is ever-widening .
For now, come with us as we venture to ancient Greece, paying a visit to Aristotle and the dawn of logic as we know it. Well move on from there and see how George Boole spun philosophy into mathematical proofs and then how, in one of the greatest feats of inspiration of our time, Claude Shannon applied Booles mathematical formulas to electrical circuits, giving birth to digital computing.
This is so exciting! Lets go!
-- Rob Conery, December 2018, Honolulu, HI
I remember the day that Rob told me he had put together the outline for this next volume of the Imposters Handbook . Now, you have to see this from my perspective. The original now Volume One of The Imposters Handbook is one of my favorite books of all time. Im still more than a little salty that he had the idea and the discipline to write that book! Id been writing a similar book in my head for the last 15 years. I even posted a few chapters on my blog MANY years ago but I never did anything about it! Rob actually wrote itand it was GOOD.
Rob and I were at the dinner in Bellevue, WA, in the fall of 2017. I remember standing just outside the dinner room, probably making fun of Robs declining hairline as my own disappeared and I asked him what hed been working on. The next volume of the Handbook he told me. Hmmm. Interesting. Damn you Conery! And I shook my tiny fist in the air. He was going to write another volume of a book that I loved and wanted to write!
I asked him what the story was about this go round and he told me something about logic and data and some other stuff that I didnt hear because I interrupted him like I do when Im excited and I said: dude, you HAVE to include this story about my friend so and so and OH! Also make sure you do something on subject X because I read this article tha t and thats when he stopped me.
You really should help me write it. Woah . That was not expected. "Seriously - l could use your help." Let's just say it wasn't hard to convince me. Im a bit of a pushover.
Over the months between then and now, Rob and I would sit on Skype and go over ideas, doodles and other things, hammering this book into shape. Ive added what I could, trying to match Robs style as closely as I can. It was a lot of work and so, so much fun.
I do hope you enjoy it. Im the little person in the sidecar of Robs cool motorcycle hanging on for dear lifeand learning a lot along the way!
-- Scott Hanselman, December 2018, Portland OR
The Basics of Logic
T he entirety of this book will be based on what you read over the next few paragraphs. If I do my job right, what you read next should keep popping up in your mind as we discuss all manner of topics from algebra to circuits, ciphers to packet loss. None of this would be possible without the dedicated study of logic.