From: couturie Date: Sat, 30 Sep 2017 12:28:30 +0000 (+0200) Subject: new X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/commitdiff_plain/ad75149ea8d6c07ac4477018b5355a559b5117bf?ds=sidebyside new --- diff --git a/Arduino/sketch_AES_other2/sketch_AES_other2.ino/sketch_AES_other2.ino.ino b/Arduino/sketch_AES_other2/sketch_AES_other2.ino/sketch_AES_other2.ino.ino new file mode 100644 index 0000000..68aecfd --- /dev/null +++ b/Arduino/sketch_AES_other2/sketch_AES_other2.ino/sketch_AES_other2.ino.ino @@ -0,0 +1,123 @@ +#include + + + + +int size_mesg=256; + +byte *key = (unsigned char*)"0123456789010123"; +byte *iv = (unsigned char*)"9210123456789010"; + + +void printArray(byte *mes, int n) { + for (byte i = 0; i < n; i++) { + Serial.print(mes[i]); + Serial.print(" "); + } + Serial.println(); +} + + + +void setup() { + // put your setup code here to run once: + Serial.begin (57600) ; +// printf_begin(); + delay(500); +} + +void loop() { + // put your main code here, to run repeatedly: + byte myiv[AES_IV_SIZE]; + memcpy(myiv, iv, AES_IV_SIZE); + //printArray(myiv,AES_IV_SIZE); + AES aes(key, myiv, AES::AES_MODE_128, AES::CIPHER_ENCRYPT); + + uint8_t plain[size_mesg]; + uint8_t cipher [size_mesg] ; + uint8_t check [size_mesg] ; + + + randomSeed(334); + for(int i=0;i