{"id":13420394,"url":"https://github.com/DavyLandman/AESLib","last_synced_at":"2025-03-15T06:32:57.959Z","repository":{"id":2373898,"uuid":"3338675","full_name":"DavyLandman/AESLib","owner":"DavyLandman","description":"Arduino Library for AES Encryption (source based on avr-crypto-lib)","archived":false,"fork":false,"pushed_at":"2022-03-11T15:50:55.000Z","size":55,"stargazers_count":350,"open_issues_count":1,"forks_count":106,"subscribers_count":36,"default_branch":"master","last_synced_at":"2024-10-11T19:59:53.023Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DavyLandman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-02T20:51:55.000Z","updated_at":"2024-07-30T13:05:37.000Z","dependencies_parsed_at":"2022-09-24T12:50:54.267Z","dependency_job_id":null,"html_url":"https://github.com/DavyLandman/AESLib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavyLandman%2FAESLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavyLandman%2FAESLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavyLandman%2FAESLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavyLandman%2FAESLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavyLandman","download_url":"https://codeload.github.com/DavyLandman/AESLib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221553275,"owners_count":16841997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T22:01:32.750Z","updated_at":"2024-10-26T16:30:22.266Z","avatar_url":"https://github.com/DavyLandman.png","language":"C","readme":"As people keep opening issues, a few notes:\n\n- This code is for AVR based arduino chips. So esp8266 is not supported. However, [Arduino ESP8266 has AES/CBC build in via BearSSL](https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/bearssl-client-secure-class.html)\n- I would advice switching to [my portable Chacha20-Poly1305 library](https://github.com/DavyLandman/portable8439) it should compile on most boards. Has better cryptographic properties, and is often faster.\n\n\nArduino AESLib \n==============\n\nThis project is just an Arduino ready extract from the [AVR-Crypto-Lib](https://github.com/cantora/avr-crypto-lib).\n\nIt only packages the ASM implementations of AES into a library ready to use in\nArduino IDE.\n\nSee the LICENSE file for details of the GPLv3 license in which the AVR-Crypo-Lib\nis licensed.\n\n\nInstallation\n------------\n\n- Download the files in this repository (using either clone or the download button)\n- Copy the `AESLib` folder into `libraries` folder (same level as your `sketch` folder)\n- add `#include \u003cAESLib.h\u003e` in your sketch.\n\n\nUsage\n-----\n\nAt the moment only 128bit keys are supported, the blocksize is also fixed at 128bit.\nThis means that the key array and possible iv array should contain exactly 16 bytes (`uint8_t` or `byte`).\nMoreover the amount of bytes to encrypt should be mod 16. \n(this means you have to take care of padding yourself).\n\nThe library supports 3 kinds of operations.\n\n1. single block encryption/decryption\n-  multiple block encryption/decryption using CBC (single call)\n-  multiple block encryption/decryption using CBC (multiple calls)\n\nThe single block enc/decryption are the following methods:\n\n```c\nvoid aes128_enc_single(const uint8_t* key, void* data);\nvoid aes128_dec_single(const uint8_t* key, void* data);\n```\n\nUsage example:\n\t\n```c\nSerial.begin(57600);\nuint8_t key[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};\nchar data[] = \"0123456789012345\"; //16 chars == 16 bytes\naes128_enc_single(key, data);\nSerial.print(\"encrypted:\");\nSerial.println(data);\naes128_dec_single(key, data);\nSerial.print(\"decrypted:\");\nSerial.println(data);\n```\n\nUsage example for AES256:\n\t\n```c\nSerial.begin(57600);\nuint8_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};\nchar data[] = \"0123456789012345\";\naes256_enc_single(key, data);\nSerial.print(\"encrypted:\");\nSerial.println(data);\naes256_dec_single(key, data);\nSerial.print(\"decrypted:\");\nSerial.println(data);\n```\n\n\n\n","funding_links":[],"categories":["TODO scan for Android support in followings","Libraries","Miscellaneous"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDavyLandman%2FAESLib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDavyLandman%2FAESLib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDavyLandman%2FAESLib/lists"}