AES encryption: blocks, keys and authenticated modes
Understand AES key sizes, its fixed block size and the mode, nonce and key-management requirements around the cipher.

On this page
AES, the Advanced Encryption Standard, is a symmetric block cipher standardized by NIST. It is widely used as a building block for protecting data, but a correct application also needs an appropriate mode, key management and implementation.
Encryption basics
Encryption transforms plaintext into ciphertext using a key. Symmetric encryption uses a shared secret; asymmetric schemes use a public/private key pair. Neither arrangement removes the need to manage and protect keys.
AES has a fixed 128-bit block size and supports 128-, 192- and 256-bit keys. Block size and key size describe different properties. A file larger than one block needs a defined construction for processing the complete message.
Background and standardization
NIST selected Rijndael after an open competition to find a successor to DES. AES was standardized in 2001. The 2023 update to FIPS 197 improved the presentation without changing the algorithm. Rijndael's broader family should not be confused with the particular block/key combinations standardized as AES.
Core operations
AES is a substitution-permutation design. Its encryption rounds combine byte substitution, row shifting, column mixing and addition of round-key material; the final round omits column mixing. Key expansion derives round keys from the original key. The number of rounds depends on the key size.
Decryption applies the corresponding inverse operations. These steps explain the design, not an invitation to implement the primitive yourself. Maintained cryptographic libraries handle implementation details such as constant-time behavior and supported hardware acceleration.
A cipher is not a complete protocol
Plain AES does not describe how to encrypt an arbitrary message safely. Modes of operation define how the primitive is used. Repeatedly encrypting independent blocks in ECB mode can reveal patterns and is unsuitable for typical application data.
Authenticated encryption, such as AES-GCM when appropriate, combines encryption with tamper detection. The application must follow the construction's nonce and authentication-tag requirements. In particular, reusing a nonce under the same GCM key can undermine security. A failed authentication check must not be treated as valid plaintext.
Do not infer integrity from confidentiality. Nor should a password be used directly as an AES key: password-derived encryption requires an appropriate key-derivation design. Password verification is a separate password-storage problem.
Applications and implementation choices
AES-based constructions appear in storage protection and communication protocols. Different systems make different choices, so the presence of a familiar application name does not establish which cipher, mode or key management it currently uses.
Use a maintained library or protocol implementation with secure defaults. Generate keys with an appropriate cryptographic random generator, restrict access, plan rotation and recovery, and keep required parameters with the ciphertext. Encryption at rest does not prevent an authorized or compromised application from obtaining plaintext.
Hardware support can improve throughput. Benchmark representative message sizes and concurrency rather than choosing a key size solely from a performance assumption. Correct key handling and mode usage are more useful than a homemade optimization.
Security over time
AES is not a guarantee against every attack. Implementation flaws, leaked keys and nonce misuse can defeat an otherwise sound primitive. Quantum threats to symmetric cryptography differ from threats to public-key systems; do not treat them as interchangeable or claim an existing deployment has been broken merely because quantum research exists. Follow current standards and the requirements of the complete protocol.
References
Written by Alex Hovy.
← Back to BlogsContinue reading
Replacing an identity server: ASP.NET Core Identity and OpenIddict
Migration considerations for user management, OAuth/OpenID Connect contracts, credentials and operations, with clear distinctions between identity products.
Authorisation: resource permissions and trusted enforcement
Design understandable access rules, enforce object-level permissions and account for service boundaries, caching and revocation.
Authentication: passwords, MFA, sessions and tokens
Separate identity verification from permissions, and understand the responsibilities around passwords, MFA, sessions, JWT validation and account recovery.