2 - Stream Ciphers Flashcards

1
Q

Block Cipher

A

Split plaintext into blocks of fixed length; encrypt each block with same key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Stream Cipher

A

Works on bit streams and encrypts bits as they come.

Uses less memory/resources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Stream Cipher components

A

Plaintext: m = m1 m2 m3 …
Keystream: k = k1 k2 k3 …
Ciphertext: c = m ⊕ k (bitwise xor)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Bitwise XOR

A

in1 in2 Res
o 0 0
0 1 1
1 0 1
1 1 0

in1 + in2 mod 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Plaintext 1101 0110
Keystream 0011 0101
Has cipher text:

A

1110 0011

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Ciphertext 1110 0011
Key stream 0011 0101
Plain text:

A

1101 0110

bitwise XOR works this way also!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the issue with bitwse XOR and keystreams?

A

Plaintext XOR Ciphertext = keystream

Obtaining both plaintext and ciphertext reveals the keystream

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why use Bitwise XOR

A

Easy to decrypt (simple operation)
Easy implementation
- Gates in hardware
- Also simple in software

BUT attacker can determine keystream from plain and ciphertext

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

One-time pad

A

A stream cipher in which A&B exchange over a secure channel the whole keystream k, which is truly random

A new keystream is used for each message.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

3 issues with One time pad

A

Very expensive
- Length of keystream must match length of ALL messages sent
- True random bits must be generated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

One time pad security

A

Cannot be broken, even with unlimited resources
- Known ciphertext: Exhaustive keysearch can not distinguish correct plaintext as all keystreams are equally likely (random)
- Known plaintext: Each message uses a new keystream!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Pseudo-random number generators

A

When true randomness is infeasible, use generators (at cost of losing security guarantee of one time pad)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do pseudorandom generators generally work? (Linear Congruential)

A
  1. Start with a seed
    s0 = seed
  2. Use a formula like
    s[n] = (a s[n-1] + b) mod M

NOTE: Will cycle - not entirely random. Only M possible numbers and only depends on previous number.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Should you generate a random bit sequence in binary?

A

Very insecure. USe only the least significant bit or another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Linear Congruential generator

Where is it used? Is it strong enough?

A

Commonly used for rand() function in programming.

TOO WEAK FOR cryptographic applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The same seed with the same generator = same sequence. Why not use the key as the seed?

A

Hackers observing the seed and figure out the generator

17
Q

Alice and Bob NEED a different seed for each comms section. Solution?

Hint: the key should be unchanged

A

The seed is made up of two components K and IV.

K = symmetric key, same for each session
IV = Initialisation vector: public, send unencrypted and IV is changed every time.

Concatenate the key and vector to get the seed.

18
Q

Stream ciphers in use

A
  • SNOW and ZUC 4G/5G
  • ChaCha20 in TLS1.3
  • eStream
19
Q

Uses for Pseudo-random generators

A
  1. Generate keystream
  2. Choose keys in any cryptosystem
  3. Nonces for preventing replay attacks
  4. Session IDs