https://github.com/francisrstokes/aes-c
A (non-production) implementation of AES for educational purposes
https://github.com/francisrstokes/aes-c
advanced-encryption-standard aes c cryptography from-scratch
Last synced: 3 months ago
JSON representation
A (non-production) implementation of AES for educational purposes
- Host: GitHub
- URL: https://github.com/francisrstokes/aes-c
- Owner: francisrstokes
- Created: 2022-05-27T05:55:25.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-29T15:14:19.000Z (about 4 years ago)
- Last Synced: 2025-03-20T17:08:20.513Z (about 1 year ago)
- Topics: advanced-encryption-standard, aes, c, cryptography, from-scratch
- Language: C
- Homepage:
- Size: 31.3 KB
- Stars: 20
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# AES Implementation In C
**⚠️ DO NOT USE THIS CODE IN PRODUCTION**
This is a very literal, non-performant, non-robust implementation of AES in pure C. It is likely to be vulnerable to side-channel timing attacks, and really shouldn't be used for anything aside from learning about how the AES algorithm works. I've tried to keep the code readable, and added comments to aid my own understanding.
## Features
- 128-bit encryption and decryption
- Electronic Code Book (ECB) mode of operation
- Cipher Block Chaining (CBC) mode of operation
## Building / Testing
```bash
make # to build
make test # to run the test suite
```
## Usage
```
Usage: aes-c [OPTION...] ...
Simple AES implementation
-d, --decrypt Decrypt.
-e, --encrypt Encrypt.
-i, --in-file=IN_FILE Input file.
-k, --key-file=KEY_FILE File containing 128-bit key.
-m, --mode=MODE Mode (ecb / cbc).
-o, --out-file=OUT_FILE Output file.
-t, --test Run the test suite.
-?, --help Give this help list
--usage Give a short usage message
-V, --version Print program version
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
Report bugs to https://github.com/francisrstokes/aes-c/issues.
```