AES (Advanced Encryption Standard) is the NIST-standard for encrypting data and is widely used. AES is a block cipher, which means that the data is encrypted per block. For example, AES-128 denotes that each plaintext is split into blocks of 128 bits and uses a 128-bit key for encryption.

For example, suppose we want to encrypt the plaintext “Hello world, how are you?”. For now, we will consider each character to be represented in 1 byte (= 8 bits). To correctly encrypt our plaintext, it will be split into the following sets:

[hello world, how] + [ are you?]

The first block is exactly 16 bytes, but the second block is 7 bytes short. In AES, 7 bytes of padding will be added to match the block size. For now, we will denote padding as “p”. The schematic for encrypting looks as follows: [hello world, how] + [ are you?ppppppp]

Each AES block has as input the plaintext and the key, and outputs a ciphertext. The key is derived from the password chosen by the user. A schematic of AES encryption is shown below.

image

Keywords

  • Block cipher - an encryption mechansim where plaintexts are divided in blocks before encrypting
  • Ciphertext - the text after encryption, which is only decodable for parties having access to the key
  • Encryption - technique for encoding information in such a way that only authorised parties can obtain the content
  • Key - the secret value used for encoding & decoding information
  • Plaintext - the text before encryption, readable for all parties