A small, portable C implementation of AES128/192/256 encryption supporting ECB, CBC, and CTR modes.
Tiny AES in C is a lightweight, portable implementation of the AES encryption algorithm written in C. It provides AES-128, AES-192, and AES-256 encryption with support for ECB, CBC, and CTR modes. The library solves the need for encryption in resource-constrained environments where small code size and low memory usage are more important than maximum performance.
Embedded systems developers, IoT programmers, and anyone needing AES encryption in environments with limited memory and storage. It's particularly valuable for microcontrollers and other platforms where larger libraries like OpenSSL or Mbed TLS are impractical.
Developers choose Tiny AES in C for its extremely small footprint, simplicity, and portability across diverse hardware platforms. Unlike comprehensive crypto libraries, it offers a minimal, focused implementation that's verified against NIST standards while remaining public domain with no licensing overhead.
Small portable AES128/192/256 in C
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Compiled ARM binary can be under 1KB with only CTR mode enabled, using less than 200 bytes of RAM, as demonstrated in the README's size output for THUMB instruction set.
Successfully tested on 64-bit x86, 32-bit ARM, and 8-bit AVR platforms, ensuring portability across diverse embedded systems and microcontrollers.
Clean functions like AES_init_ctx and AES_CBC_encrypt_buffer provide straightforward encryption and decryption without complex abstractions, as shown in the code snippet.
Supports ECB, CBC, and CTR modes via compile-time defines in aes.h, allowing developers to include only what they need to minimize code size.
All code is in the public domain with no restrictions, making it easy to integrate into any project without legal overhead.
No built-in padding for CBC and ECB modes; buffers must be multiples of 16 bytes, forcing developers to implement PKCS7 or similar externally, as noted in the README.
No protection against out-of-bounds memory access errors, making it susceptible to crashes or vulnerabilities from malicious input, which the README explicitly warns about.
Prioritizes small code size over speed, so it's significantly slower than libraries like Mbed TLS or OpenSSL, as admitted in the README for high-throughput scenarios.
ECB mode is not implemented in streaming mode and is considered unsafe for most uses, requiring careful handling to avoid security pitfalls, per the README's warnings.