2010年11月7日日曜日

AES128 and DES (ECB) library for Arduino

Arduino IDE 用の DES (ECB mode) と AES 128 bit のライブラリ.RFID メモリカードの読み書きなどのために,DES は gnulib の des.h/des.c を,AES128 は Jeff Tikkanen 氏の AVR 用インプリメンテーションを,それぞれ Arduino/libraries に入れる C++ クラス形式にしたもの.SRAM の節約のため,どちらも定数配列はプログラムメモリ PROGMEM を使うように,また AES のコードは復号時のラウンドキーを保存せず計算しなおすように変更してある.
gnulib DES のコードは Linux/Unix 用で,サイズが大きくなる.DES が真剣に必要なら,Atmel の Application Notes AVR230: DES Bootloader on tinyAVR and megaAVR devices を応用などするほうがいいだろう,AES のブートローダ AVR231: AES Bootloader on tinyAVR and megaAVR devices もあるようだ.
Data Encryption Standard (DES) in ECB (FIPS PUB 46 and many standards) and 128 bit key AES, the Advanced Encryption Standard (FIPS 197) codes as Arduino IDE library classes to adding encryption & decryption functionality for Arduino projects, such as RFID memory card reading and writing.

Des.zip
AES128.zip