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 [thread overview]
Message-ID: <201110212037.01686.michaelkintzios@gmail.com> (raw)
In-Reply-To: <tencent_03448ADD17267ECD2D0383BF@qq.com>
[-- 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 --]
prev parent reply other threads:[~2011-10-21 19:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-21 14:03 [gentoo-user] Why iwconfig wlan0 enc can't work? Lavender
2011-10-21 14:08 ` Michael Mol
2011-10-21 19:36 ` Mick [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201110212037.01686.michaelkintzios@gmail.com \
--to=michaelkintzios@gmail.com \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox