Symmetric encryption is a type of encryption that uses a single key to encrypt and decrypt data. If you’re planning to take the SY0-501 exam, you should have a basic understanding of cryptography concepts such as cipher types and cipher modes.
For example, can you answer this practice test question?
Q. Which of the following is a symmetric encryption algorithm that encrypts data 1 bit at a time?
A. Block cipher
B. Stream cipher
C. AES
D. DES
E. MD5
More, do you know why the correct answer is correct and the incorrect answers are incorrect? The answer and explanation are available at the end of this post.
Block Versus Stream Ciphers
Most symmetric algorithms use either a block cipher or a stream cipher. They are both symmetric, so they both use the same key to encrypt or decrypt data. However, they divide data in different ways.
A block cipher encrypts data in specific-sized blocks, such as 64-bit blocks or 128-bit blocks. The block cipher divides large files or messages into these blocks and then encrypts each individual block separately. A stream cipher encrypts data as a stream of bits or bytes rather than dividing it into blocks.
In general, stream ciphers are more efficient than block ciphers when the size of the data is unknown or sent in a continuous stream, such as when streaming audio and video over a network. Block ciphers are more efficient when the size of the data is known, such as when encrypting a file or a specific-sized database field.
An important principle when using a stream cipher is that encryption keys should never be reused. If a key is reused, it is easier to crack the encryption.
Remember this
Stream ciphers encrypt data a single bit, or a single byte, at a time in a stream. Block ciphers encrypt data in a specific-sized block such as 64-bit or 128-bit blocks. Stream ciphers are more efficient than block ciphers when encrypting data in a continuous stream.
Cipher Modes
Block ciphers can use a variety of different modes of operation. It’s important to have a basic understanding of these modes when choosing cipher suites.
The Electronic Codebook (ECB) mode of operation is the simplest cipher mode mentioned in this blog. Algorithms that use ECB divide the plaintext into blocks and then encrypt each block using the same key. This represents a significant weakness. If any of the plaintext blocks are the same, the resulting ciphertext is the same, making it much easier to crack. ECB is not recommended for use in any cryptographic protocols today.
Cipher Block Chaining (CBC) mode is used by some symmetric block ciphers. It uses an IV for randomization when encrypting the first block. It then combines each subsequent block with the previous block using an XOR operation. Because encryption of each block is dependent on the encryption of all previous blocks, CBC sometimes suffers from pipeline delays, making it less efficient than some other modes.
Counter (CTM) mode effectively converts a block cipher into a stream cipher. It combines an IV with a counter and uses the result to encrypt each plaintext block. Each block uses the same IV, but CTM combines it with the counter value, resulting in a different encryption key for each block. Multiprocessor systems can encrypt or decrypt multiple blocks at the same time, allowing the algorithm to be quicker on multiprocessor or multicore systems. CTM is widely used and respected as a secure mode of operation.
It’s worthwhile noting that the CompTIA objectives list CTM and include CTM in the acronym list as Counter-Mode. However, it’s much more common to see it listed as CTR or CM.
Galois/Counter Mode (GCM) is a mode of operation used by many block ciphers. It combines the Counter mode of operation with the Galois mode of authentication. Note that it doesn’t authenticate users or systems, but instead provides data authenticity (integrity) and confidentiality. In addition to encrypting the data for confidentiality, it includes hashing techniques for integrity. It is widely used due to its efficiency and performance, allowing systems to quickly encrypt and decrypt data.
Remember this
The Electronic Codebook (ECB) mode of operation is deprecated and should not be used. Cipher Block Chaining (CBC) mode combines each block with the previous block when encrypting data and sometimes suffers from pipeline delays. Counter (CTM) mode combines an IV with a counter to encrypt each block. Galois/Counter Mode (GCM) combines Counter mode with hashing techniques for integrity.
Q. Which of the following is a symmetric encryption algorithm that encrypts data 1 bit at a time?
A. Block cipher
B. Stream cipher
C. AES
D. DES
E. MD5
Answer is B. A stream cipher encrypts data a single bit or a single byte at a time and is more efficient when the size of the data is unknown, such as streaming audio or video.
A block cipher encrypts data in specific-sized blocks, such as 64-bit blocks or 128-bit Advanced Encryption Standard (AES) and Data Encryption Standard (DES) are block ciphers.
Message Digest 5 (MD5) is a hashing algorithm.
See Chapter 10 of the CompTIA Security+: Get Certified Get Ahead: SY0-501 Study Guide for more information on cryptography concepts.
1 thought on “Symmetric Encryption Concepts”