How To Generate Random WEP Keys

When it comes to wireless networking, it is important to use a form of encryption called Wired Equivalent Privacy (WEP), so that only clients that know the "secret key" can connect to the wireless network.

While configuring a WiFi router we have to provide some WEP keys, the best is to generate random keys using our Linux, or any other Unix like OS.

$ dd if=/dev/random bs=1 count=13 2>/dev/null|xxd -ps

You will get something like:


This is a 104-bit key consist of 26 Hex digit, if you need a different key length just set count as follow:

  • 40 bits: count=5
  • 64 bits: count=8
  • 104 bits: count=13
  • 128 bits: count=16
  • 152 bits: count=19
  • 232 bits: count=29
  • 256 bits: count=32