help me please witch decryption text.
i have two arduino.
First was transmit and the second is receiver.
I realized
transmit-->>encryption-->>send-->>recive(encrypted)-->>decryption-->>Send to Screen Receiver
remains only decryption.
function aes128_dec_single(key, data);
but I can not understand how to get full buf for use aes128_dec_single(key, data);
Thank you in advance for your help..
transmit
#include <VirtualWire.h>
#include <AESLib.h>
void setup()
{
vw_setup(2000); // Bits per sec
}
void loop()
{
Serial.begin(57600);
uint8_t key[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
char msg[] = "testtesttesttest";
aes128_enc_single(key, msg);
vw_send((uint8_t *)msg, 16);
vw_wait_tx(); // Wait until the whole message is gone
delay(1000);
}
receiver
#include <VirtualWire.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <AESLib.h>
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup()
{
delay(1000);
lcd.begin();
lcd.backlight();
vw_setup(2000);
vw_rx_start(); // Start the receiver PLL running
}
void loop()
{
Serial.begin(57600);
uint8_t key[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if (vw_get_message(buf, &buflen)) // Non-blocking
{
int i;
lcd.clear();
Serial.print("Got: ");
lcd.print("Got: ");
for (i = 0; i < buflen; i++)
{
Serial.write(buf[i]);
lcd.write(buf[i]);
}
Serial.println();
}
delay(1000);
lcd.clear();
lcd.print("wait ");
}