

So let’s start by creating a 128 bits key for AES encryption. Currently, a 128 bits key in AES is considered to be a safe compromise between efficiency and security. AES for example will execute more rounds with larger keys. On the other hand, the execution might be slower with larger keys. Usually, longer keys improve security, especially against brute-force attacks (though sometimes that might not be true). That means it will break the data to be encrypted (cleartext) in blocks/chunks of 16 bytes, encrypt them (block by block), and join the encrypted blocks together to form the ciphertext.ĪES keys might have three different lengths (128, 192 or 256). :-)ĪES is a block cipher and works with blocks of 128 bits. National Security Agency (NSA) for top-secret information. It is also the first (and only) publicly accessible cipher approved by the U.S.

National Institute of Standards and Technology (NIST) in 2001 for the encryption of electronic data and became effective as a U.S. There are several symmetric-key encryption algorithms available (DES, AES, IDEA, Blowfish, RC4, etc), and currently the most commonly used symmetric algorithm is AES (Advanced Encryption Standard).ĪES is a standard set by the U.S. This key is usually called a private key, and should stay private, or the security is broken! In a symmetric-key encryption algorithm, the same key is used for both encryption and decryption.

To follow along with this article and run the commands on your machine, you just need a terminal with a recent version of OpenSSL. In this article, we will use OpenSSL to put into practice some concepts about symmetric-key encryption. In the “ Introduction to encryption for embedded Linux developers” article, we learned the basic concepts, including an introduction to security, confidentiality and encryption, the main motivations and how encryption works, types of encryption (symmetric-key and asymmetric-key encryption), the most commonly used ciphers and the trade-offs between them. In this article, we will learn how symmetric-key encryption works from a practical perspective.
