public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* Re: [gentoo-user] Why iwconfig wlan0 enc can't work?
  @ 2011-10-21 19:36 99% ` Mick
  0 siblings, 0 replies; 1+ results
From: Mick @ 2011-10-21 19:36 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 2371 bytes --]

On Friday 21 Oct 2011 15:03:31 Lavender wrote:
> The essid of my dormitory wireless netword is "Rebellion"
>  and its password is "I'll leave it up to you"(It's OK to tell
>  you this private information :-) ) .
>  I typed command below
>  #iwconfig wlan0 up
>  #iwconfig wlan0 essid "Rebellion"
>  Commands above worked normally, then
> 
>  #iwconfig wlan0 mode master
> 
>  Our AP mode which iwlist shows is master,
>  but the command above failed. Error message was
>  "Invalid argument".

Yes, your AP is operating in 'master' mode, while your PC's wireless NIC 
operates in 'managed' mode since it is a wireless client.


>  Then I typed
>  #iwconfig wlan0 mode managed
>  This worked , 

Good.  :-)

>  then
>  #iwconfig wlan0 enc "I'll leave it up to you"
>  This failed with error message "Invalid argument"

The "I'll leave it up to you" is not an encryption *key*, but a passphrase.

Have you looked at all at the man page for iwconfig?  Read what it says under 
key/enc[ryption]:

"... Passphrase is currently not supported."

This means that you need to use the corresponding hexadecimal or ASCII 
encryption key.  The router should show what this is when you login in its 
administrative GUI.

Alternatively, you can try running a script like this to generate a md5 hash - 
no guarantees that it will work with your AP (different vendors have different 
implementations:
========================
#!/usr/bin/perl
# Perl script to convert a passphrase to a WEP key.
# By Aki Mimoto

use strict;
@ARGV or die "Usage: $0 passphrase\n";
print generate_key( @ARGV ), "\n";

sub generate_key {
# --------------------------------------------------
        require Digest::MD5;
        return substr Digest::MD5::md5_hex( substr( shift() x 64, 0, 64 ) ), 
0, 26;
}
========================

Make it executable (using chmod u+x name of file) and then run it with your 
passphrase.  Note, I just found this on Google and have not tried it myself.  
I would always use a hex or ASCII key instead.

Ideally though, I would not be using WEP encryption which all of the above 
applies to, because it is not secure.

PS.  You haven't told us if the AP is using WEP, but you have used a WEP 
command to enter your encryption key - so I'm giving you here a WEP related 
answer.  ;-)

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2011-10-21 14:03     [gentoo-user] Why iwconfig wlan0 enc can't work? Lavender
2011-10-21 19:36 99% ` Mick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox