VB icon

WEP Key generater v1.0

Submitted on: 8/31/2016 9:29:21 PM
By: Ben128  
Level: Beginner
User Rating: Unrated
Compatibility: C++ (general), Microsoft Visual C++
Views: 1234
     Beginner that can generate random wep keys for your wifi network. Hope you find it usfull.

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
// Name: WEP Key generater v1.0
// Description:Beginner that can generate random wep keys for your wifi network. Hope you find it usfull.
// By: Ben128

//WEP Random Key Generate v1.0
//By DreamVB
#include <iostream>
#include <time.h>
using namespace std;
using std::cout;
using std::endl;
string WepKey(int KeySize){
	string sCharMap = "\"'!#$%&()*+-./0123456789:;,<=>?@ABCDEFGHIJKL"
	string rPws = "";
	int i = 0;
	//Create random key of KeySize
	while (i < KeySize){
		rPws += sCharMap[rand() % strlen(sCharMap.c_str() +1)];
		//INC Counter
	//Return random key
	return rPws;
int main(int argc, char *argv[]){
	char c = '\0';
	int option = 0;
	int s_keysize = 0;
	//Clear screen.
	cout << "--------------------------------" << endl;
	cout << "|WEP Key Generator |" << endl;
	cout << "--------------------------------" << endl;
	cout << "[1] Generate 64-bit key" << endl;
	cout << "[2] Generate 128-bit key" << endl;
	cout << "[3] Generate 152-bit key" << endl;
	cout << "[4] Generate 256-bit key" << endl;
	cout << "Enter option: ";
	cin >> option;
	//Test option
	switch (option){
		case 0:
			cout << "Wrong option entered" << endl;
		case 1:
			s_keysize = 5;
		case 2:
			s_keysize = 13;
		case 3:
			s_keysize = 16;
		case 4:
			s_keysize = 29;
	//Output random wep key
	cout << endl << "Your random wep key is : " << WepKey(s_keysize).c_str();
	cout << endl << endl;
	//Ask user do they want to try agian.
	cout << "Generate new wep key Yes(y) / No(n) ";
	//Read in char
	cin >> c;
	if ((c == 'y') || (c =='Y')){
		//Goto start of program.
		goto top;
	return 0;

Other 50 submission(s) by this author


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

 There are no comments on this submission.

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)

To post feedback, first please login.