From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-user+bounces-130106-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1RHKw0-0001cg-Ix
	for garchives@archives.gentoo.org; Fri, 21 Oct 2011 19:39:16 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 925C721C0D8;
	Fri, 21 Oct 2011 19:38:44 +0000 (UTC)
Received: from mail-ww0-f53.google.com (mail-ww0-f53.google.com [74.125.82.53])
	by pigeon.gentoo.org (Postfix) with ESMTP id 5CB2921C048
	for <gentoo-user@lists.gentoo.org>; Fri, 21 Oct 2011 19:37:00 +0000 (UTC)
Received: by mail-ww0-f53.google.com with SMTP id 36so5734967wwi.10
        for <gentoo-user@lists.gentoo.org>; Fri, 21 Oct 2011 12:37:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=from:reply-to:to:subject:date:user-agent:references:in-reply-to
         :mime-version:content-type:content-transfer-encoding:message-id;
        bh=gPrjEK49unXf6mE0T1iD9fNDZnhI1OGnm+PPkTfgQBE=;
        b=vkcWDBVITjhISpwFJUi7JzTezCpzQmvXfRJXSCy7LWAeSngiw5xbX9FoIfrtEGFRsM
         DQL7HqB/zfKb+tOU8XfdLcGRaybXdYzELEgAgSqjimcxAfoLCeqzDBrWYdYl8m8Oig0w
         DO5zLlm3dER8+9Y9RtgDbk0qXpB2JaAwQGcnw=
Received: by 10.216.230.67 with SMTP id i45mr311699weq.111.1319225819971;
        Fri, 21 Oct 2011 12:36:59 -0700 (PDT)
Received: from dell_xps.localnet (230.3.169.217.in-addr.arpa. [217.169.3.230])
        by mx.google.com with ESMTPS id es5sm23577354wbb.11.2011.10.21.12.36.58
        (version=TLSv1/SSLv3 cipher=OTHER);
        Fri, 21 Oct 2011 12:36:59 -0700 (PDT)
From: Mick <michaelkintzios@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Why iwconfig wlan0 enc can't work?
Date: Fri, 21 Oct 2011 20:36:51 +0100
User-Agent: KMail/1.13.7 (Linux/2.6.39-gentoo-r3; KDE/4.6.5; x86_64; ; )
References: <tencent_03448ADD17267ECD2D0383BF@qq.com>
In-Reply-To: <tencent_03448ADD17267ECD2D0383BF@qq.com>
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Content-Type: multipart/signed;
  boundary="nextPart1535543.hFBsWFhSUk";
  protocol="application/pgp-signature";
  micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <201110212037.01686.michaelkintzios@gmail.com>
X-Archives-Salt: 
X-Archives-Hash: 467bb4b2f3d5bbdccc8a2767e1dd4afc

--nextPart1535543.hFBsWFhSUk
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable

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
>=20
>  #iwconfig wlan0 mode master
>=20
>  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=20
operates in 'managed' mode since it is a wireless client.


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

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 und=
er=20
key/enc[ryption]:

"... Passphrase is currently not supported."

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

Alternatively, you can try running a script like this to generate a md5 has=
h -=20
no guarantees that it will work with your AP (different vendors have differ=
ent=20
implementations:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#!/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 ) )=
,=20
0, 26;
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

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

Ideally though, I would not be using WEP encryption which all of the above=
=20
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=20
command to enter your encryption key - so I'm giving you here a WEP related=
=20
answer.  ;-)

=2D-=20
Regards,
Mick

--nextPart1535543.hFBsWFhSUk
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iEYEABECAAYFAk6hyd0ACgkQVTDTR3kpaLbjHwCfXvLQjEnbYUyWLKexGjbWI5JH
2GQAnjPIyRX66T2zmY/DxYvgTHJTVYtA
=/DIF
-----END PGP SIGNATURE-----

--nextPart1535543.hFBsWFhSUk--