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

Foundations of Cryptography (CYS 602) : Lecture #2 Stream Ciphers

This document discusses stream ciphers and block ciphers. Stream ciphers encrypt bits individually by combining the plaintext bit with a key stream bit, while block ciphers encrypt fixed-length blocks of plaintext. The One-Time Pad is unconditionally secure but impractical due to its large key size requirement. Modern block ciphers like AES are efficient alternatives. Stream ciphers are sometimes used in applications with limited resources due to their smaller size compared to block ciphers.

Uploaded by

Wafaa Alshaikhi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Foundations of Cryptography (CYS 602) : Lecture #2 Stream Ciphers

This document discusses stream ciphers and block ciphers. Stream ciphers encrypt bits individually by combining the plaintext bit with a key stream bit, while block ciphers encrypt fixed-length blocks of plaintext. The One-Time Pad is unconditionally secure but impractical due to its large key size requirement. Modern block ciphers like AES are efficient alternatives. Stream ciphers are sometimes used in applications with limited resources due to their smaller size compared to block ciphers.

Uploaded by

Wafaa Alshaikhi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

FOUNDATIONS OF

CRYPTOGRAPHY
(CYS 602)
LECTURE #2 STREAM CIPHERS
STREAM CIPHERS AND BLOCK CIPHERS

• Symmetric cryptography is split into block ciphers and stream ciphers.

Fig2.1 Stream Ciphers Fig2.2 Block Ciphers


STREAM CIPHERS

• Stream ciphers encrypt bits individually.


• This is achieved by adding a bit from a key stream to a plaintext bit.
• There are synchronous stream ciphers where the key stream depends only on the key, and
asynchronous ones where the key stream also depends on the ciphertext.
BLOCK CIPHERS

• Block ciphers encrypt an entire block of plaintext bits at a time with the same key.
• The encryption of any plaintext bit in a given block depends on every other plaintext bit
in the same block.
• Some block ciphers have a block length of 128 bits (16 bytes) such as the advanced
encryption standard (AES).
• Other block ciphers have a block length of 64 bits (8 bytes) such as the data encryption
standard (DES) or triple DES (3DES) algorithm.
STREAM CIPHERS VS. BLOCK CIPHERS

• for encrypting computer communication on the Internet, block ciphers are used more often than stream ciphers,
except for the stream cipher RC4 .
• stream ciphers are small and fast, therefore they are used for applications with little computational resources.
• It was assumed that stream ciphers encrypt more efficiently than block ciphers.
 they need fewer processor instructions (or processor cycles)
 they need fewer gates (or smaller chip area)

• However, modern block ciphers such as AES are also very efficient in
• software.
• Moreover, for hardware, there are also highly efficient block ciphers, such as PRESENT, which are as efficient as
very compact stream ciphers.
ENCRYPTION AND DECRYPTION WITH STREAM
CIPHERS
• For example if each bit xi is encrypted by adding a secret key stream bit si modulo 2.

• Encryption: yi = esi (xi) ≡ xi+si mod 2.

• Decryption: xi = dsi (yi) ≡ yi+si mod 2.

• Encryption and decryption functions are both simple additions modulo 2.


WHY IS MODULO 2 ADDITION A GOOD
ENCRYPTION FUNCTION?
• Modulo 2, has only two possible values 0 and 1.
• Modulo 2 addition is equivalent to the XOR operation.
• The XOR operation is useful, as opposed to the AND or NAND gate operations, because
AND gates and NAND gates are not invertible.
EXAMPLE 2.1.

• Alice wants to encrypt the letter A, where the letter is given in


ASCII code. The ASCII value for A is (65)10 = (1000001)2.
• Let’s assume that the first key stream bits are (s0, . . . , s6) =
0101100.
SOLUTION:

Fig.2.3 Stream Cipher Encryption


NOTE THAT:

• the encryption by Alice turns the uppercase A into the lower case letter m.
• Oscar, the attacker who eavesdrops on the channel, only sees the ciphertext letter m.
• Decryption by Bob with the same key stream reproduces the plaintext A again.
THE KEY STREAM

• the security of a stream cipher completely depends on the key stream.


• The key stream bits si are not the key bits themselves. (Assignment discuss and explain).
• central requirement for
• The key stream bits should be that they appear like a random sequence to an attacker.
TRUE RANDOM NUMBER GENERATORS (TRNG)

• True random number generators (TRNGs) are characterized by the fact that their output
cannot be reproduced.
• TRNGs are based on physical processes.
• TRNGs are needed for generating session keys.
(GENERAL) PSEUDORANDOM NUMBER
GENERATORS (PRNG)
• Pseudorandom number generators (PRNGs) generate sequences which are computed
from an initial seed value.
• A common requirement of PRNGs is that they possess good statistical properties.
• Their output approximates a sequence of true random numbers.
CRYPTOGRAPHICALLY SECURE
PSEUDORANDOM NUMBER GENERATORS
(CSPRNG)
• Cryptographically secure pseudorandom number generators (CSPRNGs) are a special
type of PRNG which is unpredictable.
• this means that given n output bits of the key stream si, si+1, . . . , si+n−1, where n is
some integer, it is computationally impossible to compute the subsequent bits si+n,
si+n+1, . . ..
THE ONE-TIME PAD

• One-Time Pad (OTP) A stream cipher for which:


 the key stream s0, s1, s2, . . . is generated by a true random number generator.
 2. the key stream is only known to the legitimate communicating parties.
 3. every key stream bit si is only used once is called a one-time pad. The one-time pad is
unconditionally secure.

• the most impractical one: Key stream bits cannot be re-used.


• This implies that we need one key bit for every bit of plaintext
PRACTICAL STREAM CIPHERS

Fig 2.4 practical stream ciphers


• all known crypto algorithms (stream ciphers, block ciphers, public-key algorithms) are
not unconditionally secure.
• The best is computational security, which we define as follows:
• A cryptosystem is computationally secure if the best known algorithm for breaking it requires
at least t operations.
SUMMARY

• Stream ciphers are less popular than block ciphers in most domains such as Internet
security except for the stream cipher RC4.
• Stream ciphers sometimes require fewer resources, e.g., code size or chip area, for
implementation than block ciphers, and therefore they are used in cell phones.
• 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

You might also like