Block Ciphers:
A block cipher is a symmetric key encryption algorithm that encrypts data in fixed-size blocks, typically 64 or 128 bits.
- The plaintext is divided into blocks, and each block is encrypted using a secret key and a specific mode of operation.
- Padding may be added if the message does not align with the block size.
- Block ciphers use multiple rounds of substitution and permutation operations to achieve encryption.
How Block Ciphers Work:
- Padding: If the plaintext is not a multiple of the block size, it is padded to fit the block size.
- Block Division: The plaintext is divided into equal-sized blocks.
- Encryption: Each block is encrypted independently or in sequence using a block cipher algorithm and a symmetric key.
- Ciphertext Generation: The encrypted blocks are combined to produce the final ciphertext.
Stream Ciphers:
A stream cipher is a symmetric key encryption algorithm that encrypts data one bit or byte at a time, rather than in large blocks.
- It generates a pseudorandom keystream from a secret key and an initialization vector (IV), and this keystream is combined with the plaintext using the XOR operation.
- This method allows for fast and efficient encryption, especially suited for environments where data arrives in a continuous stream, such as in real-time communication.
How Stream Ciphers Work:
- Keystream Generation: A pseudorandom number generator (PRNG) is used to generate a keystream from a secret key and IV.
- Encryption: Each bit or byte of plaintext is XORed with the corresponding bit or byte from the keystream to produce ciphertext.
- Decryption: The same keystream is XORed with the ciphertext to retrieve the original plaintext.
Block Cipher Vs Stream Ciphers:

Discussion 0