Slashdot Mirror


Practical Cryptography

jpetts writes "If you have an interest in cryptography and spend even a small amount of time looking at the subject on the Internet, you will almost certainly have come across the name Bruce Schneier. His book, Applied Cryptography is widely regarded as the most accessible, and one of the most important books on cryptographic algorithms ever published. Schneier has also published other books, including the less technical Secrets and Lies, an thought-provoking book aimed at getting people to think about the whole of the security landscape, not just cryptography. Now, together with Niels Ferguson, renowned cryptographic expert, and longtime collaborator, another immensely valuable book on security has just appeared." Read on for the rest of jpetts' review. Practical Cryptography author Neils Ferguson and Bruce Schneier pages xx + 410 publisher Wiley rating 10/10 reviewer James Petts ISBN 0471223573 summary Pure Hands-On Cryptographic Gold; invaluable guide for cryptographers.

Schneier is one of the world's foremost experts, not just on cryptography, but also on security. It was as he delved deeper into the security of cryptographic systems that he realised that even though - theoretically at least - cryptography could be made arbitrarily secure, this was one of the more tractable problems in the security puzzle. For this reason, his company, Counterpane repositioned itself as a managed security company, rather than continuing to focus solely on cryptography. This transition was also reflected in his publication of Secrets and Lies (SL), which is very different in tone and focus from Applied Cryptography (AC). So where does Practical Cryptography (PC) fit in, and what does it offer? For me, the answer is that it lies pretty much squarely in the middle of the line reaching from AC to SL.

There is no shortage of products in the cryptography arena, but the vast majority of these attract undisguised scorn from professional cryptographers (at least those who can be bothered to comment on them), and although I am only an amateur in this field, I take it as axiomatic that only peer-reviewed cryptosystems (algorithms, protocols, etc) which have stood the test of time are worth taking even a preliminary peek at. This includes many that are described in AC. However, One of the problems with AC, openly acknowledged by the author, is that it contains essentially no implementation details. Furthermore, the cryptographic field has moved on since its publication, most notably with the adoption of Rijndael as the Advanced Encryption Standard, now a mandated Federal Information Processing Standard.

The source code to AC has been available from pretty much the moment of the book's publication, but one of the problems which faced a would-be cryptographic coder, is how to produce a working cryptographic product based on the routines that one could lay one's hands on. Merely incorporating the source code in a program does not a cryptosystem make: as Schneier points out cryptography is hard. And this is where this new book is invaluable: it tells you in great detail how hard it is, what the hardest parts are, and how you can maximise the return on the effort you may invest in developing cryptographic software.

The book pulls no punches, and does not gloss over any issues relating to implementing cryptographic systems. It deals with all the major components of a practical cryptosystem: the book's major sections are titled Message Security, Key Negotiation, Key Management and Miscellaneous.

Within each of these sections there are several chapters, covering virtually all the salient points imaginable, right down to the fundamentals. For example, the first chapter of the Key Management section deals with the clock. It explains from first principles the need for a clock: "At first glance, [a clock] is a decidedly un-cryptographic primitive, but because the current time is often used in cryptographic systems, we need a reliable clock." It is this sort of attention to particular implementation details that turns PC from a mere recipe book into an invaluable reference and a true cookbook.

Another invaluable feature is the generous use of pseudocode snippets, not only for algorithmic details, such as MACs and block cyphers, but also for higher-level operations like sending and receiving messages.

Ferguson and Schneier are refreshingly frank, too. Where they believe strongly in something, they let you know it. For example, the first paragraph of chapter 23, Standards, contains the statement that "[s]ecurity standards rarely work," while the authors go even further when dealing with X.509 certificates, stating on p.339, "[w]hatever you do, stay away from X.509 certificates. If you need a reason, read [40] and weep". This candour is refreshing, especially when juxtaposed with the weasel words that so many consultants and software vendors seem to rely on. However, this advice is not just given in curmudgeonly fashion, and when the authors discuss the matter of X.509 in a different context, they add, humorously, "[i]f you must use X.509, you have out condolences."

I am tempted to continue to analyse the book at great length, but to save space I will just highlight some further jewels from this work:

  • Implementation issues such as swap files, language-specific memory handling behaviour, caches, etc. are covered in enough detail for you to understand how to do things, and more importantly, how not to do things.
  • Randomness, pseudo-randomness and entropy are covered in enough depth for an implementor to avoid pitfalls, and pseudocode examples are given.
  • Mathematical topics such as prime numbers, groups and large integer arithmetic are described in excellent detail.
  • PKI, its promise, and failure are covered with wit and wisdom.
As you can probably guess from the above description, I believe that the real value of this book lies in the fact that two renowned experts, in both theory and practice, are sharing what works, and more importantly what you should avoid like the plague when working with cryptosystems. This information has until now generally only been available by listening to people like Schneier and Ferguson talk, either one-to-one or at conferences. Even then, the authors point out that even talking to "experts" is not without danger: chapter 25 begins "There is something strange about cryptography: everybody thinks they know enough about it to design and build their own system. We never ask a second-year physics student to design a nuclear power plant. We wouldn't let a trainee nurse who claims to have found a revolutionary method for heart surgery operate on us. Yet people who have read a book or two think they can design their own cryptographic system. Worse still, they are sometimes able to convince management, venture capitalists, and even some customers that their design is the neatest thing since sliced bread." Given this statement, some people might claim that this book is a little hubristic, but I disagree. Paranoia, self evaluation and a healthy scepticism are pre-requisites for assessing, deploying and implementing cryptosystems, but since a sine qua non of reliable crypto is open examination and peer evaluation, I believe that the authors are here simply offering advice, which once you understand more about the issues surrounding crypto, is merely common sense. Schneier and Ferguson have both "earned their bones" in the glaring light of crypto, and this book admirably fills an obvious gap in the literature of the field. There is not, to my knowledge, another book like it on the subject, and had it been published at around the same time as AC, I am sure that it would have been regarded by the NSA as even more dangerous than that book. After all, it is frighteningly easy for the uninformed to take good cryptographic algorithms and protocols, and through ignorance turn them into worse-than-useless crypto products.

