-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrndpwgen.py
152 lines (123 loc) · 6.42 KB
/
rndpwgen.py
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# rndpwgen - a human-friendly random password generator
# with a dangerously furry and distinctly geeky
# sort of inclination
# Written by Horst Burkhardt <horst@wilcox-tech.com>
# Based on corgirpw.b by Andrew Wilcox <awilcox@wilcox-tech.com>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal with the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimers.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimers in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the names of rndpwgen, nor Wilcox Technologies, nor the names of
# its contributors may be used to endorse or promote products derived
# from this Software without specific prior written permission.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# WITH THE SOFTWARE.
import sys
# Some sanity so this will run on versions of Python that don't include the
# Mersenne Twister deterministic number generator.
if (int(sys.version_info[0])) == (int(3)):
from random import choice
from random import randint
elif (int(sys.version_info[0])) == (int(2)):
if (int(sys.version_info[1])) >= (int(4)):
from random import choice
from random import randint
elif (int(sys.version_info[1])) <= (int(3)):
from whrandom import seed
from whrandom import choice
from random import randint
whrandom.seed
elif (int(sys.version_info[0])) == (int(1)):
from random import seed
from random import choice
from random import randint
random.seed
# Stage 1 will randomise out an element of the natural world, via
# multiple-round selection.
# Cat, Dog, or Horse?
dogs = ['corgi','saluki','husky','malamut','yorkshire','labrador','heeler','beagle','dalmatian','poodle','cocker','collie','dachshund','greyhound','rottweiler','maltese','doberman','bichon','pomeranian','schaeferhund','terrier','bulldog','akita','mastiff','staffordshire','basset','whippet','pointer','chihuahua','setter','harrier','vallhund','kintamani','schnauzer','afghan','vizsla','mioritic','elkhound','samoyed','navarro','spitz','tahltan','papillon','posavac','sharpei','sloughi','lapphund','tamaskan','coonhound','foxhound','weimaraner','akbash','canaan','kelpie']
cats = ['russianblue','sphynx','englishblue','ragdoll','abyssinian','bengal','scottishfold','mist','balinese','siamese','birman','chartreux','savannah','burmilla','mau','javanese','korat','manx','mainecoon','napolean','ocelot','peterbald','selkirk','vankedisi','angora','levkoy','tonkinese','snowshoe','somali','ragamuffin','bobtail','nebelung','cymric','malayan']
horses = ['abtenauer','andalusian','arabian','criollo','brumby','auvergne','auxois','banker','bardigiano','brabant','blazer','castilian','catria','clydesdale','comtois','don','falabella','finnhorse','fjordhorse','freiberger','karabair','iomud','heihe','haflinger','gelderland','galiceno','gidran','hirzai','lipizzan','jutland','kladruber','kinsky','kustanair','lokai','lyngshest','fouta','malapolski','mecklenburger','messara','mongolian','ostfriesen','novokirghiz','nivernais','nangchen','pampa','percheron','pintabian','retuerta','quarab','qatgani','rhinelander','samolaco','sarcidano','silesian','sorraia','sokolsky','taishuh','tawleed','tersk','tolfetano','trakehner','uzunyayla','vlaamperd','waler','warlander','wielkopolski','xilingol','yonaguni']
# Final list of animals
fauna = []
# Stage 2 is a list of CPUs.
alus = ['Z80','R6502','65C02','MC6800','MC68030','Intel960','Intel386','Z8002','AXP20','PPC603ev','Intel486','MPC750','MPC640','MPC7400','MPC7450','Vger','PPC970','ARM7','ARM9','StrongARM','Athlon64','Am586','Am386','LispM','R2500','R4000','R12000','TMS9900','NSC800','WE32000','Crusoe','C3','C7','WinChip','SuperH']
# Stage 3 is a pair of symbols (not necessarily matching) encircling
# the CPU from Stage 2.
sympool = ['!','@','#','$','%','^','&','*','[','(','{',']',')','}',',',':','<','>','?','~','-','=','+']
# Stage 1 Selection
# Will result in array 'key1m' after multiple-round selection.
key1a = []
key1b = []
key1m = []
for dognum in range(0,12):
fauna.append(choice(dogs))
continue
for catnum in range(0,12):
fauna.append(choice(cats))
continue
for horsenum in range(0,12):
fauna.append(choice(horses))
continue
for key1prog in range(0,8):
key1a.append(choice(fauna))
continue
fauna = []
for dognum in range(0,12):
fauna.append(choice(dogs))
continue
for catnum in range(0,12):
fauna.append(choice(cats))
continue
for horsenum in range(0,12):
fauna.append(choice(horses))
continue
for key1prog in range(0,8):
key1b.append(choice(fauna))
continue
fauna = []
for key1prog in range(0,4):
key1m.append(choice(key1b))
key1m.append(choice(key1a))
continue
# Stage 2 multiple-round selection. Will result in array
# 'key2m' from which a final result may be chosen.
key2a = []
key2b = []
key2m = []
for key2prog in range(0,8):
key2a.append(choice(alus))
key2b.append(choice(alus))
continue
for key2prog in range(0,4):
key2m.append(choice(key2b))
key2m.append(choice(key2a))
continue
# Final key assembly
temppass = []
symencap = []
for symbol in range(0,2):
symencap.append(choice(sympool))
continue
temppass.append(str(int(randint(0,99))))
temppass.append(str(choice(key1m)))
temppass.append(str(symencap[1]))
temppass.append(str(choice(key2m)))
temppass.append(str(symencap[0]))
print "{0}{1}{2}{3}{4}".format(temppass[0], temppass[1], temppass[2], temppass[3], temppass[4])
sys.exit