When you’re using symmetric encryption you can use what’s known as either a stream cipher or a block cipher. They both ultimately encrypt your data, but the difference is how the data gets encrypted.
Let’s learn about their primary differences and why it matters for the Security+ exam.
A stream cipher encrypts information bit-by-bit. It will take plaintext data, turn it into single bits, and then convert each of those bits into ciphertext.
An analogy to this is if you were encrypting a Word document. With stream cipher, you would encrypt the document letter by letter until there are no more letters.
Instead, with block ciphers, we are encrypting blocks of data and not individual bits. Once a block of data has been encrypted, it will move on to encrypting another block, and so on…
Going back to our analogy, instead of encrypting letter by letter, block ciphers would encrypt paragraph by paragraph.
These blocks usually need to be a certain size (such as 64 or 128 bits), and so if we run out of data to fill in a specific block, the algorithm will add padding onto the block in order to make it the right size.
Comparing the two and examples
One of the benefits of stream ciphers is that they tend to be faster since you’re processing less data at a time. With block ciphers, you have to process much more data at the same time which means stream ciphers may be better to use on devices with low power (think IoT, older mobile phones, etc…). They’re faster and generally simpler to implement.
A negative of that, however, is that some stream ciphers can be vulnerable to attack and they can be more tricky to properly implement. Plus, certain block ciphers can run in a stream-like mode to get the speed benefits of stream ciphers but the reliability of block ciphers. Combine those facts together and it explains why block ciphers are more commonly used than stream ciphers.
An example of a stream cipher is RC4, which is considered broken and insecure.
An example of a block cipher is AES, which is still widely used today, including as the choice of cipher for the U.S. government.
After understanding the difference between stream and block ciphers, you need to learn more about block cipher modes of operation.