Lecture 9: Pseudorandom Numbers and Stream Ciphers (random numbers, DRBG, stream ciphers, OTP, visual cryptography, A5 cipher, RC4 cipher, ChaCha) Flashcards

1
Q

What is a deterministic algorithm?

A

an algorithm that, given a particular input, will always produce the same output, with the underlying machine always passing through the same sequence of states

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

What are stream ciphers constructed from?

A

(pseudo)random number

generators

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

What are examples of stream ciphers widely deployed?

A

1) A5 cipher used in GSM mobile phones

2) AES in counter (CTR) mode

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

What is the goal of randomness?

A

any specific string of bits is exactly as

random as any other string

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

What are the two types of generators of random strings?

A

1) True random number generator (TRNG)

2) Pseudorandom number generator (PRNG)

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

What is a true random number generator (TRNG)?

A

a physical
process which outputs each valid string independently with
equal probability

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

What is a pseudorandom number generator (PRNG)

A

deterministic algorithm which approximates a TRNG

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

What provides a seed for a PRNG?

A

using a TRNG

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

What is NIST Special Publication 800-90B (Jan. 2016)?

A

Framework for design and validation of TRNG algorithms, called entropy sources

Specification of statistical tests for validating the suitability
of entropy sources

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

What is an entropy source?

A

basis for the non-deterministic operation of the randomizer

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

What does an entropy source include?

A

1) A physical noise source
2) A digitization process
3) Post-processing stages

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

What is the output of an entropy source?

A

any requested number

of bits

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

What is a periodic health test used for i.t.o TRNG?

A

ensure continuing reliable operation of TRNG

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

When did Intel introduced TRNG into Ivy Bridge processors?

A

2012

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

What is NIST Special Publication 800-90A (June 2015)?

A

Recommendation of specific PRNG algorithms, named

deterministic random bit generator (DRBG)

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

What does DRBG stand for?

A

deterministic random bit generator

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

What is DRBG based on?

A

hash functions, a specific MAC (known

as HMAC) and block ciphers in counter mode

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

What does each PRBG generator takes as an input?

A

a seed

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

What does each PRBG output? What is this before?

A

a bit string before updating its state

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

How often should the seed for a PNGR be updated?

A

after some number of calls

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

What can the seed for a PRNG be obtained from?

A

a TRNG

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

List the functions of DRBG

A

1) instantiate
2) generate
3) reseed
4) test
5) uninstantiate

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

Outline the instantiate function of DRBG

A

setting the initial state of the DRBG using a

seed

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

Outline the generate function of DRBG

A

providing an output bit string for each request

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

Outline the reseed function of DRBG

A

inputting a new random seed and updating the

state

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

Outline the test function of DRBG

A

checking correct operation of the other functions

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

Outline the uninstantiate function of DRBG

A

deleting (zeroising) the state of the DRBG

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

What is backtracking resistance i.t.o DRBG?

A

an attacker who obtains the
current state of the DRBG should not be able to distinguish
between the output of earlier calls to the function Generate
and random strings

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

What is forward prediction resistance i.t.o DRBG?

A

an attacker who obtains the current state of the DRBG should not be able to distinguish between the output of later calls to the function Generate
and random strings

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

What mode does CTR_DRBG uses and what is the recommended block cipher and key size?

A

counter (CTR) mode

AES with 128-bit keys

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

For CTR_DRBG, what initialises the seed and what is the seed’s length?

A

DRBG initialised with a seed

length is equal to the
key length PLUS the block length
–> 128 + 128 = 256 for AES with 128-bit master keys

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

What does the seed define in CTR_DRBG?

Is there a separate nonce?

A

Seed defines a key K and a counter value ctr

No separate nonce as in a normal CTR mode

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

How is the CTR mode encryption run in CTR_DRBG?

A

iteratively, with no plaintext

added

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

What forms the CTR_DRBG output?

A

CTR output blocks

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

How many bits does the update function of DRBG generate per request i.t.o CTR_DRBG?

A

up to 2^19 bits

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

From the generate function in CTR_DRBG, whose state must be updated, when and how?

A

(K, ctr)’s state must be updated after each request by generating 2 blocks using the current key to obtain the new key and a counter

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

What does the update function provide?

A

backtracking resistance

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

What is the restriction on the number of requests to the generate function for CTR_DRBG before require reseeding?

A

up to 2^48

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

What does each re-seed provided i.t.o CTR_DRBG?

A

forward prediction and backtracking resistance

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

What is Dual_EC_DRBG based on?

A

elliptic curve discrete logarithm problem

BUT:
no security proof exists
many flaws

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

Comment on the speed of Dual_EC_DRBG compared with other DRBGs in the standard

