- Managed File Transfer and Network Solutions
- Block cipher and stream cipher pdf file
- Subscribe to RSS
- Block Size
- Key Differences Between Block Cipher and Stream Cipher
- Block Cipher
- Difference Between Block Cipher and Stream Cipher
- Navigation menu
- Block cipher mode of operation
- Padding in Block Cipher
A stream cipher is a symmetric key cipher where plaintext digits are combined with a pseudorandom cipher digit stream keystream. In a stream cipher, each plaintext digit is encrypted one at a time with the corresponding digit of the keystream, to give a digit of the ciphertext stream.
Since encryption of each digit is dependent on the current state of the cipher, it is also known as state cipher.
In practice, a digit is typically a bit and the combining operation is an exclusive-or XOR. The pseudorandom keystream is typically generated serially from a random seed value using digital shift registers. The seed value serves as the cryptographic key for decrypting the ciphertext stream. Stream ciphers represent a different approach to symmetric encryption from block ciphers. Block ciphers operate on large blocks of digits with a fixed, unvarying transformation.
Managed File Transfer and Network Solutions
This distinction is not always clear-cut: in some modes of operation , a block cipher primitive is used in such a way that it acts effectively as a stream cipher. Stream ciphers typically execute at a higher speed than block ciphers and have lower hardware complexity. However, stream ciphers can be susceptible to serious security problems if used incorrectly see stream cipher attacks ; in particular, the same starting state seed must never be used twice.
Stream ciphers can be viewed as approximating the action of a proven unbreakable cipher, the one-time pad OTP.
A one-time pad uses a keystream of completely random digits. The keystream is combined with the plaintext digits one at a time to form the ciphertext. This system was proved to be secure by Claude E.
Block cipher and stream cipher pdf file
Shannon in However, the keystream must be generated completely at random with at least the same length as the plaintext and cannot be used more than once. This makes the system cumbersome to implement in many practical applications, and as a result the one-time pad has not been widely used, except for the most critical applications.
Key generation, distribution and management are critical for those applications. A stream cipher makes use of a much smaller and more convenient key such as bits. Based on this key, it generates a pseudorandom keystream which can be combined with the plaintext digits in a similar fashion to the one-time pad. However, this comes at a cost. The keystream is now pseudorandom and so is not truly random. The proof of security associated with the one-time pad no longer holds. It is quite possible for a stream cipher to be completely insecure.
A stream cipher generates successive elements of the keystream based on an internal state. This state is updated in essentially two ways: if the state changes independently of the plaintext or ciphertext messages, the cipher is classified as a synchronous stream cipher.
By contrast, self-synchronising stream ciphers update their state based on previous ciphertext digits. In a synchronous stream cipher a stream of pseudo-random digits is generated independently of the plaintext and ciphertext messages, and then combined with the plaintext to encrypt or the ciphertext to decrypt. In the most common form, binary digits are used bits , and the keystream is combined with the plaintext using the exclusive or operation XOR.
This is termed a binary additive stream cipher. In a synchronous stream cipher, the sender and receiver must be exactly in step for decryption to be successful. If digits are added or removed from the message during transmission, synchronisation is lost.
To restore synchronisation, various offsets can be tried systematically to obtain the correct decryption. Another approach is to tag the ciphertext with markers at regular points in the output.
Subscribe to RSS
If, however, a digit is corrupted in transmission, rather than added or lost, only a single digit in the plaintext is affected and the error does not propagate to other parts of the message. This property is useful when the transmission error rate is high; however, it makes it less likely the error would be detected without further mechanisms. Moreover, because of this property, synchronous stream ciphers are very susceptible to active attacks : if an attacker can change a digit in the ciphertext, he might be able to make predictable changes to the corresponding plaintext bit; for example, flipping a bit in the ciphertext causes the same bit to be flipped in the plaintext.
Another approach uses several of the previous N ciphertext digits to compute the keystream. Such schemes are known as self-synchronizing stream ciphers , asynchronous stream ciphers or ciphertext autokey CTAK. The idea of self-synchronization was patented in , and has the advantage that the receiver will automatically synchronise with the keystream generator after receiving N ciphertext digits, making it easier to recover if digits are dropped or added to the message stream.
Single-digit errors are limited in their effect, affecting only up to N plaintext digits. An example of a self-synchronising stream cipher is a block cipher in cipher feedback CFB mode.
Binary stream ciphers are often constructed using linear-feedback shift registers LFSRs because they can be easily implemented in hardware and can be readily analysed mathematically. The use of LFSRs on their own, however, is insufficient to provide good security.
Various schemes have been proposed to increase the security of LFSRs. Because LFSRs are inherently linear, one technique for removing the linearity is to feed the outputs of several parallel LFSRs into a non-linear Boolean function to form a combination generator.
Various properties of such a combining function are critical for ensuring the security of the resultant scheme, for example, in order to avoid correlation attacks. Normally LFSRs are stepped regularly. Such generators include the stop-and-go generator , the alternating step generator and the shrinking generator.
The initial state of the three LFSRs is the key.
Key Differences Between Block Cipher and Stream Cipher
One LFSR is clocked if the output of a second is a 1, otherwise it repeats its previous output. This output is then in some versions combined with the output of a third LFSR clocked at a regular rate. The shrinking generator takes a different approach. Two LFSRs are used, both clocked regularly.
If the first LFSR outputs 0, however, the output of the second is discarded, and no bit is output by the generator. This mechanism suffers from timing attacks on the second generator, since the speed of the output is variable in a manner that depends on the second generator's state.
This can be alleviated by buffering the output. Instead of a linear driving device, one may use a nonlinear update function. For example, Klimov and Shamir proposed triangular functions T-functions with a single cycle on n-bit words.
For a stream cipher to be secure, its keystream must have a large period and it must be impossible to recover the cipher's key or internal state from the keystream.
Difference Between Block Cipher and Stream Cipher
Cryptographers also demand that the keystream be free of even subtle biases that would let attackers distinguish a stream from random noise, and free of detectable relationships between keystreams that correspond to related keys or related cryptographic nonces.
That should be true for all keys there should be no weak keys , even if the attacker can know or choose some plaintext or ciphertext. As with other attacks in cryptography, stream cipher attacks can be certificational so they are not necessarily practical ways to break the cipher but indicate that the cipher might have other weaknesses.
Securely using a secure synchronous stream cipher requires that one never reuse the same keystream twice. That generally means a different nonce or key must be supplied to each invocation of the cipher. Application designers must also recognize that most stream ciphers provide not authenticity but privacy : encrypted messages may still have been modified in transit. Short periods for stream ciphers have been a practical concern.
However, when not using full feedback, the resulting stream has a period of around 2 32 blocks on average; for many applications, the period is far too low. For example, if encryption is being performed at a rate of 8 megabytes per second, a stream of period 2 32 blocks will repeat after about a half an hour. Some applications using the stream cipher RC4 are attackable because of weaknesses in RC4's key setup routine; new applications should either avoid RC4 or make sure all keys are unique and ideally unrelated such as generated by a well-seeded CSPRNG or a cryptographic hash function and that the first bytes of the keystream are discarded.
The elements of stream ciphers are often much simpler to understand than block ciphers and are thus less likely to hide any accidental or malicious weaknesses. Stream ciphers are often used for their speed and simplicity of implementation in hardware, and in applications where plaintext comes in quantities of unknowable length like a secure wireless connection. If a block cipher not operating in a stream cipher mode were to be used in this type of application, the designer would need to choose either transmission efficiency or implementation complexity, since block ciphers cannot directly work on blocks shorter than their block size.
Block cipher mode of operation
For example, if a bit block cipher received separate bit bursts of plaintext, three quarters of the data transmitted would be padding.
Block ciphers must be used in ciphertext stealing or residual block termination mode to avoid padding, while stream ciphers eliminate this issue by naturally operating on the smallest unit that can be transmitted usually bytes. Another advantage of stream ciphers in military cryptography is that the cipher stream can be generated in a separate box that is subject to strict security measures and fed to other devices such as a radio set, which will perform the xor operation as part of their function.
The latter device can then be designed and used in less stringent environments. From Wikipedia, the free encyclopedia.
Padding in Block Cipher
This section needs expansion. You can help by adding to it. June Main article: Stream cipher attacks. This section needs additional citations for verification.
Please help improve this article by adding citations to reliable sources.
Unsourced material may be challenged and removed. Prasithsangaree and P. Krishnamurthy Archived from the original PDF on Stream ciphers. RC4 block ciphers in stream mode ChaCha. History of cryptography Cryptanalysis Outline of cryptography. Symmetric-key algorithm Block cipher Stream cipher Public-key cryptography Cryptographic hash function Message authentication code Random numbers Steganography. Categories : Stream ciphers Cryptographic primitives.
Hidden categories: CS1 errors: missing periodical Articles to be expanded from June All articles to be expanded Articles using small message boxes All accuracy disputes Articles with disputed statements from October Articles needing additional references from July All articles needing additional references.