• Stars
    star
    349
  • Rank 121,528 (Top 3 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created almost 13 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Arduino Library for AES Encryption (source based on avr-crypto-lib)

As people keep opening issues, a few notes:

Arduino AESLib

This project is just an Arduino ready extract from the AVR-Crypto-Lib.

It only packages the ASM implementations of AES into a library ready to use in Arduino IDE.

See the LICENSE file for details of the GPLv3 license in which the AVR-Crypo-Lib is licensed.

Installation

  • Download the files in this repository (using either clone or the download button)
  • Copy the AESLib folder into libraries folder (same level as your sketch folder)
  • add #include <AESLib.h> in your sketch.

Usage

At the moment only 128bit keys are supported, the blocksize is also fixed at 128bit. This means that the key array and possible iv array should contain exactly 16 bytes (uint8_t or byte). Moreover the amount of bytes to encrypt should be mod 16. (this means you have to take care of padding yourself).

The library supports 3 kinds of operations.

  1. single block encryption/decryption
  • multiple block encryption/decryption using CBC (single call)
  • multiple block encryption/decryption using CBC (multiple calls)

The single block enc/decryption are the following methods:

void aes128_enc_single(const uint8_t* key, void* data);
void aes128_dec_single(const uint8_t* key, void* data);

Usage example:

Serial.begin(57600);
uint8_t key[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
char data[] = "0123456789012345"; //16 chars == 16 bytes
aes128_enc_single(key, data);
Serial.print("encrypted:");
Serial.println(data);
aes128_dec_single(key, data);
Serial.print("decrypted:");
Serial.println(data);

Usage example for AES256:

Serial.begin(57600);
uint8_t key[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
char data[] = "0123456789012345";
aes256_enc_single(key, data);
Serial.print("encrypted:");
Serial.println(data);
aes256_dec_single(key, data);
Serial.print("decrypted:");
Serial.println(data);

More Repositories

1

csvtools

GNU-alike tools for parsing RFC 4180 CSVs at high speed.
C
97
star
2

compact25519

A compact portable X25519 + Ed25519 implementation
C
31
star
3

portable8439

Portable 8439: ChaCha20-Poly1305 (RFC 8439) in portable & fast C99
C
26
star
4

p1-esp8266

P1 serial forwarder for use in HomeAssistent
C++
17
star
5

ncd

Script to calculate the normalized compression distance of sets of files. It also tries to parallize the work over the available processors.
Python
16
star
6

EFWrappableFields

Had enough of all those cast from int to enums when using Entity Framework? Do not trust the user of your entities with the collections? Wrap them with safer/better abstractions and use the EFWrappableFields library to support these wrapped properties in all expressions.
C#
6
star
7

tcp-forwarding-a-language-battle

C
4
star
8

ardmostat

Arduino Internet Thermostat
C++
3
star
9

aoc-2018

Go
3
star
10

event-driven-sudoku

I've previously had the idea of creating a event driven sudoku solution with no special algorithms except simple guessing and backtracking, now I've adapted an old version I started and tried to create this with the least amount of code needed.
Ruby
3
star
11

NBEthernet

Non Blocking variant of @arduino's W5100 Ethernet library.
C++
2
star
12

photo-stats

Want to know more about which photographic preferences you have? Get statistical!
Ruby
2
star
13

StateDuino

An DSL for the state managing in an Arduino application
2
star
14

ardmostat-heroku

The cloud hosted part of the Arduino Thermostat
JavaScript
2
star
15

tom-en-anna.landman.cloud

Tom's website
HTML
1
star
16

WMAdvancedNavigonStarter

Have a windows mobile phone, and want to start navigon with a few pre actions, here is a nice start
C#
1
star
17

davylandman.github.io

CSS
1
star
18

l7knockknock

Hiding one application behind another tcp port, only after a specific string is send, can you connect to the hidden application.
C
1
star