# applied cryptography

**Learning Goal: **I’m working on a cryptography question and need an explanation and answer to help me learn.

**QUESTION** 1:

1. Show that for all possible binary bit values of M_{i} and S_{i},_{ }M_{i} + S_{i} mod 2 = M_{i} XOR S_{i}

2. Given a 3 bit key K=101 and a 3 bit initial seed S=001, encrypt M=11001010. Consider LFSR based stream cipher and show your work.

3. Write one paragrapg note on RC4 (use web resources)

———————————————————————————————————————————————-

QUESTION 2:

1.A stream cipher uses a LFSR with three units. An attacker captures a ciphertext “0101001010011”. The attacker knows that the first 6 bits of the message are “110001.” Using this information, the attacker defeats this encryption, i.e., he is able to determine the initial seed values (S_{1}, S_{2} and S_{3}) and Keys (K_{1}, K_{2} and K_{3}). What are those values? (Points 25)

**Calculation Hints**:

Remember:

S _{1 }through S _{6 }can be computed by XORing 6 bit message with the first 6 bits of ciphertext.Then formulate the following equations for S _{4 }through S _{6 :}

S _{m+1}= S _{m} ^{×} K _{m }+ S _{m-1} ^{×} K _{m-1} + …… S _{2} ^{×} K _{2 }+ S _{1} ^{×} K _{1 }mod 2

S _{m+2}= S _{m+1} ^{×} K _{m }+ S _{m} ^{×} K _{m-1} + …… S _{3} ^{×} K _{2 }+ S _{2} ^{×} K _{1 }mod 2

S _{m+3}= S _{m+2} ^{×} K _{m }+ S _{m+1} ^{×} K _{m-1} + …… S _{4} ^{×} K _{2 }+ S _{3} ^{×} K _{1 }mod 2

Number of units in the shift register determines the value of m.

Many of you may not feel comfortable solving systems of equation. You can apply the following brute force method:

Check, all possible sets of values of K _{1}, K _{2} and K _{3 }listed in the following table to find out which set satisfies all the above equations (i.e., makes both sides of the equations equal) :

K_{1} |
K_{2} |
K_{3} |

0 | 0 | 0 |

0 | 0 | 1 |

0 | 1 | 0 |

0 | 1 | 1 |

1 | 0 | 0 |

1 | 0 | 1 |

1 | 1 | 0 |

1 | 1 | 1 |

2.An organization uses same stream cipher key multiple times. An attacker who knows that, captures two ciphertexts C1 and C2 and finds that,

C1⊕C2= 0000101000011101000000110001001100010000000101000000011000000011000010100000100100011011

The attacker also knows that the plaintexts are composed of only English capital letters without any punctuations or space, and that part of the plaintexts contains the word: “PRESIDENT”. He was able to recover both the plaintexts. Show, how. (Points 25)

**Hints**: Slide ASCII for “PRESIDENT” over C1⊕C2 and XOR them. You can start from the left and keep sliding right, or start from the right and keep sliding left until you find a meaningful 9 letter phrase (since PRESIDENT is a 9 letter word). Once you retrieve the partial plaintexts, use your intuition and linguistic observations to complete the rest as much as possible.