Chapter6Notes

Chapter6Notes - Chapter 6 Notes Common functions with bits...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 6 Notes Common functions with bits Here is the truth table for XOR: A B B A 0 0 0 0 1 1 1 0 1 1 1 0 One nice thing about XOR is that it is its own inverse. Also, for a block of bits, two typical operations are left and right shifts. Each shift can either be a regular shift or a cyclical shift. In a right shift, all the bits move right. Here is an example: 00101101 shifted to the right by 2 bits becomes 00001011 00101101 with a cyclical shift to the right of 2 bits becomes 01001011 The key difference with a cyclical shift is that when you "move" a bit off to the right it then goes to the leftmost location. A left shift works similarly: 01101101 shifted to the left by 2 bits becomes 10110100 01101101 with a cyclical shift to the left of 2 bits becomes 10110101 Numerically, a right shift divides by 2 and a left shift multiplies by 2. Stream Cipher A stream cipher requires a random "stream" of bits to use as a key, which we can then XOR with the plaintext. One reason this is desirable is that XOR is efficiently implemented in hardware. In general, we will have a key which will "start of" the random bit stream and then use it in a manner similar to the autokey cipher, where a function of the key and other information will produce the future bits. There are two types of key generators: 1) synchronous - independent of the plaintext stream. If a ciphertext character is lost in transmission, the ciphertext and keystream will be misaligned and they will have to be realigned to recover the plaintext
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2) self-synchronous - keystream produces the keystream from knowledge of the previous ciphertext characters. If there is an error in transmission, the keystream will correct itself after n correct ciphertext characters. Linear Feedback Shift Registers A shift register constantly performs right-shifts, but replaces the most-significant bit with the new bit in the stream. For example if at one point in time a shift register contained 01101011 then after performing a shift, if the new bit into the stream was 1, it would contain 10110101. This in and of itself can not create a stream of bits that seem random. We need some way of calculating the bit that gets shifted in! In a LFSR register, the method of doing this is calculating the XOR of some specified subset of bits. Let the contents of the register be denoted b 8 b 7 b 6 b 5 b 4 b 3 b 2 b 1 . For this example, define the function to determine the new bit as follows: f(b 8 b 7 b 6 b 5 b 4 b 3 b 2 b 1 ) = 6 4 1 b b b . Here is an example of this LFSR: Time Contents 0 011 01 101 1 101 10 110 2 110 11 011 3 011 01 101 4 10110110, etc. One can run an LFSR indefinitely, given a set of initial contents and a function to use to calculate the next bit. Obviously any LFSR will start repeating after a certain period of time. Since we know with n bits, there are 2 n configurations of those n bits, it stands to reason that the period of any LFSR of n bits is no more than 2 n . It turns out that the real maximum is 2 n - 1, since you never want a stream with all 0s. Can you figure out why?
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

Chapter6Notes - Chapter 6 Notes Common functions with bits...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online