Keystream

Keystream

In cryptography, a keystream is a stream of random or pseudorandom characters that are combined with a plaintext message to produce an encrypted message (the ciphertext).

The "characters" in the keystream can be bits, bytes, numbers or actual characters like A-Z depending on the usage case.

Usually each character in the keystream is either added, subtracted or XORed with a character in the plaintext to produce the ciphertext, using modular arithmetic.

Keystreams are used in the one-time pad cipher and in most stream ciphers. Block ciphers can also be used to produce keystreams. For instance, CTR mode is a block mode that makes a block cipher produce a keystream and thus turns the block cipher into a stream cipher.

Example

In this simple example we use the English alphabet of 26 characters from a-z. Thus we can not encrypt numbers, commas, spaces and other symbols. The random numbers in the keystream then have to be at least between 0 and 25.

To encrypt we add the keystream numbers to the plaintext. And to decrypt we subtract the same keystream numbers from the ciphertext to get the plaintext.

If a ciphertext number becomes larger than 25 we wrap it to a value between 0-25. Thus 26 becomes 0 and 27 becomes 1 and so on. (Such wrapping is called modular arithmetic.)

Here the plaintext message "attack at dawn" is combined by addition with the keystream "kjcngmlhylyu" and produces the ciphertext "kcvniwlabluh".

References

* " [http://www.cacr.math.uwaterloo.ca/hac/ Handbook of Applied Cryptography] " by Menezes, van Oorschot and Vanstone (2001), chapter 1, 6 and 7.


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • keystream — noun A stream of random or pseudorandom characters that are combined with the plaintext to produce a ciphertext …   Wiktionary

  • Stream cipher — The operation of the keystream generator in A5/1, a LFSR based stream cipher used to encrypt mobile phone conversations. In cryptography, a stream cipher is a symmetric key cipher where plaintext digits are combined with a pseudorandom cipher… …   Wikipedia

  • RC4 — In cryptography, RC4 (also known as ARC4 or ARCFOUR meaning Alleged RC4, see below) is the most widely used software stream cipher and is used in popular protocols such as Secure Sockets Layer (SSL) (to protect Internet traffic) and WEP (to… …   Wikipedia

  • Algoritmo LSA — En criptografía, LSA (acrónimo de Light Summary Algorithm , Algoritmo Ligero de Resumen) es un algoritmo de reducción criptográfico de 64 bits. Codificación La codificación del LSA de 64 bits es representada tí­picamente como un número de 16… …   Wikipedia Español

  • Correlation attack — In cryptography, correlation attacks are a class of known plaintext attacks for breaking stream ciphers whose keystream is generated by combining the output of several linear feedback shift registers (called LFSRs for the rest of this article)… …   Wikipedia

  • Trivium (Algorithmus) — Struktur von Trivium Trivium ist eine synchrone Stromchiffre, die einen Kompromiss zwischen einfacher und performanter Umsetzbarkeit in Hardware und effizienter Implementierung in Software darstellt. Trivium wurde von den beiden belgischen… …   Deutsch Wikipedia

  • QUAD (cipher) — Infobox block cipher name = QUAD caption = designers = Côme Berbain, Henri Gilbert and Jacques Patarin publish date = May 28, 2006 (at Eurocrypt) derived from = derived to = related to = certification = key size = 80 bits structure = multivariate …   Wikipedia

  • Solitaire (cipher) — The Solitaire cryptographic algorithm was designed by Bruce Schneier to allow field agents to communicate securely without having to rely on electronics or having to carry incriminating tools , [cite web | url =… …   Wikipedia

  • Blum-Goldwasser cryptosystem — The Blum Goldwasser (BG) cryptosystem is an asymmetric key encryption algorithm proposed by Manuel Blum and Shafi Goldwasser in 1984. Blum Goldwasser is a probabilistic, semantically secure cryptosystem with a constant size ciphertext expansion.… …   Wikipedia

  • Fluhrer, Mantin, and Shamir attack — In cryptography, the Fluhrer, Mantin, and Shamir attack allows an attacker to recover the key in an RC4 encrypted stream from a large number of messages in that stream.BackgroundThe Fluhrer, Mantin and Shamir (FMS) attack takes advantage of a… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”