0% found this document useful (0 votes)
8 views

Introduction to Stream Ciphers - Lecture Note

Uploaded by

S. Pathirathna
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Introduction to Stream Ciphers - Lecture Note

Uploaded by

S. Pathirathna
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

CBS -381 - Cyber Security management

1. Introduction to Stream Ciphers


Stream ciphers are a type of encryption that processes data one bit or one byte at a
time. Unlike block ciphers, which operate on fixed-size chunks, stream ciphers are
designed for continuous data streams, making them ideal for real-time applications.

1.1 Features of Stream Ciphers


 Bit-by-Bit Encryption: Operates on individual bits or bytes, making it faster
for small-scale or real-time data encryption.
 Pseudorandom Key Stream: Uses a key and an initialization vector (IV) to
generate a pseudorandom key stream.
 XOR Operation: Combines the plaintext with the key stream using a bitwise
XOR operation.
 Synchronization Requirement: Both sender and receiver must
synchronize on the key stream to encrypt and decrypt correctly.

1.2 Applications of Stream Ciphers


 Secure Communication: Real-time encryption in voice or video calls (e.g.,
Skype, Zoom).
 Wireless Encryption: Used in protocols like WEP and WPA for securing
wireless networks.
 IoT Devices: Low-latency encryption for resource-constrained devices in the
Internet of Things.
 Data Streaming: Secure transmission of live video feeds and telemetry
data.

1.3 Stream Ciphers vs. Block Ciphers

Feature Stream Ciphers Block Ciphers

Operatio
Encrypts data bit-by-bit. Encrypts fixed-size blocks (e.g., 128 bits).
n

Slower for small-scale data but efficient for bulk


Speed Faster for real-time data.
data.

1
Feature Stream Ciphers Block Ciphers

Key Highly vulnerable to key


Reusing keys may be less catastrophic.
Reuse reuse.

Requires padding if the block size doesn’t


Padding No need for padding.
match data size.

2. Rotor-Based Systems
Rotor-based systems are mechanical stream ciphers that originated in the early
20th century. They were used for secure military and diplomatic communications.

2.1 Working of Rotor-Based Systems


 Components:
o Rotors: Circular discs with internal wiring that define substitution
mappings.
o Reflector: Provides feedback by reversing the signal path.

o Plugboard: Introduces additional substitution for increased


complexity.
 Encryption Process:
1. A character is input and substituted based on the initial rotor position.

2. The rotor advances (rotates), changing the substitution pattern.

3. The process repeats for subsequent characters, creating dynamic


encryption.

2.2 Example: Enigma Machine


The Enigma machine is the most famous rotor-based cipher.
 Key Features:
o Used three or more rotors, each with a different wiring configuration.

o The starting position of the rotors acted as the encryption key.

o The plugboard added an additional layer of complexity.

 Strengths:
o Dynamic substitution made it difficult to detect patterns.

2
 Weaknesses:
o Limited diffusion (letters mapped to the same letters after a full cycle).

o Vulnerable to known plaintext attacks.

Impact of Enigma Cryptanalysis:


 The work of Alan Turing and others at Bletchley Park during WWII exploited
weaknesses in Enigma’s design to decrypt messages, contributing to Allied
victory.

3. Shift Register-Based Systems


Shift registers are digital circuits widely used in modern stream cipher
implementations.

3.1 Linear Feedback Shift Registers (LFSRs)


LFSRs are a sequence of flip-flops connected in series, with feedback from a linear
function, typically XOR.
Characteristics:
 Efficient hardware implementation.
 Produces periodic pseudorandom sequences.
 Period length depends on the feedback polynomial.
Operation of LFSRs:
1. The register is initialized with a seed value.
2. Feedback is calculated by XORing selected bits (defined by the feedback
polynomial).
3. The feedback value is shifted into the register, and the oldest bit is discarded.

3.2 Non-Linear Feedback Shift Registers (NLFSRs)


To overcome the predictability of LFSRs, non-linear feedback functions are
introduced.
 Advantages:
o Increased resistance to linear cryptanalysis.

 Example: Used in modern ciphers like Grain and Trivium.

3
3.3 Example: A5/1 Cipher
A5/1 is a stream cipher used in GSM mobile communications.
 Components:
o Three LFSRs with different lengths and feedback polynomials.

 Vulnerability:
o Correlation attacks exploit statistical weaknesses in key stream
generation.

4. Design Considerations for Stream Ciphers


To build a secure and efficient stream cipher, the following principles must be
adhered to:

4.1 Security Considerations:


1. Key Stream Quality:
o Pseudorandom and statistically indistinguishable from random noise.

o Should not repeat for any practical input size.

2. Key and IV Management:


o IVs must be unique to avoid key stream reuse.

o Key length should be sufficient (at least 128 bits) to prevent brute-
force attacks.
3. Resistance to Attacks:
o Must resist correlation, side-channel, and known plaintext attacks.

4.2 Performance Considerations:


 Efficiency: Must encrypt/decrypt data at high speeds.
 Resource Constraints: Low memory and processing requirements for IoT
and embedded devices.

4.3 Synchronization:
Stream ciphers require tight synchronization between the sender and receiver. Loss
of synchronization leads to decryption errors.

4
5. Cryptanalysis of Stream Ciphers
Cryptanalysis aims to identify weaknesses in encryption algorithms.

5.1 Common Attacks:


1. Correlation Attacks:
o Exploits linear relationships in LFSR-generated key streams.

o Mitigation: Use NLFSRs or combine outputs from multiple LFSRs.

2. Replay Attacks:
o Exploits key stream reuse to recover plaintext.

o Mitigation: Unique IVs and random key stream initialization.

3. Side-Channel Attacks:
o Analyze timing, power, or electromagnetic leakage to deduce keys.

o Mitigation: Masking techniques and secure hardware implementations.

5.2 Real-World Vulnerabilities:


 RC4 Weaknesses:
o Biases in the initial key stream.

o Vulnerable to known plaintext attacks.

 A5/1 Attacks:
o Time-memory tradeoff attacks revealed significant weaknesses.

6. Combined Encryption
Hybrid encryption methods combine the advantages of stream and block ciphers for
enhanced security.

6.1 Examples of Combined Systems:


 TLS Protocols:
o AES-GCM: Uses a block cipher in a mode that combines encryption and
integrity.

5
o ChaCha20-Poly1305: Combines a stream cipher with a MAC for
authenticated encryption.

6.2 Advantages:
 Flexibility to handle diverse data types.
 Enhanced security through hybrid approaches.
 Optimization for both high-throughput and low-latency requirements.

7. Practical Examples

7.1 XOR Encryption Example:


 Plaintext: HELLO
 Key Stream: 110010101001
 XOR Operation: Produces ciphertext.

8. Conclusion
Stream ciphers are essential for scenarios requiring fast and low-latency encryption.
Understanding their design, vulnerabilities, and real-world applications is critical for
implementing secure systems.

You might also like