if there was example code for XOR one time pad that would be fantastic!
The code I have been working with is as below. It only works for N_BLOCK chars which is 16. Any chars after that are ignored and don't get encrypted. I've tried to use multi-dimentional byte arrays and its getting ugly

#include <AES.h>
AES aes ;
void loop ()
{
}
void setup ()
{
Serial.begin (57600) ;
const int KEYLENGTH = 32;
char PassString[] = "This is hard to believe but true however";// this must be at least KEYLENGTH characters long
byte key[KEYLENGTH];
char Message[] = "A top secret message. 123456789012345678901234";
byte plain[strlen(Message)];
byte cipher[strlen(Message)];
byte decrypted[strlen(Message)];
String strData = "";
Serial.println("Starting AES test");
for (int i = 0; i < KEYLENGTH; i++)
{
key[i] = PassString[i];
}
for (int i = 0; i < strlen(Message); i++)
{
plain[i] = Message[i];
cipher[i] = 0;
decrypted[i] = 0;
}
if (aes.set_key(key, KEYLENGTH) != 0)
{
Serial.println(F("Failed to set key"));
}
for (int a = 0; a < (int)ceil((float)strlen(Message)/(float)N_BLOCK); a++)
{
//Serial.println(a);
}
if (aes.encrypt(plain, cipher) == 0)
{
Serial.print(F("encrypted char: '"));
for (int i = 0; i < strlen(Message); i++)
{
Serial.print(char(cipher[i]));
}
Serial.println(F("'"));
}
else
{
Serial.println(F("Failed to encrypt"));
}
if (aes.decrypt(cipher, decrypted) == 0)
{
Serial.print(F("decrypted char : '"));
for (int i = 0; i < strlen(Message); i++)
{
Serial.print(char(decrypted[i]));
}
Serial.println(F("'"));
}
else
{
Serial.println(F("Failed to decrypt"));
}
}
This is using the AES library under:
http://arduino.cc/forum/index.php/topic,88890.0.htmlAnd additional help from:
http://arduino.cc/forum/index.php/topic,96197.0.htmlAny assistance would help minimise my hair loss

Moderator edit: session ID removed from link.