AES implementations


There are various implementations of the Advanced Encryption Standard, also known as Rijndael.

Libraries

Rijndael is free for any use public or private, commercial or non-commercial. The authors of Rijndael used to provide a homepage for the algorithm. Care should be taken when implementing AES in software, in particular around side-channel attacks.
The algorithm operates on plaintext blocks of 16 bytes. Encryption of shorter blocks is possible only by padding the source bytes, usually with null bytes. This can be accomplished via several methods, the simplest of which assumes that the final byte of the cipher identifies the number of null bytes of padding added.

Implementation Considerations

Careful choice must be made in selecting the mode of operation of the cipher. The simplest mode encrypts and decrypts each 128-bit block separately. In this mode, called electronic code book, blocks that are identical will be encrypted identically; this is entirely insecure. It makes some of the plaintext structure visible in the ciphertext. Selecting other modes, such as using a sequential counter over the block prior to encryption and removing it after decryption avoids this problem. Another mode, Cipher Block Chaining is one of the most commonly used modes of AES due to its use in TLS. CBC uses a random initialization vector to ensure that distinct ciphertexts are produced even when the same plaintext is encoded multiple times. The IV can be transmitted in the clear without jeopardizing security. A common practice is to prepend the 16 byte IV to the ciphertext, which gives the decrypter easy access to the IV. Care must be taken to use a new IV for every encryption operation, since otherwise an attacker can recover plaintext.
  • Current list of FIPS 197 validated cryptographic modules
  • Current list of FIPS 140 validated cryptographic modules with validated AES implementations – Most of these involve a commercial implementation of AES algorithms. Look for "FIPS-approved algorithms" entry in the "Level / Description" column followed by "AES" and then a specific certificate number.

C/ASM library

C++ library

  • Botan has implemented Rijndael since its very first release in 2001
  • Crypto++ A comprehensive C++ public-domain implementation of encryption and hash algorithms. FIPS validated

C/CUDA library

  • has implemented Rijndael on CUDA with its first release in 2012

C# /.NET

Delphi

  • Delphi Encryption Compendium has a cross platform capable AES implementation, among implementations of various other cryptographic algorithms

Go

  • The package in standard library

Java

Python

  • – The Python Cryptography Toolkit PyCrypto, extended in
  • keyczar – Cryptography Toolkit keyczar
  • M2Crypto – M2Crypto is the most complete OpenSSL wrapper for Python.
  • – Python library which exposes cryptographic recipes and primitives.
  • – Python binding for libSodium

JavaScript

  • SJCL library – contains JavaScript implementations of AES in CCM, CBC, OCB and GCM modes
  • AES-JS – portable JavaScript implementation of AES ECB and CTR modes
  • Forge – JavaScript implementations of AES in CBC, CTR, OFB, CFB, and GCM modes
  • asmCrypto – JavaScript implementation of popular cryptographic utilities with focus on performance. Supports CBC, CFB, CCM modes.
  • pidCrypt – open source JavaScript library. Only supports the CBC and CTR modes.

Rust

  • – Rust implementation.

LabVIEW

  • – LabVIEW implementation.

Zig

  • - Zig Standard Library. Includes hardware support for AES-NI on x86_64 and ARM AES Extensions on AArch64.

Applications

Archive and compression tools

File encryption

Encrypting file systems

Disk / partition encryption

Storage encryption

Security for communications in local area networks

Miscellaneous

Hardware