Using WEP encryption with Wifi Kit

I am having trouble using WEP encryption with the Wifi Application Kit.

If I disable WEP then I can correctly ping the board. However with WEP enable and with the correct keys used I cannot not ping it on my network at home.

I am using a Netcomm combined router/adsl modem 4 port hub wireless unit and it works fine on all the computers at home.

Is there any special trick to this. I am using the correct function calls.

Is there any special order that the function wifi_ioctl() need to be called?

What are the correct values for WIFI_WEP_AUTH?

What is the difference between WIFI_OWNSSID and WIFI_SSID?

regards

After spending many hours trying to get the WEP encryption to work I have finally found out the problem using WEP keys.

The examples that are given in the application notes (AN404) are wrong with the description of the WEP key arrays.

The given example of keys is.
unsigned key0[13] = { 0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56 };
unsigned key1[13] = { 0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56 };
unsigned key2[13] = { 0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56 };
unsigned key3[13] = { 0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56 };

The declaration of these keys should be as chars as in

unsigned char key0[13] = { 0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56 };
unsigned char key1[13] = { 0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56 };
unsigned char key2[13] = { 0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56 };
unsigned char key3[13] = { 0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x56 };

The reason for this is the compiler assumes that they are integers so when the call is made to functions

wifi_ioctl(NULL,WIFI_WEP_KEY0,key0,sizeof(key0)); // set 128bit (13 bytes) key
wifi_ioctl(NULL,WIFI_WEP_KEY1,key1,sizeof(key1)); // set 128bit (13 bytes) key
wifi_ioctl(NULL,WIFI_WEP_KEY2,key2,sizeof(key2)); // set 128bit (13 bytes) key
wifi_ioctl(NULL,WIFI_WEP_KEY3,key3,sizeof(key3)); // set 128bit (13 bytes) key

then the sizeof function will assume that they are integers and not chars hence the size of the key is wrong

If the correct declaration is made then the WEP encryption works.

cheers

Thanks for sharring, and saving others the time.

Of course, WEP is very weak as an encryption system. See http://en.wikipedia.org/wiki/Wired_Equivalent_Privacy

If your data to/from the rabbit is critical, you might want to consider a stronger encryption as discussed in the same wiki item.