repl.it
@cream_puff_four/

Random Password Generator

C++11

No description

fork
loading
Files
  • main.cpp
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <cstdio>
using namespace std;
int main () {
	srand(time(0));
	int length;
	cout << "enter a length for your password." << endl;
	string eat;
	cout << "enter yes for guidance" << endl;
	cin >> eat;
	if (eat == "yes") {
		cout << "1 - 6 characters = weak" << endl;
		cout << endl;
		cout << "7 - 10 characters = average"	<< endl;
		cout << endl;
		cout << "10 - 16 characters = strong" << endl;
		cout << endl;
		cout << "17 - 25 characters = extremely strong" << endl;
		cout << endl;
		cout << "26 - 40 characters = unbreakable" << endl;
		cout << endl;
		cout << "41 - 60 characters = unbelievable" << endl;
		cout << endl;
		cout << "61 - 80 characters = unspeakable" << endl;
		cout << endl;
		cout << "81 - 120 characters = Expert" << endl;
		cout << endl;
		cout << "121 - 180 characters = extreme" << endl;
		cout << endl;
		cout << "181 - 250 characters = deadly" << endl;
		cout << endl;
		cout << "251 - 400 characters - CIA proof" << endl;
		cout << endl;
		cout << "401 - 750 characters - FBI proof" << endl;
		cout << endl;
		cout << "751 - 1500 characters - Einstein material" << endl;
		cout << endl;
		cout << "1501 - 5000 characters - Demon" << endl;
		cout << endl;
		cout << "5001 - 20000 characters - Face it, nobody's going to go through so much trouble just for this" << endl;
		cout << endl;
		cout << "20001 - 50000 characters - r u insane?" << endl;
		cout << endl;
		cout << "50001 - 100000 characters - yes u r insane" << endl;
		cout << endl;
		cout << "100000 - 500000 characters - there would be an error message" << endl;
		cout << endl;
		cout << "500001 - 1000000 characters - Merciless Password" << endl;
		cout << endl;
		cout << "10000001+ - Why Bother?" << endl; 
	}	
	cout << "enter your password's length (no more than 10,000,000 characters): ";
	cin >> length;
	while (length > 10000000) {
		if (rand() % 6 == 0) {
			cout << "Oops, your password length was too long. Try again!" << endl;
		}	
		if (rand() % 6 == 1) {
			cout << "Shorter password please!" << endl;
		}
		if (rand() % 6 == 2) {
			cout << "Your password length was over 10 million. Don't get too high expectations!" << endl;
		}
		if (rand() % 6 == 3) {
			cout << "Really, a password with over 10 million characters. Who's after you, the FBI?" << endl;
		}
		if (rand() % 6 == 4) {
			cout << "It says no more than 10,000,000 characters, ok?" << endl;
		}
		if (rand() % 6 == 5) {
			cout << "The longer the better, but not THAT much!" << endl;
		}
		cin >> length;
	}
	cout << "Generating..." << endl;
	cout << "Generating..." << endl;
	cout << "Generating..." << endl;
	for (int i = 0; i < length(); i ++) {
		char c = rand() % 93 + 33;
		cout << c << endl;
	}
}