Arduino XOR Encryption Function

Simple, yet effective XOR encryption function I wrote for Arduino...


char* XORENC(char* in, char* key){
  // Brad @ pingturtle.com
  int insize = strlen(in);
  int keysize = strlen(key);
  for(int x=0; x<insize; x++){
    for(int i=0; i<keysize;i++){
      in[x]=(in[x]^key[i])^(x*i);
    }
  }
  return in;
}


Posted 1/25/2012 by Brad