Decryption
For Decryption,
- Cipher Text and Keystream gives the original Plain Text (Same keystream will be used for encryption.).
- The Ciphertext will undergo XOR operation with keystream bit-by-bit and produces the actual Plain Text.
Example:
Cipher Text : 01011010
Keystream : 11000011
“““““““““““
Plain Text : 10011001
Decryption is just the reverse process of Encryption i.e. performing XOR with Cipher Text.
Stream Ciphers
In stream cipher, one byte is encrypted at a time while in block cipher ~128 bits are encrypted at a time. Initially, a key(k) will be supplied as input to pseudorandom bit generator and then it produces a random 8-bit output which is treated as keystream. The resulted keystream will be of size 1 byte, i.e., 8 bits. Stream ciphers are fast because they encrypt data bit by bit or byte by byte, which makes them efficient for encrypting large amounts of data quickly.Stream ciphers work well for real-time communication, such as video streaming or online gaming, because they can encrypt and decrypt data as it’s being transmitted.