A

much slower

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

What are stream ciphers characterised by?

A

the generation of a keystream using a

short key and an initialisation value IV

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

What is each element of the keystream in a stream cipher used for?

A

used successively to

encrypt 1 or more ciphertext characters

44
Q

What type of cipher are stream ciphers usually? What does this mean?

A

symmetric key ciphers

1) sender and receiver share the same key
2) can generate the same keystream given the same IV

45
Q

I.t.o synchronous stream ciphers, is the keystream generated independently of the plaintext?

A

yes

46
Q

I.t.o synchronous stream ciphers, what do both the sender and receiver need to generate?

A

same keystream and synchronise on its usage

47
Q

What is cipher is the Vigenère cipher seen as?

A

a (periodic) synchronous stream cipher where each shift is defined by a key letter

48
Q

What is one mode of operation for a block cipher to generate a keystream?

A

CTR mode

49
Q

Explain the encryption and decryption diagrams for synchronous stream ciphers on slide 15 of set 9

A

TODO

50
Q

What are the components of binary synchronous stream ciphers?

A

For each time interval t:

Binary sequence s(t), that is the keystream

Binary plaintext p(t)

Binary ciphertext c(t)

51
Q

Given the encryption function for binary synchronous stream ciphers

A

c(t) = p(t) ⊕ s(t)

52
Q

Given the decryption function for binary synchronous stream ciphers

A

p(t) = c(t) ⊕ s(t)

53
Q

What is the one time pad often attributed to?

A

Vernam who made a one-time pad machine using teletype machinery in 1917 (earlier historical uses are known)

54
Q

Comment on the key of a one time pad

A

a random sequence of characters s.t. all of them are

independently generated

55
Q

How many times can each character in the key of a one time pad be used?

A

ONE TIME ONLY

56
Q

Comment on the alphabet of a one time pad

A

Alphabet of any length but usually:

1) A natural language alphabet
2) The binary alphabet {0, 1}

57
Q

What is a (non-periodic) binary synchronous stream

cipher an example of?

A

one time pad

58
Q

What does one time pad provide i.t.o secrecy?

A

perfect secrecy

59
Q

I.t.o Shannon’s definition of perfect secrecy, how is the message set defined?

A

{M1, · · · , Mk}

60
Q

I.t.o Shannon’s definition of perfect secrecy, how is the ciphertext set defined?

A

{C1, · · · , Cl}

61
Q

I.t.o Shannon’s definition of perfect secrecy, what is Pr(Mi|Cj) ?

A

the probability that Mi
is encrypted given that
Cj is observed

62
Q

I.t.o Shannon’s definition of perfect secrecy, comment on the messages Mi being equally likely

A

In most cases, the messages Mi are NOT be equally likely

63
Q

I.t.o Shannon’s definition of perfect secrecy, for all messages Mi and ciphertexts Ci, what is Pr(Mi
|Cj) equivalent to?

A

Pr(Mi|Cj) = Pr(Mi)

64
Q

What are the components involved when the one time pad uses the Roman alphabet

A

Plaintext characters: p1, · · · , pr

Ciphertext characters: c1, · · · , cr

Keystream: random characters k1, · · · , kr

65
Q

What is the encryption formula for the one time pad using the Roman alphabet?

A

ci = (pi + ki) mod 26

Ciphertext is the addition of plaintext and keystream
characters, modulo 26

66
Q

What is the decryption formula for the one time pad using the Roman alphabet?

A

pi = (ci − ki) mod 26

67
Q

Explain one time pad’s perfect secrecy and the conditional probability of Pr(Mi|Cj) = Pr(Mi)

A

Let a ciphertext Cj be observed

Any message could have been sent, depending on the
keystream

The probability that Mi
is sent given that Cj
is observed =
the probability that Mi
is chosen, weighted by the
probability that the right keystream is chosen

Each key is chosen with equal probability

Conditional probability is thus Pr(Mi|Cj) = Pr(Mi)

68
Q

What are the components of the vernam binary one time pad?

A

Plaintext: binary sequence b1, · · · , br

Ciphertext: binary sequence c1, · · · , cr

Keystream: random binary sequence k1, · · · , kr

69
Q

Comment on the encryption and decryption for the vernam binary one time pad

A

Encryption: ci ≡ pi ⊕ ki

Decryption: pi ≡ ci ⊕ ki

I Encryption and decryption are identical processes.

70
Q

Comment on the length of the keystream of the vernam binary one time pad

A

Keystream is SAME length as plaintext

71
Q

Does the vernam binary one time pad provide perfect secrecy? Why?

A

yes, since any ciphertext is equally possible given the plaintext

72
Q

