Visit our Sponsor   Visit our Sponsor
delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
500 Users Online NOW
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback





Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi



Loremo - the 1.5 liter car coming in 2009




Startblatt.de






Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (2)


Generate WEP (Wired Equivalent Privacy) keysGo to Ronald Buster's websiteFormat this article printer-friendly!Bookmark function is only available for registered users!
Product:
Delphi all versions
Category:
Algorithm
Skill Level:
Scoring:
Last Update:
08/02/2004
Search Keys:
delphi delphi3000 article borland vcl code-snippet wep key wired strong encryption
Times Scored:
3
Visits:
1981
Uploader: Ronald Buster
Company: DISPI software Engineering
Reference: http://www.dispi.com
 
Question/Problem/Abstract:
Ever wanted to know how WEP (Wired Equivalent Privacy) encryption for wireless networks are generated with Strong keys : 64/128/152/256-bit

enjoy

Ronald
Answer:



// WEPKEY algoritm

type WEPKINDTYPE = ( WEPKT64, WEPKT128, WEPKT152, WEPKT256);

const WEP_ASCIIArray : array [0..94] of char =
       (' ', '!', '"', '#', '$', '%', '&', '\', '(', ')',
        '*', '+', ',', '-', '.', '/','0', '1', '2', '3',
        '4', '5', '6', '7', '8', '9', ':', ';', '<', '=',
        '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
        'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
        'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[',
        '\', ']', '^', '_', '''', 'a', 'b', 'c', 'd', 'e',
        'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
        'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
        'z', '{', '|', '}', '~');

       WEP_HEXArray : array [0..94] of string =
        ('20','21','22','23','24','25','26','27','28','29',
         '2A','2B','2C','2D','2E','2F','30','31','32','33',
         '34','35','36','37','38','39','3A','3B','3C','3D',
         '3E','3F','40','41','42','43','44','45','46','47',
         '48','49','4A','4B','4C','4D','4E','4F','50','51',
         '52','53','54','55','56','57','58','59','5A','5B',
         '5C','5D','5E','5F','60','61','62','63','64','65',
         '66','67','68','69','6A','6B','6C','6D','6E','6F',
         '70','71','72','73','74','75','76','77','78','79',
         '7A','7B','7C','7D','7E');


function  WEPKEY ( var Value : string; Kind : WEPKINDTYPE = WEPKT128 ) : string;

  function LocateASCIIIndex( value : char ) : integer;
  var i : integer;
  begin
    Result := 0;

    for i := low(WEP_ASCIIArray) to high(WEP_ASCIIArray) do
      begin
        if Value = WEP_ASCIIArray[i] then
          begin
            result := i;
            break;
          end;
      end;

  end;

var i,j,t : integer;
    ts : string;

begin
  result := '';

  ts := trim(Value);

  case kind of
    WEPKT64  : t := 5;
    WEPKT128 : t := 13;
    WEPKT152 : t := 16;
    WEPKT256 : t := 29;
  end;

  if ts = '' then
    begin
      SetLength(Ts,T);
      for i := 1 to t do
        Ts[i] := WEP_ASCIIArray[random(high(WEP_ASCIIArray)-low(WEP_ASCIIArray))];
    end;

  if length(ts) < t then
    begin
      for i := 1 to t - length(ts) do
        Ts := Ts + WEP_ASCIIArray[random(high(WEP_ASCIIArray)-low(WEP_ASCIIArray))];
    end;

  for i := 1 to length(Ts) do
    begin
      j := LocateASCIIIndex(Ts[i]);
      Result := Result + WEP_HexArray[j];
    end;

  Value := Ts;

end;






Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment
Doesn't work
    uh no (Dec 5 2004 11:47PM)

Doesn't work as published. Does anybody proof this stuff?
Respond

RE: Doesn't work
Ronald Buster (Dec 6 2004 9:36AM)

it works great, we use it in covering our wireless networking.
Respond














 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
E. Irigoyen
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)