XOS>> aes>> 返回
项目作者: kimbo

项目描述 :
AES implementation in C
高级语言: C
项目地址: git://github.com/kimbo/aes.git
创建时间: 2020-09-03T19:39:56Z
项目社区:https://github.com/kimbo/aes

开源协议:

下载


AES

This repo contains a proof of concept AES implementation in C. It supports 128, 192, and 256 bit keys.

It was done for my own personal education and is NOT SUITABLE FOR PRODUCTION.

Setup

  1. git clone https://github.com/kimbo/aes.git
  2. cd aes
  3. make
  4. ./aes

Usage

  1. Usage: ./aes <key> <decrypt/encrypt> <msg>

Given a 128 bit key 604a843ed6a8eddb6e985b37f0e0a36a and a message 39c5925f2b4447956f3c08054895864a,
you can encrypt it like so:

  1. $ ./aes 604a843ed6a8eddb6e985b37f0e0a36a encrypt 39c5925f2b4447956f3c08054895864a
  2. # ... lots of debug info
  3. round[10].output 4ff6c50f676232ac7df39c9ec436e49b

Then to decrypt it, you can do the following:

  1. $ ./aes 604a843ed6a8eddb6e985b37f0e0a36a decrypt 4ff6c50f676232ac7df39c9ec436e49b
  2. # ...
  3. round[10].output 39c5925f2b4447956f3c08054895864a

Tada!

Tests

Tests include unit tests and also the tests in FIPS Appendix C for 128, 192, and 256 bit keys.

  1. git clone https://github.com/kimbo/aes.git
  2. cd aes
  3. make test # build the tests
  4. ./test # run unit tests and tests in FIPS Appendix C