# Using WEP encryption with Wifi Kit

**URL:** <https://forums.digi.com/t/using-wep-encryption-with-wifi-kit/9671>\
**Category:** Rabbit\
**Created:** [March 19, 2007, 11:40pm UTC](https://forums.digi.com/t/using-wep-encryption-with-wifi-kit/9671 "2007-03-19T23:40:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vorr1234](https://avatars.discourse-cdn.com/v4/letter/v/74df32/32.png) [@vorr1234](https://forums.digi.com/u/vorr1234)\
**Post date:** [March 19, 2007, 11:40pm UTC](https://forums.digi.com/t/using-wep-encryption-with-wifi-kit/9671/1 "2007-03-19T23:40:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vorr1234](https://avatars.discourse-cdn.com/v4/letter/v/74df32/32.png) [@vorr1234](https://forums.digi.com/u/vorr1234)\
**Post date:** [March 29, 2007, 11:51pm UTC](https://forums.digi.com/t/using-wep-encryption-with-wifi-kit/9671/2 "2007-03-29T23:51:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![seulater](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@seulater](https://forums.digi.com/u/seulater)\
**Post date:** [April 27, 2007, 6:47pm UTC](https://forums.digi.com/t/using-wep-encryption-with-wifi-kit/9671/3 "2007-04-27T18:47:51Z")

</div>

Thanks for sharring, and saving others the time.

---

<div class="post-metadata">

**Author:** ![User1054](https://avatars.discourse-cdn.com/v4/letter/u/e36b37/32.png) [@User1054](https://forums.digi.com/u/User1054)\
**Post date:** [July 4, 2007, 3:01am UTC](https://forums.digi.com/t/using-wep-encryption-with-wifi-kit/9671/4 "2007-07-04T03:01:05Z")

</div>

Of course, WEP is very weak as an encryption system. See [http://en.wikipedia.org/wiki/Wired\_Equivalent\_Privacy](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.
