author | llornkcor <llornkcor> | 2003-07-08 23:58:40 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-07-08 23:58:40 (UTC) |
commit | 4cc87752584c08d1267cc389142777db5faba302 (patch) (unidiff) | |
tree | 9b2e823ed55d76b04eb4f6bb16cb0fbdc7fcbdb7 | |
parent | d94b6f057d7f4506a8b5d95a06ef36f0800e7848 (diff) | |
download | opie-4cc87752584c08d1267cc389142777db5faba302.zip opie-4cc87752584c08d1267cc389142777db5faba302.tar.gz opie-4cc87752584c08d1267cc389142777db5faba302.tar.bz2 |
silly 128 bit wep keygen.
-rw-r--r-- | development/wepgen/wepgen.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/development/wepgen/wepgen.c b/development/wepgen/wepgen.c new file mode 100644 index 0000000..42aca2f --- a/dev/null +++ b/development/wepgen/wepgen.c | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | Simple program to emulate the "text" mode of supplying WEP keys. | ||
3 | The procedure only uses the ASCII codes of the characters as WEP | ||
4 | key bits (13 characters produces 104 bits as needed by 128-bit | ||
5 | WEP). Such keys of course do not have much entropy, but that is | ||
6 | a choice for the installation to make. | ||
7 | */ | ||
8 | #include <stdio.h> | ||
9 | |||
10 | int main(int argc, char** argv) | ||
11 | { | ||
12 | int a=0,l; | ||
13 | char* c=argv[1]; | ||
14 | if ( argc != 3 || !*c ) { | ||
15 | fprintf(stderr, "Usage: %s textkey [length]\n",argv[0]); | ||
16 | exit(1); | ||
17 | } | ||
18 | l = atoi(argv[2]); | ||
19 | while (l) { | ||
20 | if ( !*c ) c=argv[1]; | ||
21 | printf("%02x",*c); | ||
22 | c++; | ||
23 | if ( --l ) | ||
24 | printf(":"); | ||
25 | } | ||
26 | printf("\n"); | ||
27 | } | ||