Skip to Content
Implementing SSL/TLS Using Cryptography and PKI
book

Implementing SSL/TLS Using Cryptography and PKI

by Joshua Davies
January 2011
Intermediate to advanced content levelIntermediate to advanced
696 pages
16h 56m
English
Wiley
Content preview from Implementing SSL/TLS Using Cryptography and PKI

APPENDIX A

Binary Representation of Integers: A Primer

If you know how to program in C, you must have spent some time looking at machine-level details, including binary number representations, as you learned it. This appendix covers some of these details that you were probably familiar with at one point, but have since (maybe willfully) forgotten.

The Decimal and Binary Numbering Systems

Humans use a base-10 numbering system. Ten unique digits (including 0) represent the first nine ordinal numbers. After the ninth position, you use multiple digits to represent numerals. Anthropologists believe that the base-10 numbering system, which is ubiquitous in almost all human societies, came about because humans have 10 fingers. As it turns out, though, computers have just one such "finger" because they're electrical machines. I'll go out on a limb and assume you interact with electricity at least occasionally when you turn on a light switch — the switch is the counter which can be in two states: on and off. If it's on, electricity flows; if it's off, it doesn't.

To grossly oversimplify, a CPU is nothing but a series of interrelated electronic switches. Numbers are represented by unique combinations of multiple switches. One such switch can count two unique values. Two switches can count four: on-on, on-off, off-on and off-off. Three switches can count eight values, and n switches can count 2n values. Most modern computers are said to be 32-bit processors, which means that the internal ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Cryptography: Learn Public Key Infrastructure from Scratch

Cryptography: Learn Public Key Infrastructure from Scratch

Himanshu Rana
TLS Cryptography In-Depth

TLS Cryptography In-Depth

Dr. Paul Duplys, Dr. Roland Schmitz

Publisher Resources

ISBN: 9780470920411Purchase book