Show Posts
Pages: [1]
1  Community / Exhibition / Gallery / Re: USB Power Sense Home Easy controller + basic Arduino UPS on: January 21, 2013, 03:24:39 pm
Wow this is a genius idea. I would love to see a schematic of how everything is wired up - would you mind sending it on?

I've got to try this one myself. Much cheaper solution than having Power Cell - LiPo Charger/Booster I've seen used elsewhere. Im thinking of having a unit that will announce when its started up and shut down - this solution would be perfect.
2  Development / Other Software Development / Re: new AES library on: January 20, 2013, 11:12:17 am
Thanks to robtillaart for putting me on the right track. Fundamental mistake on my part. When transferring string value to char array, I needed to size array to str.length() + 1 and also null terminate the final element.
3  Development / Other Software Development / Re: new AES library on: January 19, 2013, 05:26:04 am
Not looking to encrypt bulk data, just more than 16 characters each time.
4  Using Arduino / Project Guidance / Re: Is there a crypto ported to Arduino? on: January 16, 2013, 05:38:32 pm
Hi,

We are on a similar encryption journey. I have hit the N_BLOCK limit using this AES library and am loosing the remaining transmission text. To get around it, I am attempting multi-dimentional arrays of plaintext & ciphertext and rebuilding at the end. If you completed any more on this, I would be delighted to see. If not, I can keep you posted with my progress (or lack of!).

BTW, security is good for a bot, 3rd parties could cause it to misbehave, but you would be liable for the damage.

Thanks,

Dauhee.
5  Development / Other Software Development / Re: String Encryption for Uno (ATMega328) on: January 16, 2013, 05:28:50 pm
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 smiley-sad

Code:
#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.html

And additional help from:
http://arduino.cc/forum/index.php/topic,96197.0.html

Any assistance would help minimise my hair loss smiley


Moderator edit: session ID removed from link.
6  Development / Other Software Development / Re: new AES library on: January 16, 2013, 05:21:35 pm
Thank you so much for this extremely useful library. I'm not too "up" on C. Would you have any examples on encrypting a string that is longer than the N_BLOCK?

I have hit a stumbling block (no pun intended), and am trying multi-dimentional arrays to create blocks for encrypting/decrypting - I haven't gotten it working so am not even sure if plain and cipher will always be the same length.
7  Development / Other Software Development / Re: String Encryption for Uno (ATMega328) on: January 16, 2013, 03:06:20 pm
It is for transmission over virtualwire between arduino units. I had looked at XOR but its very weak. XTEA, SKipjack, DES, AES, anything will do!

Thanks.
8  Development / Other Software Development / String Encryption for Uno (ATMega328) on: January 16, 2013, 11:06:51 am
Hi All,

I have tried unsuccessfully to perform string encryption. My grasp of the C language is not good. I have tried existing libraries without success, such as skipjack from avr-crypto, and also AES from another source.

If anybody was able to provide some assistance, I would be much appreciative!

Thanks,

Dauhee.
Pages: [1]