Questions tagged [stream-cipher]

A stream cipher is an encryption algorithm which encrypts arbitrary length plaintext, using a key. Some stream ciphers generate a keystream from only the key, which is then XOR-combined with the plain text, others feed back plaintext or ciphertext into the algorithm to create the keystream.

A stream cipher is an encryption algorithm which encrypts arbitrary length plaintext using a key. Some stream ciphers generate a keystream from only the key, which is then XOR-combined with the plain text. These are called synchronous stream ciphers. Others feed plaintext or ciphertext back into the algorithm to create the keystream. If they depend only on the key and a fixed window of ciphertext, they are called self-synchronizing stream ciphers.

Stream ciphers can be build from block ciphers using a mode of operation, or be independent algorithms. They are usually malleable (cf. ) unless an authentication algorithm is used.

Examples include:

  • The block cipher modes , and all turn a block cipher into a stream cipher.
  • is a common stream cipher that is largely considered broken and being phased out.
  • and are newer stream ciphers used in the NaCl library and in TLS.

See also: the Wikipedia article on stream ciphers.

569 questions
86
votes
11 answers

Is modern encryption needlessly complicated?

RSA, DES, AES, etc., all use (relatively) complicated mathematics to encrypt some message with some key. For each of these methods, there have been several documented vulnerabilities found over the years. Some even believe that there is a…
61
votes
4 answers

Difference between stream cipher and block cipher

I read that A typical stream cipher encrypts plaintext one byte at a time, although a stream cipher may be designed to operate on one bit at a time or on units larger than a byte at a time. (Source: Cryptography and Network Security, William…
53
votes
1 answer

Why do 5G, 4G, etc., use non-conventional algorithms?

Looking up information about 5G and the previous 3GPP standards, why have they been incorporating non-conventional algorithms into the standards? For example, AES has been considered secure for ages and there is lots of support for hardware…
MCCCS
  • 731
  • 1
  • 7
  • 15
25
votes
5 answers

With sufficient randomness, is XOR an acceptable mechanism for encrypting?

I have heard criticism of various cryptosystems saying that "at their heart, they were just XOR." Is this just ignorance, or is there something inherently wrong with XOR based ciphers?
John Gietzen
  • 1,515
  • 2
  • 15
  • 16
24
votes
4 answers

Is it feasible to build a stream cipher from a cryptographic hash function?

A few years ago I devised a symmetric-key system that worked like so: H() = some hashing function h = the number of bits in the result of H() key = bits to be used as a key ^ = the XOR operation + = concatenation len() = the length…
John Gietzen
  • 1,515
  • 2
  • 15
  • 16
22
votes
7 answers

What is the difference between a stream cipher and a one-time-pad?

A (synchronous) stream cipher is an algorithm which maps some fixed-length key to an arbitrary-length key-stream (i.e. a sequence of bits): $C : \{0,1\}^k \to \{0,1\}^{\infty}$. This key-stream is then XOR-ed with the plain text stream, giving the…
Paŭlo Ebermann
  • 22,946
  • 7
  • 82
  • 119
21
votes
1 answer

How to attack a "many-time pad" based on what happens when an ASCII space is XORed with a letter?

I've already sent my correct solution to a homework exercise from Dan Boneh's Introduction to Cryptography class on Coursera: "Let us see what goes wrong when a stream cipher key is used more than once. Below are eleven hex-encoded ciphertexts that…
21
votes
2 answers

Can I use HMAC-SHA1 in counter mode to make a stream cipher?

Say I have an embedded device which is only capable of doing HMAC-SHA1 transformations (that device is, in fact, a YubiKey). Would it be secure to feed it like a block cipher in counter mode to get a random pad suitable as an stream cipher? Of…
xxxxxxxxx
  • 568
  • 2
  • 11
19
votes
4 answers

Can you make a hash out of a stream cipher?

A comment on another question made me wonder about something: Assume you're on a rather constrained platform — say, a low-end embedded device — with no built-in crypto capabilities, but you do have access to a simple stream cipher; say, RC4 or one…
Ilmari Karonen
  • 46,700
  • 5
  • 112
  • 189
17
votes
1 answer

Dancing confusion with Daniel J. Bernstein's stream ciphers

I know of Salsa20 which won the ESTREAM competition. This is dated of 25 Dec 2007. There is also the ChaCha20 stream cipher (cr.yp.to/chacha.html). This claims to increase the amount of diffusion per round. This is dated 28 Jan 2008. Then there is…
x9c8v7
  • 173
  • 1
  • 4
14
votes
3 answers

Converting a stream cipher into a block cipher

The well-known Counter-Mode (CTR) mode of operation for a block cipher essentially converts any block cipher into a stream cipher. Is there a way to do the reverse? In other words, given a "good" stream cipher $G$, can we construct a block cipher…
Fixee
  • 4,258
  • 3
  • 26
  • 39
14
votes
1 answer

Security considerations on "expand 32-byte k"-magic number in the Salsa20 family of stream ciphers?

I'm currently examining the NaCl library written by Daniel J. Bernstein and I noticed that the library hard codes the sigma: static const unsigned char sigma[16] = "expand 32-byte k"; In all the salsa stream…
Pascal
  • 243
  • 2
  • 7
13
votes
1 answer

Why do stream ciphers use a nonce?

My question maybe will be stupid, but my problem is that I do not understand why stream ciphers need a key and also a nonce. As far as I understand, the keystream is generated with the nonce. The same key can be reused with a different…
robert
  • 273
  • 2
  • 10
13
votes
3 answers

What is the PRG period of stream ciphers such as RC4 or Salsa20?

I am confused about how long a stream cipher can be used before you should change the key. To be concrete, let me use the stream cipher based on RC4 as an example. Let's say I want to encrypt a very long message. I pick a key with 128 bits and start…
rlandster
  • 317
  • 2
  • 8
12
votes
2 answers

Streaming API to authenticated encryption

In regards to NaCl, I asked DJB he had any intent to add a streaming API to an authenticated cipher. His response was obvious in retrospect, that one should never release a decrypted plaintext before verifying the authenticator. However, this got me…
Stephen Touset
  • 11,162
  • 1
  • 39
  • 53
1
2 3
37 38