Is there anything I didn't like about the book? Frankly, no. Some might complain that it is priced too high (it lists at USD50 for the softcover, and USD70 for the hardcover), but it is printed on acid-free paper, and the density of useful advice is such that it outstrips in value many works which cost half the price or less.

If you are interested in crypto, do yourself a favour: buy this book.

You can purchase Practical Cryptography from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

9 of 140 comments (clear)

  1. Practical vs Applied by Blaine+Hilton · · Score: 4, Interesting
    I'm glad to see a book on practical cryptography. I like reading about the theory behind how things work, but on the job when I'm working on websites and such I need a reliable way to protect sensitive information and not a bunch of words from theorists.

    Hopefully this helps the good guys more then the bad ones though...

    Go calculate something.

    1. Re:Practical vs Applied by Crispy+Critters · · Score: 2, Interesting
      I'm sorry, but it is attitudes (and books) like these that give rise to the woeful state of affairs that have existed in "practical cryptography" over the years. Schneier's book, while certainly well-meaning, has promoted the idea that you don't need to understand formal notions of security to be a serious cryptographer. It is hard to overestimate the damage that this idea (and this) book have caused.
      I find it astonishing that a book that has only been out a few weeks has caused much damage.

      Unless you are thinking of Schneier's first book on cryptography. If you knew what you were talking about, you would know that he wrote Secrets and Lies mainly to explain that crytpographic protocols by themselves don't solve the whole problem. He thought his first book might leave that impression, and he wanted to correct it.

      It sounds like you are arguing that this information must be locked up because it is dangerous, and the "serious cryptographer[s]" will then decide who gets access to it and who doesn't. This is disgusting elitism.

      Sure, lots of people pass themselves off as experts based on reading a book. The problem is these people and the people who believe them, not the book. Some programmers write buggy code in operating systems. Does this mean that no one should write a book about operating systems to protect us from people who read the book and then write buggy code? Any competent person with training or education knows where the limits to his knowledge are. Anyone who doesn't know this is incompetent, and that can't be blaimed on a book.

  2. Applied Cryptography by msheppard · · Score: 4, Interesting

    I've always liked the tagline on the back of the Applied Cryptography book:
    "The Book the National Security Agency wanted never to be published..."

    M@

    --
    Krispy Cream is people
  3. Older stuff is a must read... by (H)elix1 · · Score: 4, Interesting

    Applied Cryptography is a must read. Few books invoke the proper fear and respect cryptology deserves, with example after example of why your l33t encryption should not be used for anything more valuable than your Slashdot UID. Great examples, solid code, lots of history... If this is even half the book Applied Cryptography was, get your checkbook ready.

    1. Re:Older stuff is a must read... by fermion · · Score: 4, Interesting
      Let me add that though Applied Cryptography is a dauntingly dense book, one can get great benefit from the first hundred pages. The first section of the book develops background material and basic understanding of the issues. To use the authors' physics example, reading a first semester physics book will not teach you physics, but it will teach enough of the science to defend yourself against those who would abuse it.

      As the reviewers states, the algorithms have changed over the past several years, but it may be more important to remember that the basic issues have not. People are still trying to pass off obviously flawed protocols as good security measures.

      --
      "She's a scientist and a lesbian. She's not going to let it slide." Orphan Black
  4. Re:good companion to ac by Parsa · · Score: 3, Interesting

    Good try. I just looked this book up on Amazon.com and this is the only review of the book posted. Great cut and past job.

    --
    Abiit, excessit, evasit, erupit.
  5. Since everyone is posting their favorite books... by c64cryptoboy · · Score: 4, Interesting

    Check out reviews of LOTS of cryptography books here -- most with an associated set of prerequisite book reading, math, and computer language skills.

    --
    I put the 'fun' in fundamentalism
  6. another book on cryptology by roalt · · Score: 3, Interesting
    One of the best (and accessible) books I've read about cryptology (from hieroglyphs to quantum computing) is The Code Book by Simon Singh

    It's fun reading!

  7. Re:My new fangled encryption scheme by barfy · · Score: 2, Interesting

    With at least your sample key, it is very easy to brute force this, I only have to try slightly over 1 million keys.

    There are two problems with this, first is the relatively small number of Irrational numbers that are likely to be used (unless there is a large and easy to mine font of these I am not aware of).

    The source of security of most encryption systems is that the "random streams" created by the initial key are extraordinarially large.

    Changing the starting point in 1 given or even a handful of given streams, leaves you open to a simple sliding window against a previously stored length of strings.

    It would become every more problematic the bigger the number Z (yours example would be trivially easy).

    With a LARGE z it would take your encryption program a long time to get there (Except for PI), and the decryptor would also have a long time to get to the starting position.

    Most professional decryptors are going to have most of the stream prestored, unless z is REALLY BIG).

    I suspect that you can use really large Z numbers with t = PI and it would take a long time to brute force your answer. (This would be from the algorithm that lets you calculate any given position of PI).