Glossary

Learn about data security, encryption, hashing and encoding in our knowledge base.

Stream cipher

A stream cipher is a type of symmetric key cipher that encrypts and decrypts data one bit or one byte at a time. It uses a secret key to generate a stream of pseudorandom keystream bits, which are XORed with the plaintext message to produce the ciphertext.

Stream ciphers are known for their efficiency and simplicity, as they do not require the use of complex mathematical operations like block ciphers do. They are widely used in a variety of applications, including secure communication, data encryption, and password storage.

To encrypt data using a stream cipher, the sender of the message first creates a secret key that is used in conjunction with the stream cipher algorithm to generate a keystream. The keystream is then XORed with the plaintext message to produce the ciphertext.

To decrypt the data, the recipient of the message uses the same secret key and the stream cipher algorithm to generate the keystream. The keystream is then XORed with the ciphertext to produce the plaintext message.

Stream ciphers are generally considered to be secure when used with a strong key, but they are vulnerable to certain types of attacks, such as key recovery attacks and known plaintext attacks. To improve security, it is important to use a strong key and to regularly update the key to prevent attackers from recovering the key.