Stream encryption method

Source: Internet
Author: User

"Classic Cryptography and Modern Cryptography" book excerpt:

A simple "stream cipher " requires a " random" " bits stream" as a "key". Ciphertext can be generated by the XOR logic operation of the plaintext with this "random key Stream" . PlainText can be restored by XOR logic with the same "random key Stream" .

To implement the XOR logic operation is simple, it is a fast and effective method of encryption when used as a bit-level. The only problem is that you must resolve how to generate a "random key stream." This is a problem because the "key stream" must be "random", and legitimate users can easily regenerate the key stream. If the key stream is a repeating bit sequence, it is easy to remember, but not very secure. A random sequence of bits as long as a clear text is difficult to remember. So this is a dilemma, how to generate a "random" bit sequence as a "key stream" that requires ease of use, but not too short to be unsafe.

Solve the key problem of stream cryptography: Develop a "random bit generator" that generates a key stream based on a short key. The generator is used to generate the key stream, and the user simply remembers how to start the generator.

One problem with designing LFSR for generating random bits is that for a given LFSR, you can generate the longest number of non-repeating sequence bits.

RC4:

The size of the RC4 varies according to the value of the parameter n . RC4 can implement a "secret internal state", for n digits, there are n=2^n kinds of possible, usually n=8. RC4 can generate a total of 256 elements of the array S. Each output of the RC4 is a random element in the array s. To achieve this, two processes are required: One is the "Key Scheduling algorithm" (key-scheduling Algorithm,ksa), which is used to set the initial arrangement of S, and one is the pseudo-random generation algorithm (pseudo Random-generation Algorithm,prga), used to select random elements and modify the original sort order of S.

Stream encryption method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.