How many keys MUST any cipher with perfect secrecy have?

A

as many keys as there are messages

73
Q

What cipher is the ONLY unbreakable cipher?

A

One time pad

74
Q

Under what conditions is the usage of the one time pad practical ?

A

for pre-assigned communications between fixed parties

75
Q

What is a problem with the one time pad?

A

how to deal with key management of completely random keys

–> Key generation, key transportation, key synchronization,
key destruction are ALL problematic since the keys are SO
large

76
Q

What is visual cryptography an application of?

A

one time pad

77
Q

What does visual cryptography involve?

A

splits an

image into 2 shares

78
Q

How does decryption work for visual cryptography?

A

overlaying the 2 shared images

79
Q

When and who proposed visual cryptography?

A

Naor and Shamir in 1994

80
Q

Give a simple case of visual cryptography

A

monochrome images with black and white pixels

Each pixel is shared in a random way, similar to splitting a
bit in the one time pad

81
Q

Does each share of the image reveal any info i.t.o visual cryptography?

A

Each share reveals NO information about the image

–> Unconditional security as one time pad

82
Q

Explain the encryption process for visual cryptography

see diagram on slide 27 of set 9

A

1) Generate a one time pad P (random bit string) with length equal to the number
of pixels for the image I

2) Generate a share SI,1 by replacing each bit in P using the sub-pixel patterns shown on the left
3) Generate the other share SI,2 s.t.:

the same as SI,1 for all the white pixels of I
&
the opposite of SI,1 for all black pixels
of I

83
Q

Explain the decryption process for visual cryptography

see diagram on slide 27 of set 10

A

1) To reveal the hidden image I, SI,1 and SI,2 are overlayed
2) Each black pixel of I is black in the overlay
3) Each white pixel of I is half white in the overlay

84
Q

What type of cipher is the A5 cipher and where is it applied?

A

Binary synchronous stream cipher applied in most GSM

mobile telephones

85
Q

What are the 3 variants of the A5 cipher?

A

A5/1
A5/2
A5/3

86
Q

What is A5/1?

A

original A5 algorithm defined in 1987

87
Q

What is A5/2? Where was it intended to be deployed? Is it still allowed?

A

a weakened version of A5/1, originally intended for
deployment outside Europe, but no longer allowed under
GSM standards

88
Q

What is A5/3?

A

also known as KASUMI, is an algorithm for

deployment in 3G mobile systems

89
Q

When did the A5 cipher’s design become public?

A

1994

90
Q

What does A5/1 algorithm use?

A

3 linear feedback shift registers (LFSRs) whose output is combined

91
Q

How are the 3 LFSRs for the A5/1 algorithm clocked?

A

irregularly clocked

92
Q

Because the 3 LFSRs are irregularly clocked for A5/1, what does this mean the output is?

A

The overall output is non-linear

93
Q

Because the 3 LFSRs are irregularly clocked for A5/1, what is the size of the keystream and how many bits are fixed at zero?

A

64-bit keystream s.t. 10 bits fixed at zero

94
Q

Because the 3 LFSRs are irregularly clocked for A5/1, what does this mean the effective key length must be?

A

The effective key length is thus 54 bits

95
Q

Outline the history of the RC4 cipher

A

World-based stream cipher designed by Ron Rivest in the 80s: “Ron’s code #4”

Simple, efficient for software implementation

Originally proprietary owned by RSA Security, but leaked in
1994

Widely deployed in TLS before 2013

96
Q

What are practical attacks on the RC4 cipher?

A

When used in TLS protocol and in wireless WPA-TKIP due to bias in its keystream output

97
Q

Can CR4 be used in new systems?

A

no, too weak

98
Q

What is the ChaCha algorithm available in and what does it replace?

A

Available in TLS ciphersuites (RFC 7905) as a possible

replacement for RC4

99
Q

Who designed the ChaCha algorithm?

A

D. J. Bernstein in 2008

100
Q

Compare the speed of the ChaCha algorithm to AES

A

Faster than AES

–> As little as 4 cycles per byte on x86 processors

101
Q

What does the ChaCha algorithm combine to produce 512 bits of keystream?

What is an example of this?

A

Combining XOR, addition modulo 232 and rotation
operations over 20 rounds

add-rotate-xor (ARX) cipher

102
Q

What key size does the ChaCha algorithm use?

A

256-bit key

103
Q

What is TRNG constructed from and what is it used as?

A

constructed from physical devices, used as seeds

for PRNG

104
Q

What is PRNG constructed from?

A

other primitives including block ciphers

105
Q

What is TRNG used to make?

A

unbreakable encryption via one time pad

106
Q

What is PRNG used as?

A

practical synchronous stream cipher