Chapter3 Stream Ciphers
Chapter3 Stream Ciphers
1/27
Content of this Chapter
2/27
Content of this Chapter
3/27
Stream Ciphers in the Field of Cryptology
Cryptology
Cryptography Cryptanalysis
4/27
Stream Cipher vs. Block Cipher
• Stream Ciphers
• Encrypt bits individually
• Usually small and fast common in embedded
devices
• Block Ciphers:
• Always encrypt a full block (several bits)
• Are common for Internet applications
5/27
Encryption and Decryption with Stream Ciphers
6/27
Why is Modulo 2 Addition a Good Encryption Function?
• For perfectly random key stream si , each ciphertext output bit has a
50% chance to be 0 or 1
Good statistic property for ciphertext
7/27
Why are encryption and decryption the same operations ?
8/27
Synchronous vs. Asynchronous Stream Cipher
10/27
Random number generators (RNGs)
RNG
11/27
True Random Number Generators (TRNGs)
• Based on physical random processes: coin flipping, dice rolling,
semiconductor noise, radioactive decay, mouse movement, clock jitter
of digital circuits
• Output stream si should have good statistical properties:
Pr(si = 0) = Pr(si = 1) = 50% (often achieved by post-processing)
• Output can neither be predicted nor be reproduced
12/27
Pseudorandom Number Generator (PRNG)
s0 seed
si1 f (si , si1,..., si t )
s0 12345
s 1103515245s 12345mod 231
i1 i
S0 seed
Si 1 ASi B mod m
Assume
16/27
One-Time Pad (OTP)
One-Time Pad
• A cryptosystem developed by Mauborgne that is based on Vernam’s stream
cipher:
• Properties:
Let the plaintext, ciphertext and key consist of individual bits
xi, yi, ki {0,1}.
OTP is unconditionally secure if and only if the key ki. is used once!
17/27
One-Time Pad (OTP)
18/27
Content of this Chapter
19/27
Linear Feedback Shift Registers (LFSRs)
• Concatenated flip-flops (FF), i.e., a shift register together with a feedback path
• Feedback computes fresh input by XOR of certain state bits
• Degree m given by number of storage elements
• If pi = 1, the feedback connection is present (“closed switch), otherwise there is
not feedback from this flip-flop (“open switch”)
• Output sequence repeats periodically
• Maximum output length: 2m-1
20/27
Linear Feedback Shift Registers (LFSRs): Example with m=3
23/
27
Representing LFSR as Ploynomials
LFSRs typically described by polynomials:
P(x) x m p xm1 ... p x p
l 1 1 0
24/27
Content of this Chapter
25/27
A Modern Stream Cipher - Trivium
Initialization:
• Load 80-bit IV into A
• Load 80-bit key into B
• Set c109 , c110 , c111 =1, all other bits 0
Warm-Up:
• Clock cipher 4 x 288 = 1152 times without generating output
Encryption:
• XOR-Sum of all three NLFSR outputs generates key stream si
27/27
Lessons Learned
• Stream ciphers are less popular than block ciphers in most domains such as Internet
security. There are exceptions, for instance, the popular stream cipher RC4.
• Stream ciphers sometimes require fewer resources, e.g., code size or chip area, for
implementation than block ciphers, and they are attractive for use in constrained
environments such as cell phones.
• The requirements for a cryptographically secure pseudorandom number generator are far
more demanding than the requirements for pseudorandom number generators used in other
applications such as testing or simulation
• The One-Time Pad is a provable secure symmetric cipher. However, it is highly impractical
for most applications because the key length has to equal the message length.
• Single LFSRs make poor stream ciphers despite their good statistical properties.
However, careful combinations of several LFSR can yield strong ciphers.
28/27