9

Cryptography

Cryptographic systems are typically categorized into two classes – symmetric and asymmetric – based on the number of keys used in the system. In symmetric cryptography there is a single key known to both sender and receiver, and the same key is used both for encrypting and decrypting a message. In asymmetric systems, separate keys are applied for encryption and decryption.

Cryptographic systems can also be classified as block or stream ciphers according to the way that they treat the input. In block ciphers one block of elements is processed at a time. For example, the first 64 characters in plain text are processed together, then the second 64 characters and so on. In stream ciphers, each element, e.g. each character, is processed separately as it arrives.

In this chapter, we discuss the fundamentals of cryptography, i.e. symmetric, asymmetric, block and stream as well as hash functions and the use of hash chains and hash trees in providing authentication services.

9.1 Symmetric Encryption

Symmetric (private/secret/single) key cryptography uses one key which is shared by both sender and receiver (Figure 9.1). It is the oldest available technique and was the only one available before the publication of public key cryptography in 1976.

Substitution and transposition (permutation) are the two primitives used in symmetric encryption. Substitution ciphers can be grouped into two classes: monoalphabetic and polyalphabetic.

A monoalphabetic substitution cipher maps a plain ...

Get Security in Wireless Ad Hoc and Sensor Networks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.