No description
  • C 98.7%
  • Makefile 1.3%
Find a file
2018-11-29 18:34:13 +01:00
.obj Basic structure 2018-10-16 10:40:20 +02:00
doc Basic structure 2018-10-16 10:40:20 +02:00
.gitignore Ignore binary 2018-11-13 19:36:40 +01:00
config.h Documentation 2018-11-22 17:15:56 +01:00
libaes.c Comment needs to be above 2018-11-28 20:46:27 +01:00
libaes.h Refactor: Declare internal functions as 'static' (which apparently makes a difference of ~10% speed 2018-11-22 17:15:33 +01:00
main.c Initialize library 2018-11-22 17:16:26 +01:00
main.h AES dummy program which supports ECB+CBC 2018-11-21 21:01:00 +01:00
Makefile Clean test binary 2018-11-28 22:55:23 +01:00
README.md Formatting MD 2018-11-29 18:34:13 +01:00
test.c Initialize library 2018-11-22 17:16:26 +01:00
test.h Implemented correct tests. 2018-11-20 18:02:40 +01:00

Advanced Encryption Standard

As a self-imposed programming challenge I started to have a closer look into the topic of Cryptography. I wanted to know much more about the (probably) most important cipher in the world: The Advanced Encryption Standard.

The following articles will describe some of the history and mathematical background but mostly they will cover the adventure of writing my own implementation of an AES library in C, which can be found here: https://gogs.gfuzz.de/oliver.peter/AES/releases

Blog articles

Overview : Advanced Encryption Standard (AES, 2001)

AES (1/3): An Introduction to Galois Fields

AES (2/3): A Description of AES Lookup Tables

AES (3/3): Encryption and Decryption

Public library functions

A key has to be an array of 16x 8bit elements.

static const uint8_t key[16] =
{
    0x2b, 0x7e, 0x15, 0x16,
    0x28, 0xae, 0xd2, 0xa6,
    0xab, 0xf7, 0x15, 0x88,
    0x09, 0xcf, 0x4f, 0x3c
};

An input state has to be an array of 16x 8bit elements

static const uint8_t state[16] =
{
    0xae, 0x2d, 0x8a, 0x57,
    0x1e, 0x03, 0xac, 0x9c,
    0x9e, 0xb7, 0x6f, 0xac,
    0x45, 0xaf, 0x8e, 0x51
};

Inputs where taken from the original AES paper, Appendix A.

Library functions have to be initialized (lookup tables and key schedule) by providing a pointer to the secret key

uint8_t aes_init(const uint8_t *key);

An input state, for both enciphering and deciphering, has to be a pointer to a 128bit block

uint8_t aes_encrypt(uint8_t *state);
uint8_t aes_decrypt(uint8_t *state);

License

Educational purpose only.