There are a lot of different parts of cryptography. If you want to encrypt some data though, there are two types of algorithms you can use: symmetric encryption algorithms and asymmetric encryption algorithms. The overall concept is the same, they can encrypt data, but they work on different principles and have different use cases. The titular difference, however, describes the encryption keys. A symmetric encryption algorithm uses a single shared key to both encrypt and decrypt data. An asymmetric encryption algorithm uses two linked keys, one to decrypt and one to decrypt.
Contents
Properties of symmetric encryption algorithms
As stated above, the key distinguishing feature of a symmetric encryption algorithm is the fact that you use a single key to both encrypt and decrypt data. That’s not to say that there’s only one possible encryption key, just if you encrypt something with one key, you need to use the same key to decrypt it. It is sometimes referred to as shared-key encryption. This is because each participant needs to know the same key and so you need to share it.
This property of using the same key to encrypt and decrypt can be a bit of an issue. In order to use a symmetric encryption algorithm you need to be able to communicate it securely. But you can’t do that without already having a secure means to communicate. Thankfully, this problem can be solved with asymmetric encryption but it’s worth understanding.
The keys for symmetric encryption algorithms tend to be quite small, at least when compared to asymmetric encryption. This makes them relatively easy to transmit over even a slow network connection and less vulnerable to errors in an unreliable network. Symmetric encryption algorithms are also fast when compared to asymmetric algorithms.
All of these properties make symmetric encryption algorithms particularly useful for bulk encryption of data. This is especially the case when speed is an issue.
Stream ciphers and block ciphers
AES is probably the best-known symmetric encryption algorithm. It’s used in pretty much everything that encrypts lots of data and is a standard part of the encryption suites used in HTTPS. AES is a block cipher with 128-bit blocks. A block cipher works by encrypting blocks of data at a time. Each block has to be the same size. This is fine when the remaining data is bigger than the block size but means that some form of padding needs to be used to complete the block.
A stream cipher works by encrypting much smaller amounts of data at a time, typically one byte at a time. A variation of this concept is the substitution cipher that works on letters. Substitution ciphers are vulnerable to frequency analysis and so are typically unreliable and unused. Stream ciphers don’t have this issue though.
Symmetric algorithms tend to be vulnerable to known-plaintext attacks, chosen-plaintext attacks, differential cryptanalysis, and linear cryptanalysis. Modern algorithms, however, have been carefully designed with this in mind and so these issues are not a problem.
Conclusion
Symmetric encryption is a form of encryption that uses the same key to both encrypt and decrypt data. In some cases, the algorithm itself is the same to both encrypt and decrypt, though this is not necessarily the case. Encryption keys tend to be relatively short and easy to transmit. The key, however, needs to be transmitted over a secure channel as it needs to be communicated between all involved parties. Symmetric encryption algorithms tend to be much faster than asymmetric encryption algorithms.