change char key[] to unsigned char key[]